Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scrape all metrics from a federate endpoint?

Tags:

prometheus

We have a hierachical prometheus setup with some server scraping others. We'd like to have some servers scrape all metrics from others.

Currently we try to use match[]="{__name__=~".*"}" as a metric selector, but this gives the error parse error at char 16: vector selector must contain at least one non-empty matcher.

Is there a way to scrape all metrics from a remote prometheus without listing each (prefix) as a match selector?

like image 643
tex Avatar asked Aug 31 '16 11:08

tex


People also ask

Can Prometheus server scrape other Prometheus servers?

Prometheus federation is a Prometheus server that can scrape data from other Prometheus servers. It supports hierarchical federation, which in our case resembles a tree.

What does Scraping mean in Prometheus?

In Prometheus terms, an endpoint you can scrape is called an instance, usually corresponding to a single process. A collection of instances with the same purpose, a process replicated for scalability or reliability for example, is called a job.


1 Answers

Yes, you can do: match[]="{__name__=~".+"}" (note the + instead of * to not match the empty string).

Prometheus requires at least one matcher in a label matcher set that doesn't match everything.

like image 162
Julius Avatar answered Sep 17 '22 22:09

Julius