From 8b906524ce2daf4584f5a0992a1c347840fc0631 Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar Date: Wed, 3 Sep 2025 15:53:53 -0700 Subject: [PATCH] Add docs for the promql-normalise-le-quantile-labels experimental feature Signed-off-by: Ganesh Vernekar --- cmd/prometheus/main.go | 2 +- docs/command-line/prometheus.md | 2 +- docs/feature_flags.md | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 28d4c466cb..d28cf8743b 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -564,7 +564,7 @@ func main() { a.Flag("scrape.discovery-reload-interval", "Interval used by scrape manager to throttle target groups updates."). Hidden().Default("5s").SetValue(&cfg.scrape.DiscoveryReloadInterval) - a.Flag("enable-feature", "Comma separated feature names to enable. Valid options: exemplar-storage, expand-external-labels, memory-snapshot-on-shutdown, promql-per-step-stats, promql-experimental-functions, extra-scrape-metrics, auto-gomaxprocs, native-histograms, created-timestamp-zero-ingestion, concurrent-rule-eval, delayed-compaction, old-ui, otlp-deltatocumulative, promql-duration-expr, use-uncached-io. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for more details."). + a.Flag("enable-feature", "Comma separated feature names to enable. Valid options: exemplar-storage, expand-external-labels, memory-snapshot-on-shutdown, promql-per-step-stats, promql-experimental-functions, extra-scrape-metrics, auto-gomaxprocs, native-histograms, created-timestamp-zero-ingestion, concurrent-rule-eval, delayed-compaction, old-ui, otlp-deltatocumulative, promql-duration-expr, use-uncached-io, promql-normalise-le-quantile-labels. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for more details."). Default("").StringsVar(&cfg.featureList) a.Flag("agent", "Run Prometheus in 'Agent mode'.").BoolVar(&agentMode) diff --git a/docs/command-line/prometheus.md b/docs/command-line/prometheus.md index e90a7574ba..ab5bb9cc13 100644 --- a/docs/command-line/prometheus.md +++ b/docs/command-line/prometheus.md @@ -58,7 +58,7 @@ The Prometheus monitoring server | --query.timeout | Maximum time a query may take before being aborted. Use with server mode only. | `2m` | | --query.max-concurrency | Maximum number of queries executed concurrently. Use with server mode only. | `20` | | --query.max-samples | Maximum number of samples a single query can load into memory. Note that queries will fail if they try to load more samples than this into memory, so this also limits the number of samples a query can return. Use with server mode only. | `50000000` | -| --enable-feature ... | Comma separated feature names to enable. Valid options: exemplar-storage, expand-external-labels, memory-snapshot-on-shutdown, promql-per-step-stats, promql-experimental-functions, extra-scrape-metrics, auto-gomaxprocs, native-histograms, created-timestamp-zero-ingestion, concurrent-rule-eval, delayed-compaction, old-ui, otlp-deltatocumulative, promql-duration-expr, use-uncached-io. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for more details. | | +| --enable-feature ... | Comma separated feature names to enable. Valid options: exemplar-storage, expand-external-labels, memory-snapshot-on-shutdown, promql-per-step-stats, promql-experimental-functions, extra-scrape-metrics, auto-gomaxprocs, native-histograms, created-timestamp-zero-ingestion, concurrent-rule-eval, delayed-compaction, old-ui, otlp-deltatocumulative, promql-duration-expr, use-uncached-io, promql-normalise-le-quantile-labels. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for more details. | | | --agent | Run Prometheus in 'Agent mode'. | | | --log.level | Only log messages with the given severity or above. One of: [debug, info, warn, error] | `info` | | --log.format | Output format of log messages. One of: [logfmt, json] | `logfmt` | diff --git a/docs/feature_flags.md b/docs/feature_flags.md index 4c390ab92e..3d09e4a47c 100644 --- a/docs/feature_flags.md +++ b/docs/feature_flags.md @@ -302,3 +302,14 @@ memory in response to misleading cache growth. This is currently implemented using direct I/O. For more details, see the [proposal](https://github.com/prometheus/proposals/pull/45). + +## Normalise `le` and `quantile` labels in PromQL parser + +`--enable-feature=promql-normalise-le-quantile-labels` + +When enabled, all the PromQL queries will convert the matchers of the form `le="2"` and `quantile="2"` +to `le=~"2|2.0"` and `quantile=~"2|2.0"`, for both ad-hoc queries and recording rules. +This feature is intended to help in the migration from Prometheus v2.X to a v3.X. +From v3.0.0 onwards, `le` and `quantile` labels are normalised by default during scrape time for histograms and summaries. + +It is highly recommended to only use this as a means for migration and not a feature that you keep enabled always. \ No newline at end of file