Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

keymantics/prom-aggregation-gateway

 
 

Repository files navigation

Prometheus Aggregation Gateway

Prometheus Aggregation Gateway is a aggregating push gateway for Prometheus. As opposed to the official Prometheus Pushgateway, this service aggregates the sample values it receives.

  • Counters where all labels match are added up.
  • Histograms are added up; if bucket boundaries are mismatched then the result has the union of all buckets and counts are given to the lowest bucket that fits.
  • Gauges are also added up (but this may not make any sense)
  • Summaries are discarded.

How to use

Send metrics in Prometheus format to /api/ui/metrics

E.g. if you have the program running locally:

echo 'http_requests_total{method="post",code="200"} 1027' | curl --data-binary @- http://localhost/api/ui/metrics

Then have your Prometheus scrape metrics from the same address at /metrics.

Ready-built images

Available on DockerHub weaveworks/prom-aggregation-gateway

Motivation

According to https://prometheus.io/docs/practices/pushing/:

The Pushgateway never forgets series pushed to it and will expose them to Prometheus forever...

The latter point is especially relevant when multiple instances of a job differentiate their metrics in the Pushgateway via an instance label or similar.

This restriction makes the Prometheus pushgateway inappropriate for the usecase of accepting metrics from a client-side web app, so we created this one to aggregate counters from multiple senders.

JS Client Library

See https://github.com/weaveworks/promjs/ for a JS client library for Prometheus that can be used from within a web app.

Getting Help

If you have any questions about, feedback for or problems with prom-aggregation-gateway:

Your feedback is always welcome!

About

An aggregating push gateway for Prometheus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 43.4%
  • Python 19.1%
  • Go 17.4%
  • HCL 13.7%
  • Makefile 4.2%
  • Dockerfile 2.2%