mirror of
https://github.com/prometheus/prometheus.git
synced 2026-04-07 18:25:13 -04:00
Building off config-specific Prometheus refresh metrics from an earlier PR (https://github.com/prometheus/prometheus/pull/17138), this deletes refresh metrics like `prometheus_sd_refresh_duration_seconds` and `prometheus_sd_refresh_failures_total` when the underlying scrape job configuration is removed on reload. This reduces un-needed cardinality from scrape job specific metrics while still preserving metrics that indicate overall health of a service discovery engine. For example, `prometheus_sd_refresh_failures_total{config="linode-servers",mechanism="linode"} 1` will no longer be exported by Prometheus when the `linode-servers` scrape job for the Linode service provider is removed. The generic, service discovery specific `prometheus_sd_linode_failures_total` metric will persist however. * fix: add targetsMtx lock for targets access * test: validate refresh/discover metrics are gone * ref: combine sdMetrics and refreshMetrics Good idea from @bboreham to combine sdMetrics and refreshMetrics! They're always passed around together and don't have much of a reason not to be combined. mechanismMetrics makes it clear what kind of metrics this is used for (service discovery mechanisms). --------- Signed-off-by: Will Bollock <wbollock@linode.com> |
||
|---|---|---|
| .. | ||
| alert.go | ||
| alertmanager.go | ||
| alertmanager_test.go | ||
| alertmanagerset.go | ||
| manager.go | ||
| manager_test.go | ||
| metric.go | ||
| sendloop.go | ||
| sendloop_test.go | ||
| util.go | ||
| util_test.go | ||