diff --git a/pkg/queryfrontend/metadata_codec.go b/pkg/queryfrontend/metadata_codec.go index 6470cc878b..7b84f9156e 100644 --- a/pkg/queryfrontend/metadata_codec.go +++ b/pkg/queryfrontend/metadata_codec.go @@ -175,7 +175,7 @@ func (c metadataCodec) DecodeResponse(ctx context.Context, r *http.Response, req buf, err := ioutil.ReadAll(r.Body) if err != nil { - log.Error(err) + log.Error(err) //nolint:errcheck return nil, httpgrpc.Errorf(http.StatusInternalServerError, "error decoding response: %v", err) } diff --git a/pkg/queryfrontend/roundtrip.go b/pkg/queryfrontend/roundtrip.go index 041d1a4d82..6d35122cac 100644 --- a/pkg/queryfrontend/roundtrip.go +++ b/pkg/queryfrontend/roundtrip.go @@ -51,11 +51,8 @@ func NewTripperware( return nil, err } - metadataTripperware, err := newMetadataTripperware(config, limits, metadataCodec, + metadataTripperware := newMetadataTripperware(config, limits, metadataCodec, prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "metadata"}, reg), logger) - if err != nil { - return nil, err - } return func(next http.RoundTripper) http.RoundTripper { return newRoundTripper(next, queryRangeTripperware(next), metadataTripperware(next), reg) @@ -116,7 +113,7 @@ func getOperation(r *http.Request) string { return seriesOp default: matched, err := regexp.MatchString("/api/v1/label/.+/values$", r.URL.Path) - if err == nil && matched == true { + if err == nil && matched { return labelValuesOp } } @@ -199,7 +196,7 @@ func newMetadataTripperware( codec *metadataCodec, reg prometheus.Registerer, logger log.Logger, -) (frontend.Tripperware, error) { +) frontend.Tripperware { metadataMiddleware := []queryrange.Middleware{queryrange.LimitsMiddleware(limits)} m := queryrange.NewInstrumentMiddlewareMetrics(reg) @@ -225,7 +222,7 @@ func newMetadataTripperware( return frontend.RoundTripFunc(func(r *http.Request) (*http.Response, error) { return rt.RoundTrip(r) }) - }, nil + } } // Don't go to response cache if StoreMatchers are set.