Skip to content

promtool: support missing promql syntax features#17926

Merged
bwplotka merged 1 commit intoprometheus:mainfrom
isker:promtool-feature-flags
Feb 9, 2026
Merged

promtool: support missing promql syntax features#17926
bwplotka merged 1 commit intoprometheus:mainfrom
isker:promtool-feature-flags

Conversation

@isker
Copy link
Copy Markdown
Contributor

@isker isker commented Jan 23, 2026

Namely promql-duration-expr and promql-extended-range-selectors. This allows promtool to e.g. check rules files using syntax gated by these features.

Which issue(s) does the PR fix:

Fixes #17922.

Does this PR introduce a user-facing change?

[ENHANCEMENT] promtool: support promql syntax features `promql-duration-expr` and `promql-extended-range-selectors`

Namely promql-duration-expr and promql-extended-range-selectors. This
allows promtool to e.g. check rules files using syntax gated by these
features.

Signed-off-by: Ian Kerins <[email protected]>
@isker isker requested a review from dgl as a code owner January 23, 2026 17:53
@isker isker force-pushed the promtool-feature-flags branch from adcd17a to 96e8e89 Compare January 23, 2026 17:53
@isker
Copy link
Copy Markdown
Contributor Author

isker commented Jan 23, 2026

Windows test failures do not look related to me:

2026-01-23T17:57:05.5674885Z panic: runtime error: invalid memory address or nil pointer dereference
2026-01-23T17:57:05.5675127Z [signal 0xc0000005 code=0x0 addr=0x18 pc=0x7ff735f4dbcc]
2026-01-23T17:57:05.5675138Z 
2026-01-23T17:57:05.5675268Z goroutine 231319 [running]:
2026-01-23T17:57:05.5675660Z github.com/prometheus/prometheus/scrape.(*scrapeLoop).appender(0xc010601080)
2026-01-23T17:57:05.5675947Z 	D:/a/prometheus/prometheus/scrape/scrape.go:1314 +0xac
2026-01-23T17:57:05.5677117Z github.com/prometheus/prometheus/scrape.(*scrapeLoop).scrapeAndReport(0xc010601080, {0xee105ad71?, 0x7ff736c31c60?, 0x0?}, {0xee105ad71?, 0x7ff736c31c60?, 0x7ff736c31c60?}, 0x0)
2026-01-23T17:57:05.5677427Z 	D:/a/prometheus/prometheus/scrape/scrape.go:1338 +0x385
2026-01-23T17:57:05.5677805Z github.com/prometheus/prometheus/scrape.(*scrapeLoop).run(0xc010601080, 0x0)
2026-01-23T17:57:05.5678068Z 	D:/a/prometheus/prometheus/scrape/scrape.go:1291 +0x34b
2026-01-23T17:57:05.5678844Z github.com/prometheus/prometheus/scrape.(*scrapePool).restartLoops.func1({0x7ff736442678?, 0xc010600d80?}, {0x7ff736442678, 0xc010601080})
2026-01-23T17:57:05.5679086Z 	D:/a/prometheus/prometheus/scrape/scrape.go:368 +0xbd
2026-01-23T17:57:05.5679596Z created by github.com/prometheus/prometheus/scrape.(*scrapePool).restartLoops in goroutine 231318
2026-01-23T17:57:05.5679967Z 	D:/a/prometheus/prometheus/scrape/scrape.go:362 +0x653
2026-01-23T17:57:05.5680193Z FAIL	github.com/prometheus/prometheus/scrape	31.961s

@beorn7 beorn7 requested a review from roidelapluie January 27, 2026 11:12
@beorn7
Copy link
Copy Markdown
Member

beorn7 commented Jan 27, 2026

Hello from the bug scrub!

THis sounds fair at first glance. @dgl and @roidelapluie could you have a look?

Copy link
Copy Markdown
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks

@bwplotka bwplotka merged commit 4383499 into prometheus:main Feb 9, 2026
53 of 54 checks passed
@isker
Copy link
Copy Markdown
Contributor Author

isker commented Feb 9, 2026

Thanks!

bwplotka added a commit that referenced this pull request Feb 11, 2026
* Update npm dependencies for v3.10

