agent icon indicating copy to clipboard operation
agent copied to clipboard

Work with Prometheus to stop globally registering metrics

Open rfratto opened this issue 3 years ago • 3 comments

While building out dashboards for Grafana Agent Flow, we noticed that a few sets of metrics are globally registered to prometheus.DefaultRegistry:

  • prometheus_target_* metrics
  • prometheus_sd_* metrics

Globally registering them is fine for Prometheus where there's only one scrape manager or SD manager, but it's an issue for Flow where there may be multiple at runtime with different IDs.

We should work with upstream to stop globally registering these metrics so we have tighter control over them.

rfratto avatar Oct 21 '22 15:10 rfratto

I raised an issue on the Prometheus repo regarding this.

ptodev avatar Jul 12 '23 09:07 ptodev

I opened a draft PR for this as well.

ptodev avatar Jul 14 '23 15:07 ptodev

I updated Prometheus' main branch with all the changes which I believe are necessary. I'm currently waiting for Prometheus 2.50 to be released, so that I can update the Agent with it.

ptodev avatar Feb 12 '24 18:02 ptodev

2.50 has been released, so I'm going to close this specific issue in favor of updating our Prometheus dependency.

rfratto avatar Feb 27 '24 17:02 rfratto