Skip to content

[BUGFIX] PromQL: avoid panic when parsing malformed info call#17379

Merged
aknuds1 merged 1 commit intoprometheus:mainfrom
linasm:avoid-panic-parsing-malformed-info
Oct 23, 2025
Merged

[BUGFIX] PromQL: avoid panic when parsing malformed info call#17379
aknuds1 merged 1 commit intoprometheus:mainfrom
linasm:avoid-panic-parsing-malformed-info

Conversation

@linasm
Copy link
Contributor

@linasm linasm commented Oct 21, 2025

PromQL parser panics when processing a malformed info function call (such as having a binary expression as its second argument):

info(http_request_counter_total{namespace="zzz"}, {foo="bar"} == 1)

parser panic: interface conversion: parser.Expr is *parser.BinaryExpr, not *parser.VectorSelector

This PR modifies the parser to fail gracefully with an error message instead.

Does this PR introduce a user-facing change?

[BUGFIX] PromQL: avoid panic when parsing malformed info call

Signed-off-by: Linas Medziunas <linas.medziunas@gmail.com>
@linasm linasm requested a review from roidelapluie as a code owner October 21, 2025 10:17
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@aknuds1 aknuds1 merged commit b2e7938 into prometheus:main Oct 23, 2025
28 checks passed
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.

2 participants