Skip to content

Commit

Permalink
Remove GetHeaders from logproto.VolumeResponse. (#11049)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:
Replaces #11048. We would return
`logproto.VolumeResponse` but not match it in the codec.

**Special notes for your reviewer**:

**Checklist**
- [ ] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e)
- [ ] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory. <!--
TODO(salvacorts): Add example PR -->

(cherry picked from commit aedf6df)
  • Loading branch information
jeschkies authored and grafana-delivery-bot[bot] committed Oct 27, 2023
1 parent 5736051 commit 1162a8b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 0 additions & 4 deletions pkg/logproto/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 5 additions & 1 deletion pkg/querier/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/queryrange/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/queryrange/limits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
},
}

Expand Down

0 comments on commit 1162a8b

Please sign in to comment.