Skip to content

PromQL: Add experimental histogram_quantiles variadic function#17285

Merged
beorn7 merged 10 commits into
prometheus:mainfrom
linasm:histogram-quantiles
Feb 18, 2026
Merged

PromQL: Add experimental histogram_quantiles variadic function#17285
beorn7 merged 10 commits into
prometheus:mainfrom
linasm:histogram-quantiles

Conversation

@linasm

@linasm linasm commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

Which issue(s) does the PR fix:

Implementation for #16464.

Note: the syntax of this function diverges from histogram_quantiles in Victoria Metrics. Matching that syntax would require variadic argument followed by a singular argument (vector selector), which I don't think is possible in PromQL syntax.

Open question: should this function be experimental or not? Marked as experimental.

TODOs:

  • Documentation.
  • Frontend support (autocomplete, autocorrection).

Does this PR introduce a user-facing change?

[FEATURE] PromQL: Add experimental histogram_quantiles variadic function for computing multiple quantiles at once.

@vpranckaitis vpranckaitis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a few small comments

Comment thread promql/functions.go Outdated
Comment thread promql/functions.go Outdated
Comment thread promql/promqltest/testdata/histograms.test
@linasm
linasm force-pushed the histogram-quantiles branch from a7fe7c4 to b4cb5e0 Compare October 6, 2025 17:16
@linasm
linasm requested a review from vpranckaitis October 6, 2025 17:17
@linasm
linasm force-pushed the histogram-quantiles branch 2 times, most recently from eb0bb29 to b299378 Compare October 7, 2025 05:40
@linasm
linasm force-pushed the histogram-quantiles branch 3 times, most recently from 710b436 to dd4783e Compare October 7, 2025 13:23
@linasm linasm changed the title PromQL: Add histogram_quantiles variadic function PromQL: Add experimental histogram_quantiles variadic function Oct 7, 2025
@beorn7
beorn7 self-requested a review October 19, 2025 14:46
@beorn7

beorn7 commented Oct 19, 2025

Copy link
Copy Markdown
Contributor

I add myself as a reviewer, but my backlog is huge. So this should not discourage other reviewers from reviewing this before/instead of me.

@github-actions github-actions Bot added the stale label Dec 22, 2025
@beorn7

beorn7 commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

My apologies for the long delay. This has now bubbled up to the top of my review queue and I'm working on it.

(And too bad that no other reviewer showed up… 😬 )

@beorn7

beorn7 commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Note: I added a frontend TODO to the PR description.

@github-actions github-actions Bot removed the stale label Feb 7, 2026
@beorn7

beorn7 commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

With all the other excitement, I got distracted from further reviewing this. I hope I'll get to this tomorrow.

@beorn7 beorn7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely. Only one comment about the formatting of the quantile label.

And of course, we need documentation and the frontend support, as listed above.

@linasm are you up for adding both of those? The frontend part might appear a bit daunting for a backend coder, but you can easily follow the steps taken for other functions.

Comment thread promql/functions.go Outdated
@linasm

linasm commented Feb 14, 2026

Copy link
Copy Markdown
Contributor Author

@linasm are you up for adding both of those? The frontend part might appear a bit daunting for a backend coder, but you can easily follow the steps taken for other functions.

Yeah, I should be able to take care of that stuff. The only reason I've been less responsive on this PR was my recent focus on the histogram trimming PR.

@beorn7

beorn7 commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Not to mention that this PR was left in review limbo… 🦆

Signed-off-by: Linas Medziunas <[email protected]>
Signed-off-by: Linas Medziunas <[email protected]>
Signed-off-by: Linas Medziunas <[email protected]>
@linasm
linasm force-pushed the histogram-quantiles branch from dd4783e to afa963d Compare February 17, 2026 14:41
@linasm
linasm requested review from a team and juliusv as code owners February 17, 2026 14:41
@linasm
linasm requested a review from Nexucis as a code owner February 17, 2026 14:41
@linasm

