Git Product home page Git Product logo

prometheus-barman-exporter's People

Contributors

albix avatar eriknayan avatar marcinhlybin avatar thomaspoty avatar valumar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

prometheus-barman-exporter's Issues

Increment package version

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.

update readme to show usage with barman json output

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

Error : too many values to unpack

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

prevent crash when no-backup is yet available on server

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

barman_backups_total not updated for inactive server

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

barman cannot start | return version[0] IndexError: list index out of range

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

Error when no backups for a server

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

There are two processes after long time running and barman_metrics_update is stuck

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.

barman-exporter not compatible with prometheus-client 0.15.0

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.

barman-exporter service dont start

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

Error running the exporter when installed from pip

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

'console_scripts': ['barman-exporter=barman_exporter.barman_exporter:main'],

Python module based exporter does not update metric values

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.