Skip to content

Commit

Permalink
Show warnings in query frontend (thanos-io#7289)
Browse files Browse the repository at this point in the history
* Show warnings in query frontend

QFE currently does not parse warnings from downstream queriers.
This commit fixes that by adding the field to proto messages and
modifies the merge function to take warnings into account.

Signed-off-by: Filip Petkovski <[email protected]>

* Add CHANGELOG entry

Signed-off-by: Filip Petkovski <[email protected]>

* Omit empty warnings

Signed-off-by: Filip Petkovski <[email protected]>

---------

Signed-off-by: Filip Petkovski <[email protected]>
  • Loading branch information
fpetkovski authored and jnyi committed Oct 16, 2024
1 parent 6203912 commit 9f59332
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
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
13 changes: 4 additions & 9 deletions internal/cortex/querier/queryrange/query_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ func (prometheusCodec) MergeResponse(_ Request, responses ...Response) (Response

var (
analyzes = make([]*Analysis, 0, len(responses))
seriesStatsCounters = make([]*SeriesStatsCounter, 0, len(responses))
warnings []string = nil
)
for i := range promResponses {
Expand All @@ -282,15 +283,9 @@ func (prometheusCodec) MergeResponse(_ Request, responses ...Response) (Response
if len(promResponses[i].Warnings) > 0 {
warnings = append(warnings, promResponses[i].Warnings...)
}
}

seriesStatsCounters := make([]*SeriesStatsCounter, 0, len(responses))
for i := range promResponses {
if promResponses[i].Data.GetSeriesStatsCounter() == nil {
continue
}

seriesStatsCounters = append(seriesStatsCounters, promResponses[i].Data.GetSeriesStatsCounter())
if promResponses[i].Data.GetSeriesStatsCounter() != nil {
seriesStatsCounters = append(seriesStatsCounters, promResponses[i].Data.GetSeriesStatsCounter())
}
}

response := PrometheusResponse{
Expand Down

0 comments on commit 9f59332

Please sign in to comment.