linasm commented Feb 17, 2026

Copy link
Copy Markdown
Contributor Author

Lovely. Only one comment about the formatting of the quantile label.

Done.

And of course, we need documentation and the frontend support, as listed above.

Done.

@beorn7 the PR is ready for review.

@linasm
linasm requested a review from beorn7 February 17, 2026 14:50
Signed-off-by: Linas Medziunas <[email protected]>

@beorn7 beorn7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Just one English nit (I guess I can just submit this directly).

Comment thread docs/querying/functions.md Outdated
@beorn7

beorn7 commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Sorry for the flurry of commits. Things got a bit more complicated…

What I only wanted to do is to add the usual header for experimental functions in the documentation.

This should now be good to go. Will squash/merge on green.

@beorn7
beorn7 merged commit 5bd0d00 into prometheus:main Feb 18, 2026
32 checks passed
bwplotka added a commit that referenced this pull request Feb 23, 2026
* Isolate fix: Remove 5s sleep for 99% speedup. Discarded unwanted code.

Signed-off-by: 3Juhwan <[email protected]>
Signed-off-by: Sammy Tran <[email protected]>

* Add regex optimization for simple contains alternations

Signed-off-by: Casie Chen <[email protected]>

* enable experimental functions in promql benchmarks

Signed-off-by: Dan Cech <[email protected]>

