Go to file
2022-08-19 23:06:05 +02:00
config.yaml Initial commit 2022-08-19 23:06:05 +02:00
prometheus2influxdb.py Initial commit 2022-08-19 23:06:05 +02:00
README.md Initial commit 2022-08-19 23:06:05 +02:00

Prometheus to InfluxDB Pushgateway

Configuration

---
influxdb:
  url: http://influx.example.org:8086
  user: changeme
  pass: changeme
prometheus:
  url: http://prometheus.example.org:9090
queries:

  - prom_query: 'max(irate(node_network_receive_bytes_total{job="node",device="em2"}[5m]) * 8) without (instance)'
    influx_db: sensors
    influx_labels:
      location: Uplink
      name: Downstream
    influx_retention: rp_week
    influx_series: network_traffic

  - prom_query: 'max(irate(node_network_transmit_bytes_total{job="node",device="em2"}[5m]) * 8) without (instance)'
    influx_db: sensors
    influx_labels:
      location: Uplink
      name: Upstream
    influx_retention: rp_week
    influx_series: network_traffic

Run

Put e.g. the following into a cronjob like this:

* * * * *  nobody  /usr/bin/python3 prometheus2influxdb.py /path/to/config.yaml