marcinhlybin / prometheus-barman-exporter Goto Github PK
View Code? Open in Web Editor NEWBarman exporter for Prometheus
License: MIT License
Barman exporter for Prometheus
License: MIT License
Hello.
You recently accepted a pull request #12.
Could you increment package version please?
In repository we can see version 1.0.7
But in pip3 repos I see 1.0.8 version
pip3 search barman_exporter
barman_exporter (1.0.8) - Barman exporter for Prometheus
But version 1.0.8 also does not contain changes from this MR.
It looks like your pull request for barman #234 was accepted and merged. I can run this on my systems that have barman 2.9 deployed.
barman -f json list-backup server01 | jq .
Might be time to re-word the readme, to explain how to use it with the json output in the readme.md
Hi,
When I manually launch barman-exporter, I got this error :
Traceback (most recent call last):
File "/usr/local/bin/barman_exporter.py", line 41, in list_backup
server_name_and_ts, date, size, wal_size = backup_line.split("-")
ValueError: too many values to unpack (expected 4)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/barman_exporter.py", line 154, in <module>
core.REGISTRY.register(BarmanCollector(args.servers))
File "/usr/lib/python3.4/site-packages/prometheus_client/registry.py", line 24, in register
names = self._get_names(collector)
File "/usr/lib/python3.4/site-packages/prometheus_client/registry.py", line 64, in _get_names
for metric in desc_func():
File "/usr/local/bin/barman_exporter.py", line 122, in collect
backups_done, backups_failed = barman.list_backup(server_name)
File "/usr/local/bin/barman_exporter.py", line 48, in list_backup
server_name_and_ts, status = backup_line.split("-")
ValueError: too many values to unpack (expected 2)
barman version is 2.8
Python version is Python 3.4.5
Greate,
Dear @marcinhlybin
Plz add barman replication-status, ๐น ๐
I use it in grafana dashboard!
Thanx a lot!
Hello,
first of all. Nice software, keep up the good work!
consider prevent a crash by adding:
if (barman_server.status['first_backup'] and barman_server.status['first_backup'] != "None"):
... to collect_first_backup and collect_last_backup
/best regards
Hi,
this tool is very usefull, will be intresting to have a metric to collect Server WAL archiving rate from command barman status
Thanks
I appreciate that this might be related to barman not listing backups etc. for inactive servers but I had a server that had 5 backups, it correctly shows this in the barman exporter.
I have now deleted the backups and made that server inactive but barman exporter still shows a count of 5.
It seems like either it should not show the metric at all for inactive servers or it should be the correct number (which barman might not tell you!)
Thanks
hi Team,
I getting error when run #barman-exporter -f ./test.prom -u postgres
root@postgres:~# barman-exporter -f ./test.prom -u postgres
Traceback (most recent call last):
File "/usr/local/bin/barman-exporter", line 9, in <module>
load_entry_point('barman-exporter==1.0.7', 'console_scripts', 'barman-exporter')()
File "/usr/local/lib/python3.5/dist-packages/barman_exporter/barman_exporter.py", line 220, in main
write_metrics_to_file(args)
File "/usr/local/lib/python3.5/dist-packages/barman_exporter/barman_exporter.py", line 258, in write_metrics_to_file
registry = BarmanCollector(Barman(), args.servers)
File "/usr/local/lib/python3.5/dist-packages/barman_exporter/barman_exporter.py", line 22, in __init__
self.check_barman_version()
File "/usr/local/lib/python3.5/dist-packages/barman_exporter/barman_exporter.py", line 25, in check_barman_version
barman_version = tuple(int(v) for v in self.version().split('.'))
File "/usr/local/lib/python3.5/dist-packages/barman_exporter/barman_exporter.py", line 37, in version
return version[0]
IndexError: list index out of range
root@postgres:~# barman -v
2.3
please help me, how to fix the issue
Thanks in advance
Hello, I get this error if there is a server in the list with no backups yet
ValueError: time data 'None' does not match format '%Y%m%dT%H%M%S'
The program exits after that error, so the remaining servers are not considered, and also a temp file is left
As a workaround I currently do like this:
for s in $(barman list-server); do /usr/local/bin/barman-exporter -f /tmp/barman-$s.prom -u node-exp -g node-exp $s && mv -f /tmp/barman-$s.prom /var/lib/node_exporter; done 2>&1 | systemd-cat -t barman-exporter
/Steffen
After a long time running, barman_metrics_update keeps to be the old value.
56 1 root S 23432 1% 1 0% python3 /barman_exporter.py -l 0.0.0.0:9780 -c 15
19844 56 root S 23440 1% 0 0% python3 /barman_exporter.py -l 0.0.0.0:9780 -c 15
If I use -c 3600
it will work as normal. So I guess it's because in the case of a short cache_time, barman_exporter.py spawns another subprocess and confuses the prometheus scraper.
Hi. Link for the role leads to
https://github.com/ahes/prometheus-barman-exporter/blob/master/ansible-barman-exporter but not on https://github.com/ahes/ansible-barman-exporter
Installation of the barman-exporter
package via pip3
resolves the prometheus-client
dependency and install version 0.15.0, which causes the following failure when you run / start the service:
$ /usr/local/bin/barman-exporter
Traceback (most recent call last):
File "/usr/local/bin/barman-exporter", line 7, in <module>
from barman_exporter.barman_exporter import main
File "/usr/local/lib/python3.5/dist-packages/barman_exporter/barman_exporter.py", line 8, in <module>
import prometheus_client
File "/usr/local/lib/python3.5/dist-packages/prometheus_client/__init__.py", line 3, in <module>
from . import (
File "/usr/local/lib/python3.5/dist-packages/prometheus_client/exposition.py", line 194
timestamp = f' {int(float(line.timestamp) * 1000):d}'
I had to downgrade to prometheus-client
0.9.0 to clear.
Hello,
the barman-exporter service has crashed and is not starting. We installed pgbouncer on the server and changed the default port for postgresql and reconfigured barman.
barman check backup and backups show OK, But the exporter does not start.
The error is this:
Traceback (most recent call last):
File "/opt/prometheus/exporters/barman_exporter/barman_exporter", line 175, in <module>
core.REGISTRY.register(BarmanCollector(args.servers))
File "/usr/local/lib/python3.6/site-packages/prometheus_client/registry.py", line 24, in register
names = self._get_names(collector)
File "/usr/local/lib/python3.6/site-packages/prometheus_client/registry.py", line 64, in _get_names
for metric in desc_func():
File "/opt/prometheus/exporters/barman_exporter/barman_exporter", line 127, in collect
backups_done, backups_failed = barman.list_backup(server_name)
File "/opt/prometheus/exporters/barman_exporter/barman_exporter", line 43, in list_backup
backup['wal_size'] = wal_size.split(":")[1].strip()
IndexError: list index out of range
I get error
ModuleNotFoundError: No module named 'barman_exporter.barman_exporter'; 'barman_exporter' is not a package
Once I modify the bin
wrapper from:
from barman_exporter.barman_exporter import main
to
from barman_exporter import main
it works
I assume the issue is from
prometheus-barman-exporter/setup.py
Line 14 in c7a4889
I'm using the Python module based exporter with Barman 2.9 and Python 3.6 on SmartOS (Solaris derivative) and the values of the metrics don't get updated. The values of the metrics are set a single time when the script is started and then they stay the same forever.
This could be due to the fact that I'm running my setup on a somewhat more exotic setup (SmartOS) but I don't really see how this could have such an effect. I did a quick search in barman's source to see if it uses some platform specific things like inotify but I can't find anything of the sort.
I suspect this might be more likely caused by barman 2.9 which was released a couple of weeks ago. Can anyone confirm if they have a working setup with barman 2.9?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.