diff --git a/pkg/logproto/compat.go b/pkg/logproto/compat.go index e294b9fcc914b..869355cf8ad71 100644 --- a/pkg/logproto/compat.go +++ b/pkg/logproto/compat.go @@ -323,7 +323,3 @@ func (m *VolumeRequest) LogToSpan(sp opentracing.Span) { otlog.String("end", timestamp.Time(m.GetEnd()).String()), ) } - -func (*VolumeResponse) GetHeaders() []*definitions.PrometheusResponseHeader { - return nil -} diff --git a/pkg/querier/handler.go b/pkg/querier/handler.go index 033776d461648..47a4c15e07511 100644 --- a/pkg/querier/handler.go +++ b/pkg/querier/handler.go @@ -94,7 +94,11 @@ func (h *Handler) Do(ctx context.Context, req queryrangebase.Request) (queryrang } return &queryrange.IndexStatsResponse{Response: result}, nil case *logproto.VolumeRequest: - return h.api.VolumeHandler(ctx, concrete) + result, err := h.api.VolumeHandler(ctx, concrete) + if err != nil { + return nil, err + } + return &queryrange.VolumeResponse{Response: result}, nil default: return nil, fmt.Errorf("unsupported query type %T", req) } diff --git a/pkg/querier/queryrange/codec.go b/pkg/querier/queryrange/codec.go index 208d65fa4276f..9f3da0894a0fe 100644 --- a/pkg/querier/queryrange/codec.go +++ b/pkg/querier/queryrange/codec.go @@ -1518,7 +1518,7 @@ func NewEmptyResponse(r queryrangebase.Request) (queryrangebase.Response, error) case *logproto.IndexStatsRequest: return &logproto.IndexStatsResponse{}, nil case *logproto.VolumeRequest: - return &logproto.VolumeResponse{}, nil + return &VolumeResponse{}, nil default: return nil, fmt.Errorf("unsupported request type %T", req) } diff --git a/pkg/querier/queryrange/limits_test.go b/pkg/querier/queryrange/limits_test.go index e1329f5ee8c0a..1b7fda92bde71 100644 --- a/pkg/querier/queryrange/limits_test.go +++ b/pkg/querier/queryrange/limits_test.go @@ -304,7 +304,7 @@ func Test_MaxQueryLookBack_Types(t *testing.T) { From: model.Time(now.UnixMilli()), Through: model.Time(now.Add(-90 * time.Minute).UnixMilli()), }, - expectedResponse: &logproto.VolumeResponse{}, + expectedResponse: &VolumeResponse{}, }, }