4

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?

1
  • 1
    The purpose of prometheus is to collect metrics from many places and perform the aggregation itself. The right solution would be to resolve resolve why "our prometheus installation requires ... from only one endpoint". This is a very odd way of using prometheus.
    – Marc
    Commented Jan 31, 2018 at 13:13

1 Answer 1

1

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 ...

1
  • 1
    This seems like the most trivial problem to any modern API. Every API (almost every) needs to scale horizontally. You would assume that a load balancer sits in front to route requests to horizontally scaled instances of an API. Should the Prometheus endpoint bypass the load balancer and go directly to the API to gather metrics?
    – Jeremy
    Commented Jun 2, 2020 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.