Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show warnings in query frontend #7289

Merged
merged 4 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#7244](https://github.com/thanos-io/thanos/pull/7244) Query: Fix Internal Server Error unknown targetHealth: "unknown" when trying to open the targets page.
- [#7248](https://github.com/thanos-io/thanos/pull/7248) Receive: Fix RemoteWriteAsync was sequentially executed causing high latency in the ingestion path.
- [#7271](https://github.com/thanos-io/thanos/pull/7271) Query: fixing dedup iterator when working on mixed sample types.
- [#7289](https://github.com/thanos-io/thanos/pull/7289) Query Frontend: show warnings from downstream queries.

### Added

Expand Down
15 changes: 10 additions & 5 deletions internal/cortex/querier/queryrange/query_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,17 @@ func (prometheusCodec) MergeResponse(_ Request, responses ...Response) (Response
// Merge the responses.
sort.Sort(byFirstTime(promResponses))

analyzes := make([]*Analysis, 0, len(responses))
var (
analyzes = make([]*Analysis, 0, len(responses))
warnings []string = nil
)
for i := range promResponses {
if promResponses[i].Data.GetAnalysis() == nil {
continue
if promResponses[i].Data.GetAnalysis() != nil {
analyzes = append(analyzes, promResponses[i].Data.GetAnalysis())
}
if len(promResponses[i].Warnings) > 0 {
warnings = append(warnings, promResponses[i].Warnings...)
}

analyzes = append(analyzes, promResponses[i].Data.GetAnalysis())
}

response := PrometheusResponse{
Expand All @@ -277,6 +281,7 @@ func (prometheusCodec) MergeResponse(_ Request, responses ...Response) (Response
Stats: StatsMerge(responses),
Analysis: AnalyzesMerge(analyzes...),
},
Warnings: warnings,
}

if len(resultsCacheGenNumberHeaderValues) != 0 {
Expand Down
Loading
Loading