* Fix a couple of broken links in configuration.md (#18045)

Signed-off-by: kakabisht <[email protected]>

* promql: info function: support multiple name matchers (#17968)

* Add new test cases for multiple name matchers in PromQL info function
* Fix handling of multiple name matchers in PromQL info function

---------

Signed-off-by: Jeanette Tan <[email protected]>

* tsdb: Optimize LabelValues for sparse intersections (Fixes #14551)

Signed-off-by: Divyansh Mishra <[email protected]>

* fix: handle ErrTooOldSample as 400 Bad Request in OTLP and v2 histogram write paths

The OTLP write handler and the PRW v2 histogram append path were missing
ErrTooOldSample from their error type checks, causing these errors to
fall through to the default case and return HTTP 500 Internal Server Error.
This triggered unnecessary retries in OTLP clients like the Python SDK.

The PRW v1 write handler (line 115) and the PRW v2 sample append path
(line 377) already correctly handle ErrTooOldSample as a 400, and this
change makes the remaining paths consistent.

Also adds ErrTooOldSample to the v1 sample/histogram log checks so
these errors are properly logged instead of silently returned.

Fixes #16645

Signed-off-by: Varun Chawla <[email protected]>

* fix: prevent stale exemplars leaking to histogram _sum/_count across data points (#18056)

In addHistogramDataPoints, exemplars assigned to the +Inf bucket of one
data point were carried over into the _sum and _count Append calls of
the next data point via the shared appOpts. Clear appOpts.Exemplars at
the start of each loop iteration to restore the nil-exemplar semantics
that existed before the AppenderV2 migration.

Signed-off-by: Arve Knudsen <[email protected]>

* tsdb: fix flaky TestBlockRanges by using explicit compaction

Replace polling loops (for range 100 { time.Sleep }) with explicit
db.Compact() calls after disabling background compaction, eliminating
CI flakiness on slow machines. Also fix incorrect overlap assertions
that were checking the wrong direction (LessOrEqual -> GreaterOrEqual).

Signed-off-by: Arve Knudsen <[email protected]>

* rules: fix flaky TestAsyncRuleEvaluation on Windows (#17965)

Convert all timing-sensitive subtests of TestAsyncRuleEvaluation to use
synctest for deterministic testing. This fixes flakiness on Windows
caused by timer granularity and scheduling variance.

The timing assertions are preserved using synctest's fake time, which
allows accurate verification of sequential vs concurrent execution
timing without relying on wall-clock time.

Fixes #17961

Signed-off-by: Arve Knudsen <[email protected]>

* Move krajorama to general maintainer (#18095)

He's been participating in the bug scrub for a year and provides
reviews all over the code base. Also fix name spelling.

Signed-off-by: György Krajcsovits <[email protected]>

* promtool: fix --enable-feature flags ignored in check config and test rules (#18097)

Both are regressions from the parser refactoring in #17977.

- Fixes #18092
- Fixes #18093

Signed-off-by: Martin Valiente Ainz <[email protected]>

* tsdb/wlog: Remove any temproary checkpoints when creating a Checkpoint (#17598)

* RemoveTmpDirs function to tsdbutil
* Refactor db to use RemoveTmpDirs and no longer cleanup checkpoint tmp dirs
* Use RemoveTmpDirs in wlog checkpoint to cleanup all checkpoint tmp folders
* Add tests for RemoveTmpDirs
* Ensure db.Open will still cleanup extra temporary checkpoints

Signed-off-by: Kyle Eckhart <[email protected]>

* chore(lint): enable wg.Go

Since our minimum supported go version is now go 1.25, we can use wg.Go.

Signed-off-by: Julien Pivotto <[email protected]>

* chore: enable staticcheck linter and update golangci-lint to 2.10.1

Signed-off-by: Matthieu MOREL <[email protected]>

* PromQL: Add experimental histogram_quantiles variadic function (#17285)

Signed-off-by: Linas Medziunas <[email protected]>
Signed-off-by: Björn Rabenstein <[email protected]>
Signed-off-by: beorn7 <[email protected]>
Co-authored-by: Björn Rabenstein <[email protected]>
Co-authored-by: beorn7 <[email protected]>

* Upgrade `mongo-driver` to v1.17.9 (#18077)

Signed-off-by: Sayuru <[email protected]>

* tests: add CI job for ompliance testing (#18121)

Signed-off-by: bwplotka <[email protected]>

* chore: Add consistent closing logging (#18119)

Signed-off-by: bwplotka <[email protected]>

* fix(deps): update github.com/hashicorp/nomad/api digest to daca79d (#18128)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update aws go dependencies (#18135)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix renovate PR body (#18154)

* chore(deps): update actions/stale action to v10.2.0 (#18144)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/setup-node action to v6.2.0 (#18143)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update github/codeql-action action to v4.32.4 (#18147)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update kubernetes go dependencies to v0.35.1 (#18136)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependabot/fetch-metadata action to v2.5.0 (#18145)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update module github.com/prometheus/alertmanager to v0.31.1 (#18142)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update module github.com/klauspost/compress to v1.18.4 (#18138)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update github.com/nsf/jsondiff digest to 8e8d90c (#18129)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update google.golang.org/genproto/googleapis/api digest to 42d3e9b (#18132)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fixup renovate PR note (#18156)

* fix(deps): update module golang.org/x/sys to v0.41.0 (#18163)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update module github.com/grpc-ecosystem/grpc-gateway/v2 to v2.28.0 (#18159)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update module github.com/envoyproxy/go-control-plane/envoy to v1.37.0 (#18158)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update module github.com/digitalocean/godo to v1.175.0 (#18157)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update module google.golang.org/api to v0.267.0 (#18165)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [FEATURE] AWS SD:  Add Elasticache Role (#18099)

* AWS SD: Elasticache

This change adds Elasticache to the AWS SD.

Co-authored-by: Ben Kochie <[email protected]>
Signed-off-by: Matt <[email protected]>

---------

Signed-off-by: Matt <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* fix(deps): update module golang.org/x/text to v0.34.0 (#18164)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update module github.com/envoyproxy/protoc-gen-validate to v1.3.3 (#18137)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix test after merge

Signed-off-by: bwplotka <[email protected]>

---------

Signed-off-by: 3Juhwan <[email protected]>
Signed-off-by: Sammy Tran <[email protected]>
Signed-off-by: Casie Chen <[email protected]>
Signed-off-by: Dan Cech <[email protected]>
Signed-off-by: kakabisht <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Divyansh Mishra <[email protected]>
Signed-off-by: Varun Chawla <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
Signed-off-by: Martin Valiente Ainz <[email protected]>
Signed-off-by: Kyle Eckhart <[email protected]>
Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Matthieu MOREL <[email protected]>
Signed-off-by: Linas Medziunas <[email protected]>
Signed-off-by: Björn Rabenstein <[email protected]>
Signed-off-by: beorn7 <[email protected]>
Signed-off-by: Sayuru <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: Matt <[email protected]>
Co-authored-by: 3Juhwan <[email protected]>
Co-authored-by: Casie Chen <[email protected]>
Co-authored-by: Dan Cech <[email protected]>
Co-authored-by: hridyesh bisht <[email protected]>
Co-authored-by: Julien <[email protected]>
Co-authored-by: zenador <[email protected]>
Co-authored-by: Divyansh Mishra <[email protected]>
Co-authored-by: Varun Chawla <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: George Krajcsovits <[email protected]>
Co-authored-by: Martin Valiente Ainz <[email protected]>
Co-authored-by: Bryan Boreham <[email protected]>
Co-authored-by: Kyle Eckhart <[email protected]>
Co-authored-by: Matthieu MOREL <[email protected]>
Co-authored-by: Linas Medžiūnas <[email protected]>
Co-authored-by: Björn Rabenstein <[email protected]>
Co-authored-by: beorn7 <[email protected]>
Co-authored-by: Sayuru <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ben Kochie <[email protected]>
Co-authored-by: Matt <[email protected]>
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Apr 8, 2026
##### [\`v3.11.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.11.0)

- \[CHANGE] Hetzner SD: The `__meta_hetzner_datacenter` label is deprecated for the role `robot` but kept for backward compatibility, use the `__meta_hetzner_robot_datacenter` label instead. For the role `hcloud`, the label is deprecated and will stop working after the 1 July 2026. [#17850](prometheus/prometheus#17850)
- \[CHANGE] Hetzner SD: The `__meta_hetzner_hcloud_datacenter_location` and `__meta_hetzner_hcloud_datacenter_location_network_zone` labels are deprecated, use the `__meta_hetzner_hcloud_location` and `__meta_hetzner_hcloud_location_network_zone` labels instead. [#17850](prometheus/prometheus#17850)
- \[CHANGE] Promtool: Redirect debug output to stderr to avoid interfering with stdout-based tool output. [#18346](prometheus/prometheus#18346)
- \[FEATURE] AWS SD: Add Elasticache Role. [#18099](prometheus/prometheus#18099)
- \[FEATURE] AWS SD: Add RDS Role. [#18206](prometheus/prometheus#18206)
- \[FEATURE] Azure SD: Add support for Azure Workload Identity authentication method. [#17207](prometheus/prometheus#17207)
- \[FEATURE] Discovery: Introduce `prometheus_sd_last_update_timestamp_seconds` metric to track the last time a service discovery update was sent to consumers. [#18194](prometheus/prometheus#18194)
- \[FEATURE] Kubernetes SD: Add support for node role selectors for pod roles. [#18006](prometheus/prometheus#18006)
- \[FEATURE] Kubernetes SD: Introduce pod-based labels for deployment, cronjob, and job controller names: `__meta_kubernetes_pod_deployment_name`, `__meta_kubernetes_pod_cronjob_name` and `__meta_kubernetes_pod_job_name`, respectively. [#17774](prometheus/prometheus#17774)
- \[FEATURE] PromQL: Add `</` and `>/` operators for trimming observations from native histograms. [#17904](prometheus/prometheus#17904)
- \[FEATURE] PromQL: Add experimental `histogram_quantiles` variadic function for computing multiple quantiles at once. [#17285](prometheus/prometheus#17285)
- \[FEATURE] TSDB: Add `storage.tsdb.retention.percentage` configuration to configure the maximum percent of disk usable for TSDB storage. [#18080](prometheus/prometheus#18080)
- \[FEATURE] TSDB: Add an experimental `fast-startup` feature flag that writes a `series_state.json` file to the WAL directory to track active series state across restarts. [#18303](prometheus/prometheus#18303)
- \[FEATURE] TSDB: Add an experimental `st-storage` feature flag. When enabled, Prometheus stores ingested start timestamps (ST, previously called Created Timestamp) from scrape or OTLP in the TSDB and Agent WAL, and exposes them via Remote Write 2. [#18062](prometheus/prometheus#18062)
- \[FEATURE] TSDB: Add an experimental `xor2-encoding` feature flag for the new TSDB block float sample chunk encoding that is optimized for scraped data and allows encoding start timestamps. [#18062](prometheus/prometheus#18062)
- \[ENHANCEMENT] HTTP client: Add AWS `external_id` support for sigv4. [#17916](prometheus/prometheus#17916)
- \[ENHANCEMENT] Kubernetes SD: Deduplicate deprecation warning logs from the Kubernetes API to reduce noise. [#17829](prometheus/prometheus#17829)
- \[ENHANCEMENT] TSDB: Remove old temporary checkpoints when creating a Checkpoint. [#17598](prometheus/prometheus#17598)
- \[ENHANCEMENT] UI: Add autocomplete support for experimental `first_over_time` and `ts_of_first_over_time` PromQL functions. [#18318](prometheus/prometheus#18318)
- \[ENHANCEMENT] Vultr SD: Upgrade govultr library from v2 to v3 for continued security patches and maintenance. [#18347](prometheus/prometheus#18347)
- \[PERF] PromQL: Improve performance and reduce heap allocations in joins (VectorBinop)/And/Or/Unless. [#17159](prometheus/prometheus#17159)
- \[PERF] PromQL: Partially address performance regression in native histogram aggregations due to using `KahanAdd`. [#18252](prometheus/prometheus#18252)
- \[PERF] Remote write: Optimize WAL watching used for RW sending to reuse internal buffers. [#18250](prometheus/prometheus#18250)
- \[PERF] TSDB: Optimize LabelValues intersection performance for matchers. [#18069](prometheus/prometheus#18069)
- \[PERF] UI: Skip restacking on hover in stacked series charts. [#18230](prometheus/prometheus#18230)
- \[BUGFIX] AWS SD: Fix EC2 SD ignoring the configured `endpoint` option, a regression from the AWS SDK v2 migration. [#18133](prometheus/prometheus#18133)
- \[BUGFIX] AWS SD: Fix panic in EC2 SD when DescribeAvailabilityZones returns nil ZoneName or ZoneId. [#18133](prometheus/prometheus#18133)
- \[BUGFIX] Agent: Fix memory leak caused by duplicate SeriesRefs being loaded as active series. [#17538](prometheus/prometheus#17538)
- \[BUGFIX] Alerting: Fix alert state incorrectly resetting to pending when the FOR period is increased in the config file. [#18244](prometheus/prometheus#18244)
- \[BUGFIX] Azure SD: Fix system-assigned managed identity not working when `client_id` is empty. [#18323](prometheus/prometheus#18323)
- \[BUGFIX] Consul SD: Fix filter parameter not being applied to health service endpoint, causing Node and Node.Meta filters to be ignored. [#17349](prometheus/prometheus#17349)
- \[BUGFIX] Kubernetes SD: Fix duplicate targets generated by `*DualStack` EndpointSlices policies. [#18192](prometheus/prometheus#18192)
- \[BUGFIX] OTLP: Fix ErrTooOldSample being returned as HTTP 500 instead of 400 in PRW v2 histogram write paths, preventing infinite client retry loops. [#18084](prometheus/prometheus#18084)
- \[BUGFIX] OTLP: Fix exemplars getting mixed between incorrect parts of a histogram. [#18056](prometheus/prometheus#18056)
- \[BUGFIX] PromQL: Do not skip histogram buckets in queries where histogram trimming is used. [#18263](prometheus/prometheus#18263)
- \[BUGFIX] Remote write: Fix `prometheus_remote_storage_sent_batch_duration_seconds` measuring before the request was sent. [#18214](prometheus/prometheus#18214)
- \[BUGFIX] Rules: Fix alert state restoration when rule labels contain Go template expressions. [#18375](prometheus/prometheus#18375)
- \[BUGFIX] Scrape: Fix panic when parsing bare label names without an equal sign in brace-only metric notation. [#18229](prometheus/prometheus#18229)
- \[BUGFIX] TSDB: Fail early when `use-uncached-io` feature flag is set on unsupported environments. [#18219](prometheus/prometheus#18219)
- \[BUGFIX] TSDB: Fall back to CLI flag values when retention is removed from config file. [#18200](prometheus/prometheus#18200)
- \[BUGFIX] TSDB: Fix memory leaks in buffer pools by clearing reference fields before returning buffers to pools. [#17895](prometheus/prometheus#17895)
- \[BUGFIX] TSDB: Fix missing mmap of histogram chunks during WAL replay. [#18306](prometheus/prometheus#18306)
- \[BUGFIX] TSDB: Fix storage.tsdb.retention.time unit mismatch in file causing retention to be 1e6 times longer than configured. [#18200](prometheus/prometheus#18200)
- \[BUGFIX] Tracing: Fix missing traceID in query log when tracing is enabled, previously only spanID was emitted. [#18189](prometheus/prometheus#18189)
- \[BUGFIX] UI: Fix tooltip Y-offset drift when using multiple graph panels. [#18228](prometheus/prometheus#18228)
- \[BUGFIX] UI: Update retention display in runtime info when config is reloaded. [#18200](prometheus/prometheus#18200)
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Apr 8, 2026
##### [\`v3.11.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.11.0)

- \[CHANGE] Hetzner SD: The `__meta_hetzner_datacenter` label is deprecated for the role `robot` but kept for backward compatibility, use the `__meta_hetzner_robot_datacenter` label instead. For the role `hcloud`, the label is deprecated and will stop working after the 1 July 2026. [#17850](prometheus/prometheus#17850)
- \[CHANGE] Hetzner SD: The `__meta_hetzner_hcloud_datacenter_location` and `__meta_hetzner_hcloud_datacenter_location_network_zone` labels are deprecated, use the `__meta_hetzner_hcloud_location` and `__meta_hetzner_hcloud_location_network_zone` labels instead. [#17850](prometheus/prometheus#17850)
- \[CHANGE] Promtool: Redirect debug output to stderr to avoid interfering with stdout-based tool output. [#18346](prometheus/prometheus#18346)
- \[FEATURE] AWS SD: Add Elasticache Role. [#18099](prometheus/prometheus#18099)
- \[FEATURE] AWS SD: Add RDS Role. [#18206](prometheus/prometheus#18206)
- \[FEATURE] Azure SD: Add support for Azure Workload Identity authentication method. [#17207](prometheus/prometheus#17207)
- \[FEATURE] Discovery: Introduce `prometheus_sd_last_update_timestamp_seconds` metric to track the last time a service discovery update was sent to consumers. [#18194](prometheus/prometheus#18194)
- \[FEATURE] Kubernetes SD: Add support for node role selectors for pod roles. [#18006](prometheus/prometheus#18006)
- \[FEATURE] Kubernetes SD: Introduce pod-based labels for deployment, cronjob, and job controller names: `__meta_kubernetes_pod_deployment_name`, `__meta_kubernetes_pod_cronjob_name` and `__meta_kubernetes_pod_job_name`, respectively. [#17774](prometheus/prometheus#17774)
- \[FEATURE] PromQL: Add `</` and `>/` operators for trimming observations from native histograms. [#17904](prometheus/prometheus#17904)
- \[FEATURE] PromQL: Add experimental `histogram_quantiles` variadic function for computing multiple quantiles at once. [#17285](prometheus/prometheus#17285)
- \[FEATURE] TSDB: Add `storage.tsdb.retention.percentage` configuration to configure the maximum percent of disk usable for TSDB storage. [#18080](prometheus/prometheus#18080)
- \[FEATURE] TSDB: Add an experimental `fast-startup` feature flag that writes a `series_state.json` file to the WAL directory to track active series state across restarts. [#18303](prometheus/prometheus#18303)
- \[FEATURE] TSDB: Add an experimental `st-storage` feature flag. When enabled, Prometheus stores ingested start timestamps (ST, previously called Created Timestamp) from scrape or OTLP in the TSDB and Agent WAL, and exposes them via Remote Write 2. [#18062](prometheus/prometheus#18062)
- \[FEATURE] TSDB: Add an experimental `xor2-encoding` feature flag for the new TSDB block float sample chunk encoding that is optimized for scraped data and allows encoding start timestamps. [#18062](prometheus/prometheus#18062)
- \[ENHANCEMENT] HTTP client: Add AWS `external_id` support for sigv4. [#17916](prometheus/prometheus#17916)
- \[ENHANCEMENT] Kubernetes SD: Deduplicate deprecation warning logs from the Kubernetes API to reduce noise. [#17829](prometheus/prometheus#17829)
- \[ENHANCEMENT] TSDB: Remove old temporary checkpoints when creating a Checkpoint. [#17598](prometheus/prometheus#17598)
- \[ENHANCEMENT] UI: Add autocomplete support for experimental `first_over_time` and `ts_of_first_over_time` PromQL functions. [#18318](prometheus/prometheus#18318)
- \[ENHANCEMENT] Vultr SD: Upgrade govultr library from v2 to v3 for continued security patches and maintenance. [#18347](prometheus/prometheus#18347)
- \[PERF] PromQL: Improve performance and reduce heap allocations in joins (VectorBinop)/And/Or/Unless. [#17159](prometheus/prometheus#17159)
- \[PERF] PromQL: Partially address performance regression in native histogram aggregations due to using `KahanAdd`. [#18252](prometheus/prometheus#18252)
- \[PERF] Remote write: Optimize WAL watching used for RW sending to reuse internal buffers. [#18250](prometheus/prometheus#18250)
- \[PERF] TSDB: Optimize LabelValues intersection performance for matchers. [#18069](prometheus/prometheus#18069)
- \[PERF] UI: Skip restacking on hover in stacked series charts. [#18230](prometheus/prometheus#18230)
- \[BUGFIX] AWS SD: Fix EC2 SD ignoring the configured `endpoint` option, a regression from the AWS SDK v2 migration. [#18133](prometheus/prometheus#18133)
- \[BUGFIX] AWS SD: Fix panic in EC2 SD when DescribeAvailabilityZones returns nil ZoneName or ZoneId. [#18133](prometheus/prometheus#18133)
- \[BUGFIX] Agent: Fix memory leak caused by duplicate SeriesRefs being loaded as active series. [#17538](prometheus/prometheus#17538)
- \[BUGFIX] Alerting: Fix alert state incorrectly resetting to pending when the FOR period is increased in the config file. [#18244](prometheus/prometheus#18244)
- \[BUGFIX] Azure SD: Fix system-assigned managed identity not working when `client_id` is empty. [#18323](prometheus/prometheus#18323)
- \[BUGFIX] Consul SD: Fix filter parameter not being applied to health service endpoint, causing Node and Node.Meta filters to be ignored. [#17349](prometheus/prometheus#17349)
- \[BUGFIX] Kubernetes SD: Fix duplicate targets generated by `*DualStack` EndpointSlices policies. [#18192](prometheus/prometheus#18192)
- \[BUGFIX] OTLP: Fix ErrTooOldSample being returned as HTTP 500 instead of 400 in PRW v2 histogram write paths, preventing infinite client retry loops. [#18084](prometheus/prometheus#18084)
- \[BUGFIX] OTLP: Fix exemplars getting mixed between incorrect parts of a histogram. [#18056](prometheus/prometheus#18056)
- \[BUGFIX] PromQL: Do not skip histogram buckets in queries where histogram trimming is used. [#18263](prometheus/prometheus#18263)
- \[BUGFIX] Remote write: Fix `prometheus_remote_storage_sent_batch_duration_seconds` measuring before the request was sent. [#18214](prometheus/prometheus#18214)
- \[BUGFIX] Rules: Fix alert state restoration when rule labels contain Go template expressions. [#18375](prometheus/prometheus#18375)
- \[BUGFIX] Scrape: Fix panic when parsing bare label names without an equal sign in brace-only metric notation. [#18229](prometheus/prometheus#18229)
- \[BUGFIX] TSDB: Fail early when `use-uncached-io` feature flag is set on unsupported environments. [#18219](prometheus/prometheus#18219)
- \[BUGFIX] TSDB: Fall back to CLI flag values when retention is removed from config file. [#18200](prometheus/prometheus#18200)
- \[BUGFIX] TSDB: Fix memory leaks in buffer pools by clearing reference fields before returning buffers to pools. [#17895](prometheus/prometheus#17895)
- \[BUGFIX] TSDB: Fix missing mmap of histogram chunks during WAL replay. [#18306](prometheus/prometheus#18306)
- \[BUGFIX] TSDB: Fix storage.tsdb.retention.time unit mismatch in file causing retention to be 1e6 times longer than configured. [#18200](prometheus/prometheus#18200)
- \[BUGFIX] Tracing: Fix missing traceID in query log when tracing is enabled, previously only spanID was emitted. [#18189](prometheus/prometheus#18189)
- \[BUGFIX] UI: Fix tooltip Y-offset drift when using multiple graph panels. [#18228](prometheus/prometheus#18228)
- \[BUGFIX] UI: Update retention display in runtime info when config is reloaded. [#18200](prometheus/prometheus#18200)
zenador added a commit to grafana/mimir that referenced this pull request Jun 26, 2026
#### What this PR does

Implement `histogram_quantiles` in MQE.

#### Which issue(s) this PR fixes or relates to

Brings prometheus/prometheus#17285 into MQE.

#### Checklist

- [x] Tests updated.
- [ ] Documentation added.
- [x] `CHANGELOG.md` updated - the order of entries should be
`[CHANGE]`, `[FEATURE]`, `[ENHANCEMENT]`, `[BUGFIX]`. If changelog entry
is not needed, please add the `changelog-not-needed` label to the PR.
- [x]
[`about-versioning.md`](https://github.com/grafana/mimir/blob/main/docs/sources/mimir/configure/about-versioning.md)
updated with experimental features.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches core PromQL histogram evaluation and several query-plan
optimization paths; impact is mitigated by the experimental feature gate
and broad test coverage, but wrong dedupe or bucket handling could
affect query results.
> 
> **Overview**
> Adds **experimental `histogram_quantiles`** to the Mimir Query Engine
so a single call can compute multiple quantiles from classic or native
histograms, with output series labeled by a configurable quantile label.
> 
> The implementation introduces **`HistogramQuantilesFunction`** and
refactors shared classic/native histogram grouping into
**`histogramGrouper`**, reusing accumulation and step-wise output logic
with `histogram_quantile` / `histogram_fraction`. MQE **plan
optimizers** are updated so the new function is treated like other
label-modifying histogram ops (dedupe/merge retention, narrow selectors,
filter pushdown rules, full bucket decoding).
> 
> **CHANGELOG**, **about-versioning**, function registration
(proto/factory), and **PromQL testdata** are updated; previously skipped
upstream `histogram_quantiles` cases are enabled plus Mimir-specific
tests (range queries, duplicate quantiles, mixed valid/invalid
quantiles).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
bc80cda. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants