Add parameter support in PromQL query durations#139873
Merged
felixbarny merged 8 commits intoelastic:mainfrom Jan 12, 2026
Merged
Add parameter support in PromQL query durations#139873felixbarny merged 8 commits intoelastic:mainfrom
felixbarny merged 8 commits intoelastic:mainfrom
Conversation
Fixes elastic#139508 Parameters like ?_step or ?1 now work inside PromQL durations: PROMQL step=?_step rate(foo[?_step]) Changes: - Add NAMED_OR_POSITIONAL_PARAM token to PromqlBaseLexer.g4 - Update timeValue rule in PromqlBaseParser.g4 to accept parameters - Add parameter resolution in PromqlExpressionBuilder - Pass QueryParams through the parser chain
|
💚 CLA has been signed |
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
felixbarny
requested changes
Jan 8, 2026
Member
felixbarny
left a comment
There was a problem hiding this comment.
Thanks a lot for your contribution and sorry for the delay. The issue has been assigned to the wrong team initially. The approach looks good to me. I've left a few comments.
.../plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/promql/PromqlParserTests.java
Outdated
Show resolved
Hide resolved
.../plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/promql/PromqlParserTests.java
Outdated
Show resolved
Hide resolved
.../plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/promql/PromqlParserTests.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/PromqlParser.java
Outdated
Show resolved
Hide resolved
...n/esql/src/main/java/org/elasticsearch/xpack/esql/parser/promql/PromqlExpressionBuilder.java
Outdated
Show resolved
Hide resolved
felixbarny
approved these changes
Jan 12, 2026
Member
|
@elasticmachine test this please |
Member
|
@elasticmachine test this please |
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Jan 12, 2026
…i-project-tests * upstream/main: (23 commits) Fix `testAckListenerReceivesNacksIfPublicationTimesOut` (elastic#140514) Reduce priority of clear-cache tasks (elastic#139685) Add docs and tests about `StreamOutput` to memory (elastic#140365) ES|QL - dense_vector support for COUNT, PRESENT, ABSENT aggregator functions (elastic#139914) Add release notes for v9.2.4 release (elastic#140487) Add release notes for v9.1.10 release (elastic#140488) Add conncectors release notes for 9.1.10, 9.2.4 (elastic#140499) Add parameter support in PromQL query durations (elastic#139873) Improve testing of STS credentials reloading (elastic#140114) Fix zstd native binary publishing script to support newer versions (elastic#140485) Add FlattenedFieldBinaryVsSortedSetDocValuesSyntheticSourceIT (elastic#140489) Store fallback match only text fields in binary doc values (elastic#140189) [DiskBBQ] Use the new merge executor for intra-merge parallelism (elastic#139942) ESQL: introduce support for mapping-unavailable fields (elastic#140463) Add ESNextOSQVectorsScorerTests (elastic#140436) Disable high cardinality tests on release builds (elastic#140503) ESQL: TRange timezone support (elastic#139911) Directly compressing `StreamOutput` (elastic#140502) ES|QL - fix dense vector enrich bug (elastic#139774) Use CrossProjectModeDecider in RemoteClusterService (elastic#140481) ...
spinscale
pushed a commit
to spinscale/elasticsearch
that referenced
this pull request
Jan 21, 2026
Fixes elastic#139508 Parameters like ?_step or ?1 now work inside PromQL durations: PROMQL step=?_step rate(foo[?_step]) Changes: - Add NAMED_OR_POSITIONAL_PARAM token to PromqlBaseLexer.g4 - Update timeValue rule in PromqlBaseParser.g4 to accept parameters - Add parameter resolution in PromqlExpressionBuilder - Pass QueryParams through the parser chain --------- Co-authored-by: Felix Barnsteiner <felix.barnsteiner@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #139508
Parameters like ?_step or ?1 now work inside PromQL durations: PROMQL step=?_step rate(foo[?_step])
Changes:
gradle check?