prometheus/documentation/examples
Will Bollock b70a871988
fix(discovery): delete expired refresh metrics on reload (#17614)
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>
2026-04-02 13:43:35 +01:00
..
custom-sd fix(discovery): delete expired refresh metrics on reload (#17614) 2026-04-02 13:43:35 +01:00
kubernetes-rabbitmq fixes yamllint errors 2021-06-12 12:47:47 +02:00
remote_storage chore: Go dependencies update before 3.11 2026-03-26 10:56:14 +01:00
Makefile Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
prometheus-agent.yml config: Make remote-write required for Agent mode (#9618) 2021-10-30 01:41:40 +02:00
prometheus-digitalocean.yml fixes yamllint errors 2021-06-12 12:47:47 +02:00
prometheus-docker.yml fixes yamllint errors 2021-06-12 12:47:47 +02:00
prometheus-dockerswarm.yml fixes yamllint errors 2021-06-12 12:47:47 +02:00
prometheus-eureka.yml Add Eureka Service Discovery (#3369) 2020-08-26 17:36:59 +02:00
prometheus-hetzner.yml Check syntax of example configurations (#10753) 2022-05-26 18:17:21 +10:00
prometheus-ionos.yml Add service discovery for IONOS Cloud (#10514) 2022-05-20 14:57:23 +02:00
prometheus-kubernetes.yml scraping: limit detail on dropped targets, to save memory (#12647) 2023-08-14 15:39:25 +01:00
prometheus-linode.yml Linode IPv6 Range support, Optional region filtering, Missing fields in Documentation fixed (#13774) 2024-04-05 09:31:59 +01:00
prometheus-marathon.yml fixes yamllint errors 2021-06-12 12:47:47 +02:00
prometheus-nomad.yml feat(nomad): add nomad service discovery 2022-06-30 14:17:08 +02:00
prometheus-otlp.yml Clarify the NoUTF8EscapingWithSuffixes and UnderscoreEscapingWithSuffixes modes (#15567) 2024-12-17 08:40:53 +01:00
prometheus-outscale.yml feat(discovery): add Outscale VM service discovery (#18139) 2026-03-31 18:03:51 +02:00
prometheus-ovhcloud.yml chore: Fix typos (#14868) 2024-09-10 22:32:03 +02:00
prometheus-puppetdb.yml docs: Improve PuppetDB example (#9547) 2021-10-20 21:03:17 +02:00
prometheus-scaleway.yml add support for scaleway service discovery (#8555) 2021-03-10 15:10:17 +01:00
prometheus-stackit.yml feat: Document how to authenticate STACKIT Service Accounts using RFC7523 (#17645) 2025-12-16 22:50:51 +01:00
prometheus-uyuni.yml Add Uyuni service discovery (#8190) 2021-10-19 01:00:44 +02:00
prometheus-vultr.yml Check syntax of example configurations (#10753) 2022-05-26 18:17:21 +10:00
prometheus.yml Example config: Add labels to static_configs (#13327) 2025-02-19 15:24:30 +00:00
promtool-http-config-file.yml docs: Added documentation for promtool configuration with http.config.file (#16522) 2025-07-07 00:00:51 +02:00
rbac-setup.yml update ServiceAccount for new kubernetes versions 2023-01-05 15:43:48 +00:00
web-config.yml Fix a broken link for the bcrypt ref. at the web-config.yml example 2021-04-20 22:43:37 +02:00