Setting federation between Prometheus instances is quite simple. See in following links:

  1. Federation in Prometheus documentation
  2. Settings on slaves

Only small gotcha is when you try plain “/federate” link on your slave Prometheus you will get empty page. This is OK. You just have to use “match” condition like this:

http://localhost:9090/federate?match[]={__name__=~"[a-z].*"}

This version will show you all available metrics + you should see also external labels you added according to link 2. (Note: link contains placeholder “__name__” – underscores may not be visible in code highlighter.)

If you need to add more conditions it looks like this:

http://localhost:9090/federate?match[]={__name__=~"node.*"}&match[]={__name__=~"mysql.*"}

Point 2 shows how to configure external labels