Signed-off-by: Ganesh Vernekar <[email protected]>

* Fix critical npm vulnerabilities with npm audit fix

Signed-off-by: Ganesh Vernekar <[email protected]>

* UI: Move HistoryCompleteStrategy into its own file and fix lint

Signed-off-by: Ganesh Vernekar <[email protected]>

* [REFACTOR] Relabel: Remove unnecessary Process() function

All uses can be replaced by ProcessBuilder, which is more efficient.

Signed-off-by: Bryan Boreham <[email protected]>

* promql: use Kahan summation for Native Histograms (#15687)

As for float samples, Kahan summation is used for the `sum` and `avg` aggregation and for the respective `_over_time` functions.

Kahan summation is not perfect. This commit also adds tests that even Kahan summation cannot reliably pass.
These tests are commented out.

Note that the behavior might be different on other hardware platforms. We have to keep an eye on test failing on other hardware platforms and adjust them accordingly.

Signed-off-by: Aleksandr Smirnov <[email protected]>

* fix(docs): typo in prometheus_agent.md doc

Signed-off-by: Mohammad Abbasi <[email protected]>

* AWS SD: ECS Standalone Tasks

The current ECS role in AWS SD assumes that a task is part of a service.
This means that tasks that are started as part of AWS Batch will get
missed and not be discovered. This changed fixes this so that standalone
tasks can be discovered as well.

Signed-off-by: matt-gp <[email protected]>

* AWS SD: Optmise MSK Role

Signed-off-by: matt-gp <[email protected]>

* promtool: support missing promql syntax features (#17926)

Namely promql-duration-expr and promql-extended-range-selectors. This
allows promtool to e.g. check rules files using syntax gated by these
features.

Signed-off-by: Ian Kerins <[email protected]>

* Also run CI on release tags

Make sure we also run the main CI workflow `v*` release tags
so `publish_release` job is run.

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

* chore(deps): bump github.com/hashicorp/consul/api from 1.32.0 to 1.33.2 (#17449)

Bumps [github.com/hashicorp/consul/api](https://github.com/hashicorp/consul) from 1.32.0 to 1.33.2.
- [Release notes](https://github.com/hashicorp/consul/releases)
- [Changelog](https://github.com/hashicorp/consul/blob/main/CHANGELOG.md)
- [Commits](hashicorp/consul@api/v1.32.0...api/v1.33.2)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/consul/api
  dependency-version: 1.33.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>

* AWS SD: Load Region Fallback (#18019)

* AWS SD: Load Region Fallback

---------

Signed-off-by: matt-gp <[email protected]>

* Build riscv64 docker image by default (#17508)

* Allow building riscv64 docker  image

Co-authored by: [email protected];

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

* Update Makefile

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

---------

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

* Increase Renovate speed (#18052)

* Allow Renovate to run all day on the monthly day.
* Increase the max PRs from 10 to 20.
* Incresae the PR open rate from 2 to 5.

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

* docs(api): clarify metadata vs remote protocols (#17481)

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

* tsdb/index: export sentinel error for symbol table size exceeded

Signed-off-by: Patryk Prus <[email protected]>

* Update Go dependencies for v3.10 release

Signed-off-by: Ganesh Vernekar <[email protected]>

* Kubernetes SD: Disable WatchListClient in tests

Signed-off-by: Ganesh Vernekar <[email protected]>

* Replace deprecated google.CredentialsFromJSON with option.WithAuthCredentialsFile

Signed-off-by: Ganesh Vernekar <[email protected]>

* chore(deps): update actions/checkout action to v4.3.1 (#18054)

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

* chore(deps): update actions/cache action to v5.0.3 (#18053)

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

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

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

---------

Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Bryan Boreham <[email protected]>
Signed-off-by: Aleksandr Smirnov <[email protected]>
Signed-off-by: Mohammad Abbasi <[email protected]>
Signed-off-by: matt-gp <[email protected]>
Signed-off-by: Ian Kerins <[email protected]>
Signed-off-by: SuperQ <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
Signed-off-by: ffgan <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
Signed-off-by: Patryk Prus <[email protected]>
Co-authored-by: Ganesh Vernekar <[email protected]>
Co-authored-by: Bryan Boreham <[email protected]>
Co-authored-by: Sasha <[email protected]>
Co-authored-by: Mohammad Abbasi <[email protected]>
Co-authored-by: matt-gp <[email protected]>
Co-authored-by: Ian Kerins <[email protected]>
Co-authored-by: SuperQ <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arve Knudsen <[email protected]>
Co-authored-by: Julien <[email protected]>
Co-authored-by: George Krajcsovits <[email protected]>
Co-authored-by: ffgan <[email protected]>
Co-authored-by: Patryk Prus <[email protected]>
Co-authored-by: Ganesh Vernekar <[email protected]>
Co-authored-by: Joe Adams <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 12, 2026
##### [\`v3.10.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.10.0)

Prometheus now offers a distroless Docker image variant alongside the default
busybox image. The distroless variant provides enhanced security with a minimal
base image, uses UID/GID 65532 (nonroot) instead of nobody, and removes the
VOLUME declaration. Both variants are available with `-busybox` and `-distroless`
tag suffixes (e.g., `prom/prometheus:latest-busybox`, `prom/prometheus:latest-distroless`).
The busybox image remains the default with no suffix for backwards compatibility
(e.g., `prom/prometheus:latest` points to the busybox variant).

For users migrating existing **named** volumes from the busybox image to the distroless variant, the ownership can be adjusted with:

```
docker run --rm -v prometheus-data:/prometheus alpine chown -R 65532:65532 /prometheus
```

Then, the container can be started with the old volume with:

```
docker run -v prometheus-data:/prometheus prom/prometheus:latest-distroless
```

User migrating from bind mounts might need to ajust permissions too, depending on their setup.

- \[CHANGE] Alerting: Add `alertmanager` dimension to following metrics: `prometheus_notifications_dropped_total`, `prometheus_notifications_queue_capacity`, `prometheus_notifications_queue_length`. [#16355](prometheus/prometheus#16355)
- \[CHANGE] UI: Hide expanded alert annotations by default, enabling more information density on the `/alerts` page. [#17611](prometheus/prometheus#17611)
- \[FEATURE] AWS SD: Add MSK Role. [#17600](prometheus/prometheus#17600)
- \[FEATURE] PromQL: Add `fill()` / `fill_left()` / `fill_right()` binop modifiers for specifying default values for missing series. [#17644](prometheus/prometheus#17644)
- \[FEATURE] Web: Add OpenAPI 3.2 specification for the HTTP API at `/api/v1/openapi.yaml`. [#17825](prometheus/prometheus#17825)
- \[FEATURE] Dockerfile: Add distroless image variant using UID/GID 65532 and no VOLUME declaration. Busybox image remains default. [#17876](prometheus/prometheus#17876)
- \[FEATURE] Web: Add on-demand wall time profiling under `<URL>/debug/pprof/fgprof`. [#18027](prometheus/prometheus#18027)
- \[ENHANCEMENT] PromQL: Add more detail to histogram quantile monotonicity info annotations. [#15578](prometheus/prometheus#15578)
- \[ENHANCEMENT] Alerting: Independent alertmanager sendloops. [#16355](prometheus/prometheus#16355)
- \[ENHANCEMENT] TSDB: Experimental support for early compaction of stale series in the memory with configurable threshold `stale_series_compaction_threshold` in the config file. [#16929](prometheus/prometheus#16929)
- \[ENHANCEMENT] Service Discovery: Service discoveries are now removable from the Prometheus binary through the Go build tag `remove_all_sd` and individual service discoveries can be re-added with the build tags `enable_<sd name>_sd`. Users can build a custom Prometheus with only the necessary SDs for a smaller binary size. [#17736](prometheus/prometheus#17736)
- \[ENHANCEMENT] Promtool: Support promql syntax features `promql-duration-expr` and `promql-extended-range-selectors`. [#17926](prometheus/prometheus#17926)
- \[PERF] PromQL: Avoid unnecessary label extraction in PromQL functions. [#17676](prometheus/prometheus#17676)
- \[PERF] PromQL: Improve performance of regex matchers like `.*-.*-.*`. [#17707](prometheus/prometheus#17707)
- \[PERF] OTLP: Add label caching for OTLP-to-Prometheus conversion to reduce allocations and improve latency. [#17860](prometheus/prometheus#17860)
- \[PERF] API: Compute `/api/v1/targets/relabel_steps` in a single pass instead of re-running relabeling for each prefix. [#17969](prometheus/prometheus#17969)
- \[PERF] tsdb: Optimize LabelValues intersection performance for matchers. [#18069](prometheus/prometheus#18069)
- \[BUGFIX] PromQL: Prevent query strings containing only UTF-8 continuation bytes from crashing Prometheus. [#17735](prometheus/prometheus#17735)
- \[BUGFIX] Web: Fix missing `X-Prometheus-Stopping` header for `/-/ready` endpoint in `NotReady` state. [#17795](prometheus/prometheus#17795)
- \[BUGFIX] PromQL: Fix PromQL `info()` function returning empty results when filtering by a label that exists on both the input metric and `target_info`. [#17817](prometheus/prometheus#17817)
- \[BUGFIX] TSDB: Fix a bug during exemplar buffer grow/shrink that could cause exemplars to be incorrectly discarded. [#17863](prometheus/prometheus#17863)
- \[BUGFIX] UI: Fix broken graph display after page reload, due to broken Y axis min encoding/decoding. [#17869](prometheus/prometheus#17869)
- \[BUGFIX] TSDB: Fix memory leaks in buffer pools by clearing reference fields (Labels, Histogram pointers, metadata strings) before returning buffers to pools. [#17879](prometheus/prometheus#17879)
- \[BUGFIX] PromQL: info function: fix series without identifying labels not being returned. [#17898](prometheus/prometheus#17898)
- \[BUGFIX] OTLP: Filter `__name__` from OTLP attributes to prevent duplicate labels. [#17917](prometheus/prometheus#17917)
- \[BUGFIX] TSDB: Fix division by zero when computing stale series ratio with empty head. [#17952](prometheus/prometheus#17952)
- \[BUGFIX] OTLP: Fix potential silent data loss for sum metrics. [#17954](prometheus/prometheus#17954)
- \[BUGFIX] PromQL: Fix smoothed interpolation across counter resets. [#17988](prometheus/prometheus#17988)
- \[BUGFIX] PromQL: Fix panic with `@` modifier on empty ranges. [#18020](prometheus/prometheus#18020)
- \[BUGFIX] PromQL: Fix `avg_over_time` for a single native histogram. [#18058](prometheus/prometheus#18058)
renovate bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 13, 2026
##### [\`v3.10.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.10.0)

Prometheus now offers a distroless Docker image variant alongside the default
busybox image. The distroless variant provides enhanced security with a minimal
base image, uses UID/GID 65532 (nonroot) instead of nobody, and removes the
VOLUME declaration. Both variants are available with `-busybox` and `-distroless`
tag suffixes (e.g., `prom/prometheus:latest-busybox`, `prom/prometheus:latest-distroless`).
The busybox image remains the default with no suffix for backwards compatibility
(e.g., `prom/prometheus:latest` points to the busybox variant).

For users migrating existing **named** volumes from the busybox image to the distroless variant, the ownership can be adjusted with:

```
docker run --rm -v prometheus-data:/prometheus alpine chown -R 65532:65532 /prometheus
```

Then, the container can be started with the old volume with:

```
docker run -v prometheus-data:/prometheus prom/prometheus:latest-distroless
```

User migrating from bind mounts might need to ajust permissions too, depending on their setup.

- \[CHANGE] Alerting: Add `alertmanager` dimension to following metrics: `prometheus_notifications_dropped_total`, `prometheus_notifications_queue_capacity`, `prometheus_notifications_queue_length`. [#16355](prometheus/prometheus#16355)
- \[CHANGE] UI: Hide expanded alert annotations by default, enabling more information density on the `/alerts` page. [#17611](prometheus/prometheus#17611)
- \[FEATURE] AWS SD: Add MSK Role. [#17600](prometheus/prometheus#17600)
- \[FEATURE] PromQL: Add `fill()` / `fill_left()` / `fill_right()` binop modifiers for specifying default values for missing series. [#17644](prometheus/prometheus#17644)
- \[FEATURE] Web: Add OpenAPI 3.2 specification for the HTTP API at `/api/v1/openapi.yaml`. [#17825](prometheus/prometheus#17825)
- \[FEATURE] Dockerfile: Add distroless image variant using UID/GID 65532 and no VOLUME declaration. Busybox image remains default. [#17876](prometheus/prometheus#17876)
- \[FEATURE] Web: Add on-demand wall time profiling under `<URL>/debug/pprof/fgprof`. [#18027](prometheus/prometheus#18027)
- \[ENHANCEMENT] PromQL: Add more detail to histogram quantile monotonicity info annotations. [#15578](prometheus/prometheus#15578)
- \[ENHANCEMENT] Alerting: Independent alertmanager sendloops. [#16355](prometheus/prometheus#16355)
- \[ENHANCEMENT] TSDB: Experimental support for early compaction of stale series in the memory with configurable threshold `stale_series_compaction_threshold` in the config file. [#16929](prometheus/prometheus#16929)
- \[ENHANCEMENT] Service Discovery: Service discoveries are now removable from the Prometheus binary through the Go build tag `remove_all_sd` and individual service discoveries can be re-added with the build tags `enable_<sd name>_sd`. Users can build a custom Prometheus with only the necessary SDs for a smaller binary size. [#17736](prometheus/prometheus#17736)
- \[ENHANCEMENT] Promtool: Support promql syntax features `promql-duration-expr` and `promql-extended-range-selectors`. [#17926](prometheus/prometheus#17926)
- \[PERF] PromQL: Avoid unnecessary label extraction in PromQL functions. [#17676](prometheus/prometheus#17676)
- \[PERF] PromQL: Improve performance of regex matchers like `.*-.*-.*`. [#17707](prometheus/prometheus#17707)
- \[PERF] OTLP: Add label caching for OTLP-to-Prometheus conversion to reduce allocations and improve latency. [#17860](prometheus/prometheus#17860)
- \[PERF] API: Compute `/api/v1/targets/relabel_steps` in a single pass instead of re-running relabeling for each prefix. [#17969](prometheus/prometheus#17969)
- \[PERF] tsdb: Optimize LabelValues intersection performance for matchers. [#18069](prometheus/prometheus#18069)
- \[BUGFIX] PromQL: Prevent query strings containing only UTF-8 continuation bytes from crashing Prometheus. [#17735](prometheus/prometheus#17735)
- \[BUGFIX] Web: Fix missing `X-Prometheus-Stopping` header for `/-/ready` endpoint in `NotReady` state. [#17795](prometheus/prometheus#17795)
- \[BUGFIX] PromQL: Fix PromQL `info()` function returning empty results when filtering by a label that exists on both the input metric and `target_info`. [#17817](prometheus/prometheus#17817)
- \[BUGFIX] TSDB: Fix a bug during exemplar buffer grow/shrink that could cause exemplars to be incorrectly discarded. [#17863](prometheus/prometheus#17863)
- \[BUGFIX] UI: Fix broken graph display after page reload, due to broken Y axis min encoding/decoding. [#17869](prometheus/prometheus#17869)
- \[BUGFIX] TSDB: Fix memory leaks in buffer pools by clearing reference fields (Labels, Histogram pointers, metadata strings) before returning buffers to pools. [#17879](prometheus/prometheus#17879)
- \[BUGFIX] PromQL: info function: fix series without identifying labels not being returned. [#17898](prometheus/prometheus#17898)
- \[BUGFIX] OTLP: Filter `__name__` from OTLP attributes to prevent duplicate labels. [#17917](prometheus/prometheus#17917)
- \[BUGFIX] TSDB: Fix division by zero when computing stale series ratio with empty head. [#17952](prometheus/prometheus#17952)
- \[BUGFIX] OTLP: Fix potential silent data loss for sum metrics. [#17954](prometheus/prometheus#17954)
- \[BUGFIX] PromQL: Fix smoothed interpolation across counter resets. [#17988](prometheus/prometheus#17988)
- \[BUGFIX] PromQL: Fix panic with `@` modifier on empty ranges. [#18020](prometheus/prometheus#18020)
- \[BUGFIX] PromQL: Fix `avg_over_time` for a single native histogram. [#18058](prometheus/prometheus#18058)
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.

promtool: parse extended range selectors

3 participants