GithubHelp home page GithubHelp logo

signal-ai / tap-prometheus Goto Github PK

View Code? Open in Web Editor NEW
1.0 21.0 0.0 88 KB

A Singer Tap for ingesting data points from the Prometheus HTTP API

License: MIT License

Dockerfile 5.41% Makefile 7.67% Shell 7.12% Python 79.80%
prometheus singer singer-io singer-tap

tap-prometheus's Introduction

tap-prometheus

CircleCI

Singer tap that extracts data from Prometheus using queries provided in config and produces JSON-formatted data following the Singer spec.

Building and running locally

The project uses pyenv and poetry to manage its dependencies.

To install the tools required you can run make install-tools.

To install the dependencies, run make install-dependencies.

To start the project, run make start. This uses an example config in example_config.json.

Configuration and functionality

Configuration is as follows:

{
  "stream_name": "prometheus",
  "prometheus_endpoint": "http://prometheus-a.mydomain",
  "start_date": "2022-06-16T00:00:00Z",
  "queries": { "my_query_id": "my_promql_query" }
}

enable_ssl can optionally be set to false to explicitly disable TLS verification, else it will be inferred from the schema of the proemtheus_endpoint.

With this configuration, it will run instance queries from queries field (one request for each query) for the given start_date on the given prometheus endpoint.

The intended use case for this tap is getting started by Airflow on schedule and it's output being saved in a Data warehouse. This tap does not support state, or discovery: running it with -d option is a no-op, this also means that catalog is not ignored.

The tap outputs records with the following fields:

  • id: hash of every field except value for deduplication, primary key,
  • query_id: taken from the input config,
  • labels_hash: hash of the values of all label__{label_name} fields,
  • value: metric value,
  • timestamp: timestamp of the metric
  • label__{label_name}: each metric label and it's value is outputted like this (flattened)

Every query can output many records with different labels. Schema is computed automatically with all the labels in the result set (one schema per run).

tap-prometheus's People

Contributors

elukyanchuk avatar limess avatar signalgav avatar

Stargazers

 avatar

Watchers

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

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.