Sign inSign up

logicer16/duplicati-prometheus-exporter

By logicer16

Updated over 1 year ago

A simple prometheus exporter for Duplicati backup

Image
Databases & storage
Monitoring & observability
Web analytics
0

4.3K

logicer16/duplicati-prometheus-exporter repository overview

Duplicati prometheus exporter

This is an simple exporter made for Duplicati backup.

How it works

On your Duplicati backup interface or cli, you can configure in advanced options parameters for "send-http", with this configuration, Duplicati will send an post request to this exporter; so then exporter will gather metrics receved and expose a /metrics for prometheus.

# Cli configuration example
--send-http-url=http://<duplicati-exporter-instance>:5000/
--send-http-result-output-format=Json
--send-http-any-operation=true

Setup demo

For this demo is needed to be installed docker in your machine. The demo sets up the duplicati exporter, prometheus and grafana. There is also a configuration container that configures grafana's datasource and dashboard, and then send an example post to the duplicati exporter. You can see the configuration in the docker compose file.

  • In repository root, run:
docker compose up --force-recreate --build --always-recreate-deps

Grafana dashboard example

~This dashboard can change while i'm developing and improving. It's current vesion can be found here.

Prometheus scrap config example

global:
  scrape_interval: 60s
  evaluation_interval: 30s
scrape_configs:
- job_name: duplicati_backup
  honor_labels: true
  static_configs:
  - targets: ['duplicati-prometheus-exporter:5000'] # you can change to set your exporter instance

Run duplicati prometheus exporter using docker

Docker is the better way to execute this application. If you prefer, you can build your own container image based on my Dockerfile to change anythong you want and store your container artifact where you need; but you also can use my docker image that is on my dockerhub

  • Running docker image
docker run -p 5000:5000 logicer16/duplicati-prometheus-exporter

Running with python

For this you have to install python3.9 or higher. You can change service port by setting a environment variable DUPLICATI_EXPORTER_PORT=PORT, default is 5000.

# In repository root, create an python venv
python -m venv .venv

# Then activate this venv
# Linux
$ source .venv/bin/activate 
# Window
> C:\ .venv\Scripts\activate.bat

# Install python packages required
$ pip install -r requirements.txt

# Finally
$ python duplicat-prometheus-exporter

DEBUG

Debug can be done by using LOG_LEVEL environment variable, supported values: DEBUG, INFO, WARNING, ERROR, CRITICAL.

PULL REQUESTS

Hello everyone, i'm developing from scratch and I have no much experience with prometheus library, feel free to send any issues or open any pull requests to improve the source code. Any help is welcome (:

Tag summary

Content type

Image

Digest

sha256:585e76908

Size

50.5 MB

Last updated

over 1 year ago

docker pull logicer16/duplicati-prometheus-exporter