Fix issue where annotations would not be returned for sharded queries #9138
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.
What this PR does
This PR fixes an issue where some annotations would not be returned for sharded queries.
This would occur if the annotation was generated during the evaluation of one of the shards.
For example, the query
sum(rate(foo[5m]))
should return ametric might not be a counter, name does not end in _total/_sum/_count/_bucket: "foo"
info annotation. When this query is sharded, the annotation is generated during the evaluation of one of thesum(rate(foo{__query_shard__="x_of_y"}[5m]))
shards on queriers, but the query-frontend would not combine annotations from individual shards into the final result.This PR changes the behaviour of query-frontends to accumulate and return annotations from each sharded query.
Which issue(s) this PR fixes or relates to
(none)
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.