Repository navigation
UI: Support arithmetics in duration expression - #18625
Conversation
bwplotka
left a comment
There was a problem hiding this comment.
Looks good to my non-frontend eyes. Ideally we wait for someone with more context.
AI found small nit, but can be done later (dedup improvements)
juliusv
left a comment
There was a problem hiding this comment.
@Nexucis understands this autocompletion code better than I do, but I did notice in usage that the UI now shows too many autocomplete options, like when you just start typing a number, it doesn't just give you ms/s/m/h/... units in the completion, but also binary operators and the new functions:
IMO those shouldn't be shown as completion options when you are still typing your number.
- Like regular binops in existing PromQL, the operators here should probably only be shown in the autocomplete once you have already started typing them (which is a bit useless for 1-char operators, but hey, at least it confirms to the user that it's an expected thing in this position :)
- The function names should only be shown once the user started typing one as well.
bb6a3d6 to
623a297
Compare
Add grammar, highlighting, autocompletion, and linting for the
step(), range(), min(), and max() duration pseudo-functions
behind --enable-feature=promql-duration-expr.
- lezer-promql: add DurationExpr rule; update MatrixSelector and
SubqueryExpr to accept DurationExpr in duration slots; define
DurationStep/DurationRange via condFn to preserve step/range as
valid identifiers outside duration context
- highlight.js: tag DurationExpr child nodes as function(variableName)
- promql.terms.ts: add durationExprTerms with step(), range(), snippets
- hybrid.ts: add ContextKind.DurationExpr; use node.getChild('DurationExpr')
instead of containsAtLeastOneChild with string arg; add dedupeCompletions
- parser.ts: warn when range() is in subquery step position; error on
step()/range() in offset position without duplicating parse error
Signed-off-by: ADITYA TIWARI <[email protected]>
Operators and function names are no longer offered as soon as the user enters a duration number (e.g. typing `5` inside `[…]`). They now appear only once the user has actually started typing them: * Duration units (ms/s/m/…) are still the sole suggestions while a bare number is being typed. * After a complete duration atom (e.g. `5m`) the popup is silent; no stale operator/function suggestions bleed through when the user is still adding unit chars (fixing the `5m` → `5ms` noise). * Arithmetic operators (`+`, `-`, `*`, `/`, `%`, `^`) are suggested once the user types the first operator character inside a DurationExpr (cursor lands on the Add/Sub/Mul/Div/Mod/Pow token whose parent is DurationExpr). * Duration-expression functions (`step()`, `range()`, `min()`, `max()`) are suggested once the user types the first letter of the function name: either from scratch in an empty duration slot (Identifier inside error inside MatrixSelector/OffsetExpr/SubqueryExpr) or after a complete duration atom (LabelName in the same contexts). Signed-off-by: Julien Pivotto <[email protected]>
…itions Three more cases where unwanted completions appeared: 1. Empty duration slot (`foo[]`, `foo offset `, `go[5d:]`): the cursor lands on the container node (MatrixSelector, OffsetExpr, SubqueryExpr) or on an error node inside those containers. DurationExpr functions were offered immediately. They are now stripped from all those "empty/bare-slot" paths; duration units remain. Functions appear once the user types a letter, via the Identifier/LabelName handler added previously. 2. Arithmetic mid-expression (`foo[5m+2ms+m`): an Identifier typed inside an error node that is itself inside a DurationExpr fell through to the general metric/function handler (DurationExpr is not in the Expr node group, so the containsChild guard did not fire). This produced metric completions like `mad_over_time`. Added an explicit DurationExpr parent check that short-circuits to DurationExpr suggestions only. 3. Import: DurationExpr type ID is now imported from lezer-promql and used for all parent checks instead of the string .name comparison. Signed-off-by: Julien Pivotto <[email protected]>
When a duration slot is empty (matrix selector, subquery step, or offset with nothing typed yet), offer no completions instead of the duration unit list. Units are suggested once the user types a digit and duration-expression functions once a letter is typed, which avoids noisy suggestions in positions where no useful completion exists. Signed-off-by: Julien Pivotto <[email protected]>
f860e48 to
8f58943
Compare
The display layer (format.tsx) renders duration expressions for matrix ranges, subquery range/step, and offsets, but serialize.ts only handled matrix ranges and rewrote them as max_of(<expr>,1s). Since serializeNode builds the actual /query request for tree-view nodes, expressions were dropped or altered, executing a different query than displayed. Serialize rangeExpr/stepExpr/offsetExpr verbatim wherever present, mirroring format.tsx, and drop the max_of(...,1s) rewrite. Export serializeDurationNode for reuse. Add round-trip tests. Signed-off-by: Julien Pivotto <[email protected]>
… key collectNotes and durationExprNote were duplicated verbatim in ExplainView.tsx and Selector.tsx. The min_of/max_of dedupe key interpolated formatDurationNode (which returns a ReactNode) into a string, so both operands stringified to [object Object] and distinct expressions collapsed to a single note. Extract both helpers into a shared durationExprNotes module and build the dedupe key from the string serializeDurationNode instead. Signed-off-by: Julien Pivotto <[email protected]>
The duration-expression change dropped AtModifierPreprocessors from the modifier styleTags and added Start End, which are not grammar node names. This removed highlighting for the @ start()/end() preprocessors while the added entries were dead no-ops. Restore AtModifierPreprocessors and drop Start End; keep the new DurationExpr styleTags line. Signed-off-by: Julien Pivotto <[email protected]>
Remove two orphaned option-set constants from hybrid.test.ts that were never asserted against. Reflow the grandParent type-id condition to satisfy prettier. Include the string apply value in the dedupeCompletions key so completions differing only by inserted text are not merged. Signed-off-by: Julien Pivotto <[email protected]>
containsDurationRangeExpr scanned the whole step subtree, so a bounded range() such as min_of(range(), 5m) wrongly triggered the not-meaningful warning. Replace it with isTopLevelDurationRangeExpr, which checks only the step DurationExpr's direct children, and add a regression test. Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Julien Pivotto <[email protected]>
…queries Signed-off-by: Julien Pivotto <[email protected]>
…duration slots When a complete duration is followed by a dangling digit (e.g. `go[5d1]` or `go[5d:5d4]`), the parser emits an error node whose text is a non-empty number. The user is building a compound duration, so keep offering duration units instead of suggesting nothing. The empty slot case (`go[]`) still offers no suggestions. Signed-off-by: Julien Pivotto <[email protected]>
|
@juliusv re: the autocomplete noise — fixed. Typing a number now offers only units; the operators and |
Drop the optional `?` on rangeExpr/offsetExpr/stepExpr and use the existing `| null` convention so the compiler flags every construction site that forgets to set them. This surfaced a latent bug in Graph.tsx where the matrixSelector-to-vectorSelector conversion silently dropped offsetExpr; it now carries the value over. Signed-off-by: Julien Pivotto <[email protected]>
Lead each min_of/max_of explanation with the fully formatted sub-expression instead of a bare op() so nested occurrences of the same operator stay distinguishable, e.g. foo[max_of(1, max_of(2, 3))]. Add a test covering the nested case. Signed-off-by: Julien Pivotto <[email protected]>
juliusv
left a comment
There was a problem hiding this comment.
Nice, thanks. Looking good for my stuff now 👍
Nexucis
left a comment
There was a problem hiding this comment.
excepting my last comment, looks good to me !
Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Julien Pivotto <[email protected]>
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0) - \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124) - \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653) - \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269) - \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033) - \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093) - \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919) - \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089) - \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619) - \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609) - \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957) - \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086) - \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903) - \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170) - \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625) - \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706) - \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181) - \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833) - \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470) - \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143) - \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282) - \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300) - \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859) - \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037) - \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237) - \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102) - \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778) - \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167) - \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040) - \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153) - \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973) - \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107) - \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149) - \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183) - \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291) - \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013) - \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140) - \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202) - \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120) - \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145) - \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0) - \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124) - \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653) - \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269) - \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033) - \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093) - \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919) - \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089) - \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619) - \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609) - \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957) - \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086) - \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903) - \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170) - \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625) - \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706) - \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181) - \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833) - \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470) - \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143) - \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282) - \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300) - \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859) - \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037) - \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237) - \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102) - \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778) - \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167) - \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040) - \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153) - \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973) - \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107) - \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149) - \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183) - \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291) - \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013) - \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140) - \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202) - \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120) - \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145) - \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0) - \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124) - \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653) - \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269) - \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033) - \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093) - \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919) - \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089) - \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619) - \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609) - \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957) - \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086) - \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903) - \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170) - \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625) - \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706) - \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181) - \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833) - \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470) - \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143) - \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282) - \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300) - \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859) - \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037) - \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237) - \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102) - \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778) - \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167) - \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040) - \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153) - \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973) - \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107) - \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149) - \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183) - \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291) - \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013) - \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140) - \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202) - \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120) - \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145) - \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0) - \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124) - \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653) - \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269) - \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033) - \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093) - \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919) - \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089) - \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619) - \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609) - \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957) - \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086) - \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903) - \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170) - \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625) - \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706) - \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181) - \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833) - \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470) - \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143) - \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282) - \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300) - \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859) - \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037) - \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237) - \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102) - \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778) - \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167) - \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040) - \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153) - \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973) - \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107) - \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149) - \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183) - \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291) - \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013) - \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140) - \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202) - \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120) - \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145) - \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0) - \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124) - \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653) - \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269) - \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033) - \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093) - \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919) - \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089) - \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619) - \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609) - \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957) - \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086) - \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903) - \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170) - \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625) - \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706) - \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181) - \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833) - \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470) - \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143) - \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282) - \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300) - \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859) - \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037) - \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237) - \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102) - \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778) - \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167) - \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040) - \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153) - \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973) - \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107) - \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149) - \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016) - \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183) - \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291) - \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013) - \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140) - \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202) - \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120) - \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145) - \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
This PR is built on top of #18561
Which issue(s) does the PR fix:
Release notes for end users (ALL commits must be considered).
Reviewers should verify clarity and quality.