promql: fix info function returning empty when filtering by overlapping labels#17817
Merged
aknuds1 merged 1 commit intoprometheus:mainfrom Jan 9, 2026
Merged
promql: fix info function returning empty when filtering by overlapping labels#17817aknuds1 merged 1 commit intoprometheus:mainfrom
info function returning empty when filtering by overlapping labels#17817aknuds1 merged 1 commit intoprometheus:mainfrom
Conversation
3fd50fd to
65d0906
Compare
When filtering by a label that exists on both the input metric and
target_info (e.g., info(metric, {host_name="orbstack"}) where host_name
exists on both), the function incorrectly returned empty results.
The bug was in combineWithInfoVector: when no new labels were added
(because they all overlapped with base metric labels), the code entered
the "no match" filtering block even though an info series WAS matched.
The fix checks len(seenInfoMetrics) == 0 to correctly identify when no
info series matched. If an info series matched (seenInfoMetrics is
non-empty), the series is kept even if no new labels were added.
Fixes prometheus#17813
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
65d0906 to
6f2dd67
Compare
linasm
approved these changes
Jan 9, 2026
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.
When filtering by a label that exists on both the input metric and
target_info(e.g.,info(metric, {host_name="orbstack"})wherehost_nameexists on both), the function incorrectly returned empty results.The bug was in
combineWithInfoVector: when no new labels were added (because they all overlapped with base metric labels), the code entered the "no match" filtering block even though an info series WAS matched.The fix adds a check for
len(seenInfoMetrics) == 0to correctly distinguish between:Which issue(s) does the PR fix:
Fixes #17813
Does this PR introduce a user-facing change?