Andy
Andy

Reputation: 10091

How to aggregate prometheus metrics

Various of my docker containers export prometheus metrics, however our prometheus installation requires to extract all metrics only from only one endpoint. Unfortunately, this cannot be changed. Thus, I need to aggregate all metrics at one point from with the prometheus installation can scrape the metrics.

Moreover, it would be great if this program or script could provide additional logic on how to deal with the same metrics which are exported by different endpoints. For example, if I just concat the various metric sites together Prometheus has a problem with interpreting identical HELP Texts for the metrics.

Do you know of a way, script or a docker image which can be used to aggregate Prometheus metrics?

Upvotes: 4

Views: 7697

Answers (1)

tex
tex

Reputation: 2141

Prometheus can do that. You just need to setup a Prometheus instance that can reach all endpoints and then you can use federation to scrape these metrics from the other Prometheus. Sorry if this sounds paradox, but this is actually the proper way to do it.

You can configure your intermediate Prometheus instance with little to no retention and use it as a proxy. This is certainly not the best way to use Prometheus, but if this is a hard requirement ...

Upvotes: 1

Related Questions