mxk1235 / tap-prometheus

Singer.io Prometheus tap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tap-prometheus

This is a Singer tap that produces JSON-formatted data following the Singer spec.

Module loads PromQL query result for every period specified, calculates an aggregation locally and pushes the result as a record.

Sample config to calculate daily online peak:

{
  "endpoint": "http://localhost:9000",
  "start_date": "2018-11-01T00:00:00Z",
  "metrics": [
    {
        "name": "online_peak",
        "query": "sum(sessions_count)",
        "aggregations": ["max"],
        "period": "day",
        "step": 120
    }
  ]
}
  • step: metrics resolution, see

Only day long periods and only "max", "min", "avg" aggregations are supported now.

Several source code parts copied from:

Module based on the patched python Prometheus API client promalyze: https://github.com/JustEdro/promalyze Load it and install directly (python setup.py install) first.

About

Singer.io Prometheus tap

License:GNU Affero General Public License v3.0


Languages

Language:Python 100.0%