diff --git a/internal/cortex/querier/queryrange/results_cache.go b/internal/cortex/querier/queryrange/results_cache.go index c32abba8ace..b54224520f6 100644 --- a/internal/cortex/querier/queryrange/results_cache.go +++ b/internal/cortex/querier/queryrange/results_cache.go @@ -516,6 +516,15 @@ func (s resultsCache) handleHit(ctx context.Context, r Request, extents []Extent } response, err := s.merger.MergeResponse(r, responses...) + if err == nil { + if promResp, ok := response.(*PrometheusResponse); ok { + promResp.Headers = append(promResp.Headers, &PrometheusResponseHeader{ + Name: "X-Thanos-Results-Cache", + Values: []string{fmt.Sprintf("hit; extents=%d", len(extents))}, + }) + } + } + return response, mergedExtents, err }