Initial exporter scaffolding

This commit is contained in:
Timothée Floure 2020-11-15 19:19:36 +01:00
parent 5f73d4f59f
commit 92eeb06ebb

19
prometheus-borgbackup-exporter Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env python
from prometheus_client import start_http_server, Gauge
from time import sleep
HTTP_PORT = 9401
if __name__ == '__main__':
# Serve metrics over HTTP.
print("Starting prometheus-orgbackup-exporter on port",
"{}...".format(HTTP_PORT), end='')
start_http_server(HTTP_PORT)
print(" OK.")
while True:
# TODO: for every repository in $, use borg's JSON interface and export
# its content - or user the python bindings if they're stable enough.
print("Not implemented yet.")
sleep(1)