Add PrometheusSpec support for global extra_scrape_metrics
Author: wbollockCreated Sep 10, 2026Updated Sep 11, 2026
Labelskind/feature
Component(s)
Prometheus
What is missing? Please describe.
Prometheus now supports extra_scrape_metrics in the global configuration (PR 17606 and warns against setting it via feature flag as of v3.10.0:
This option for --enable-feature is being phased out. It currently changes the default for the extra_scrape_metrics config setting
to true, but will become a no-op in a future version. Stop using this option and set extra_scrape_metrics in the config instead.Prometheus warns when users enable it with this deprecated option:
--enable-feature=extra-scrape-metricsbut there is no way to set it globally with the Prometheus Operator easily. The Operator should have a way to set this field globally like some other global values such as global scrape_interval, scrape_timeout, scrape_protocols, etc.
Describe alternatives you've considered.
You can add extra_scrape_metrics to every individual scrape job but that is not elegant and toilsome. Other non-prometheus-operator instances can set it simply with:
config:
global:
extra_scrape_metrics: truein the config docs:
# When enabled, Prometheus stores additional time series for each scrape:
# scrape_timeout_seconds, scrape_sample_limit, and scrape_body_size_bytes.
# These metrics help monitor how close targets are to their configured limits.
# This option can be overridden per scrape config.
[ extra_scrape_metrics: [<boolean>](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#boolean) | default = false ]Environment Information.
Environment
Kubernetes Version: not relevant IMO
Prometheus-Operator Version: v0.91.0
Prometheus Version: v3.12.0
kube-prometheus-stack Version: 86.2.2Source: prometheus-operator/prometheus-operator