Skip to content

PromQL: Fix start and end keywords masking label and metric names#9119

Merged
brancz merged 2 commits intoprometheus:release-2.29from
claytonpeters:promql-start-end-fix
Aug 4, 2021
Merged

PromQL: Fix start and end keywords masking label and metric names#9119
brancz merged 2 commits intoprometheus:release-2.29from
claytonpeters:promql-start-end-fix

Conversation

@claytonpeters
Copy link

This fixes an issue with the "at modifier" that introduced two new keywords: start and end. In grouping options and in metric names, these keywords took precedence over metric or label names, so that those metrics and labels could no longer be referenced.

Fixes #9040

Signed-off-by: Clayton Peters clayton.peters@man.com

This commit fixes an issue with the "at modifier" that introduced two
new keywords: `start` and `end`. In grouping options and in metric
names, these keywords took precedence over metric or label names, so
that those metrics and labels could no longer be referenced.

Signed-off-by: Clayton Peters <clayton.peters@man.com>
@roidelapluie
Copy link
Member

Can you please add tests in promql/parser/parse_test.go's testExpr where start and end are used as metrics ?

@claytonpeters
Copy link
Author

Can you please add tests in promql/parser/parse_test.go's testExpr where start and end are used as metrics ?

Sure, I'll sort that in the next hour or two.

Signed-off-by: Clayton Peters <clayton.peters@man.com>
@claytonpeters
Copy link
Author

@roidelapluie Tests when start and end used as metrics and/or labels added.

@roidelapluie
Copy link
Member

I have closed/reopen for CI to run

@roidelapluie roidelapluie changed the base branch from main to release-2.29 August 3, 2021 10:26
@roidelapluie roidelapluie requested a review from brancz August 3, 2021 10:27
@roidelapluie
Copy link
Member

I have tested the goyacc also, it's fine.

@brancz can we have this in 2.29? Thanks!

@roidelapluie roidelapluie mentioned this pull request Aug 4, 2021
@brancz brancz merged commit a11be60 into prometheus:release-2.29 Aug 4, 2021
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.

PromQL: Labels of name "start" and "end" no longer allowed in grouping opts

3 participants