How to scrape all metrics from a federate endpoint?

Federation is not intended to transfer all metrics, and if you try to do so you'll eventually run into problems.

Instead, aggregate up the metrics you want and then federate only those.


I have tried multiple example, even the ones from prometheus docs but nothing worked.

Instead this works for me

http://prometheus-ip:9090/federate?match[]={job!=""}

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.

Tags:

Prometheus