Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/test-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
lint:
runs-on: ubuntu-24.04
container:
image: quay.io/cortexproject/build-image:master-03a8f8c98
image: quay.io/cortexproject/build-image:master-281284ac1
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
test:
runs-on: ubuntu-24.04
container:
image: quay.io/cortexproject/build-image:master-03a8f8c98
image: quay.io/cortexproject/build-image:master-281284ac1
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -64,7 +64,7 @@ jobs:
test-no-race:
runs-on: ubuntu-24.04
container:
image: quay.io/cortexproject/build-image:master-03a8f8c98
image: quay.io/cortexproject/build-image:master-281284ac1
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
build:
runs-on: ubuntu-24.04
container:
image: quay.io/cortexproject/build-image:master-03a8f8c98
image: quay.io/cortexproject/build-image:master-281284ac1
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -247,14 +247,14 @@ jobs:
run: |
touch build-image/.uptodate
MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations
make BUILD_IMAGE=quay.io/cortexproject/build-image:master-03a8f8c98 TTY='' configs-integration-test
make BUILD_IMAGE=quay.io/cortexproject/build-image:master-281284ac1 TTY='' configs-integration-test
deploy_website:
needs: [build, test]
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
runs-on: ubuntu-24.04
container:
image: quay.io/cortexproject/build-image:master-03a8f8c98
image: quay.io/cortexproject/build-image:master-281284ac1
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
runs-on: ubuntu-24.04
container:
image: quay.io/cortexproject/build-image:master-03a8f8c98
image: quay.io/cortexproject/build-image:master-281284ac1
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ build-image/$(UPTODATE): build-image/*
SUDO := $(shell docker info >/dev/null 2>&1 || echo "sudo -E")
BUILD_IN_CONTAINER := true
BUILD_IMAGE ?= $(IMAGE_PREFIX)build-image
LATEST_BUILD_IMAGE_TAG ?= master-03a8f8c98
LATEST_BUILD_IMAGE_TAG ?= master-281284ac1

# TTY is parameterized to allow Google Cloud Builder to run builds,
# as it currently disallows TTY devices. This value needs to be overridden
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cortexproject/cortex

go 1.23.0
go 1.24.0

require (
github.com/Masterminds/squirrel v1.5.4
Expand Down
6 changes: 3 additions & 3 deletions pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,12 +730,12 @@ func (d *Distributor) Push(ctx context.Context, req *cortexpb.WriteRequest) (*co
if errors.Is(err, ha.ReplicasNotMatchError{}) {
// These samples have been deduped.
d.dedupedSamples.WithLabelValues(userID, cluster).Add(float64(numFloatSamples + numHistogramSamples))
return nil, httpgrpc.Errorf(http.StatusAccepted, err.Error())
return nil, httpgrpc.Errorf(http.StatusAccepted, "%s", err.Error())
}

if errors.Is(err, ha.TooManyReplicaGroupsError{}) {
d.validateMetrics.DiscardedSamples.WithLabelValues(validation.TooManyHAClusters, userID).Add(float64(numFloatSamples + numHistogramSamples))
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

return nil, err
Expand Down Expand Up @@ -1053,7 +1053,7 @@ func (d *Distributor) prepareSeriesKeys(ctx context.Context, req *cortexpb.Write
if validationErr != nil && firstPartialErr == nil {
// The series labels may be retained by validationErr but that's not a problem for this
// use case because we format it calling Error() and then we discard it.
firstPartialErr = httpgrpc.Errorf(http.StatusBadRequest, validationErr.Error())
firstPartialErr = httpgrpc.Errorf(http.StatusBadRequest, "%s", validationErr.Error())
}

// validateSeries would have returned an emptyPreallocSeries if there were no valid samples.
Expand Down
8 changes: 4 additions & 4 deletions pkg/frontend/transport/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const (
)

var (
errCanceled = httpgrpc.Errorf(StatusClientClosedRequest, context.Canceled.Error())
errDeadlineExceeded = httpgrpc.Errorf(http.StatusGatewayTimeout, context.DeadlineExceeded.Error())
errRequestEntityTooLarge = httpgrpc.Errorf(http.StatusRequestEntityTooLarge, "http: request body too large")
errCanceled = httpgrpc.Errorf(StatusClientClosedRequest, "%s", context.Canceled.Error())
errDeadlineExceeded = httpgrpc.Errorf(http.StatusGatewayTimeout, "%s", context.DeadlineExceeded.Error())
errRequestEntityTooLarge = httpgrpc.Errorf(http.StatusRequestEntityTooLarge, "%s", "http: request body too large")
)

const (
Expand Down Expand Up @@ -279,7 +279,7 @@ func (f *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if resp.StatusCode/100 != 2 {
body, err2 := tripperware.BodyBuffer(resp, f.log)
if err2 == nil {
err = httpgrpc.Errorf(resp.StatusCode, string(body))
err = httpgrpc.Errorf(resp.StatusCode, "%s", string(body))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ func (i *Ingester) Push(ctx context.Context, req *cortexpb.WriteRequest) (*corte
i.stoppedMtx.RUnlock()

if err := db.acquireAppendLock(); err != nil {
return &cortexpb.WriteResponse{}, httpgrpc.Errorf(http.StatusServiceUnavailable, wrapWithUser(err, userID).Error())
return &cortexpb.WriteResponse{}, httpgrpc.Errorf(http.StatusServiceUnavailable, "%s", wrapWithUser(err, userID).Error())
}
defer db.releaseAppendLock()

Expand Down Expand Up @@ -1506,7 +1506,7 @@ func (i *Ingester) Push(ctx context.Context, req *cortexpb.WriteRequest) (*corte
code = ve.code
}
level.Debug(logutil.WithContext(ctx, i.logger)).Log("msg", "partial failures to push", "totalSamples", succeededSamplesCount+failedSamplesCount, "failedSamples", failedSamplesCount, "totalHistograms", succeededHistogramsCount+failedHistogramsCount, "failedHistograms", failedHistogramsCount, "firstPartialErr", firstPartialErr)
return &cortexpb.WriteResponse{}, httpgrpc.Errorf(code, wrapWithUser(firstPartialErr, userID).Error())
return &cortexpb.WriteResponse{}, httpgrpc.Errorf(code, "%s", wrapWithUser(firstPartialErr, userID).Error())
}

return &cortexpb.WriteResponse{}, nil
Expand Down
18 changes: 9 additions & 9 deletions pkg/ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ func TestIngester_Push(t *testing.T) {
},
cortexpb.API),
},
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, wrapWithUser(wrappedTSDBIngestErr(storage.ErrOutOfOrderSample, model.Time(9), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", wrapWithUser(wrappedTSDBIngestErr(storage.ErrOutOfOrderSample, model.Time(9), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedIngested: []cortexpb.TimeSeries{
{Labels: metricLabelAdapters, Samples: []cortexpb.Sample{{Value: 2, TimestampMs: 10}}},
},
Expand Down Expand Up @@ -1384,7 +1384,7 @@ func TestIngester_Push(t *testing.T) {
},
cortexpb.API),
},
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, wrapWithUser(wrappedTSDBIngestErr(storage.ErrOutOfBounds, model.Time(1575043969-(86400*1000)), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", wrapWithUser(wrappedTSDBIngestErr(storage.ErrOutOfBounds, model.Time(1575043969-(86400*1000)), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedIngested: []cortexpb.TimeSeries{
{Labels: metricLabelAdapters, Samples: []cortexpb.Sample{{Value: 2, TimestampMs: 1575043969}}},
},
Expand Down Expand Up @@ -1438,7 +1438,7 @@ func TestIngester_Push(t *testing.T) {
cortexpb.API),
},
oooTimeWindow: 5 * time.Minute,
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, wrapWithUser(wrappedTSDBIngestErr(storage.ErrTooOldSample, model.Time(1575043969-(600*1000)), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", wrapWithUser(wrappedTSDBIngestErr(storage.ErrTooOldSample, model.Time(1575043969-(600*1000)), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedIngested: []cortexpb.TimeSeries{
{Labels: metricLabelAdapters, Samples: []cortexpb.Sample{{Value: 2, TimestampMs: 1575043969}}},
},
Expand Down Expand Up @@ -1534,7 +1534,7 @@ func TestIngester_Push(t *testing.T) {
},
oooTimeWindow: 5 * time.Minute,
enableOOONativeHistograms: false,
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, wrapWithUser(wrappedTSDBIngestErr(storage.ErrOOONativeHistogramsDisabled, model.Time(1575043969-(10)), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", wrapWithUser(wrappedTSDBIngestErr(storage.ErrOOONativeHistogramsDisabled, model.Time(1575043969-(10)), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedIngested: []cortexpb.TimeSeries{
{Labels: metricLabelAdapters, Histograms: []cortexpb.Histogram{cortexpb.HistogramToHistogramProto(1575043969, tsdbutil.GenerateTestHistogram(1))}},
},
Expand Down Expand Up @@ -1593,7 +1593,7 @@ func TestIngester_Push(t *testing.T) {
},
oooTimeWindow: 5 * time.Minute,
enableOOONativeHistograms: true,
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, wrapWithUser(wrappedTSDBIngestErr(storage.ErrTooOldSample, model.Time(1575043969-(600*1000)), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", wrapWithUser(wrappedTSDBIngestErr(storage.ErrTooOldSample, model.Time(1575043969-(600*1000)), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedIngested: []cortexpb.TimeSeries{
{Labels: metricLabelAdapters, Histograms: []cortexpb.Histogram{cortexpb.HistogramToHistogramProto(1575043969, tsdbutil.GenerateTestHistogram(1))}},
},
Expand Down Expand Up @@ -1712,7 +1712,7 @@ func TestIngester_Push(t *testing.T) {
nil,
cortexpb.API),
},
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, wrapWithUser(wrappedTSDBIngestErr(storage.NewDuplicateFloatErr(1575043969, 2, 1), model.Time(1575043969), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", wrapWithUser(wrappedTSDBIngestErr(storage.NewDuplicateFloatErr(1575043969, 2, 1), model.Time(1575043969), cortexpb.FromLabelsToLabelAdapters(metricLabels)), userID).Error()),
expectedIngested: []cortexpb.TimeSeries{
{Labels: metricLabelAdapters, Samples: []cortexpb.Sample{{Value: 2, TimestampMs: 1575043969}}},
},
Expand Down Expand Up @@ -1766,7 +1766,7 @@ func TestIngester_Push(t *testing.T) {
},
},
},
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, wrapWithUser(wrappedTSDBIngestExemplarErr(errExemplarRef, model.Time(1000), cortexpb.FromLabelsToLabelAdapters(metricLabels), []cortexpb.LabelAdapter{{Name: "traceID", Value: "123"}}), userID).Error()),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", wrapWithUser(wrappedTSDBIngestExemplarErr(errExemplarRef, model.Time(1000), cortexpb.FromLabelsToLabelAdapters(metricLabels), []cortexpb.LabelAdapter{{Name: "traceID", Value: "123"}}), userID).Error()),
expectedIngested: nil,
expectedMetadataIngested: nil,
additionalMetrics: []string{
Expand Down Expand Up @@ -2260,7 +2260,7 @@ func TestIngester_PushNativeHistogramErrors(t *testing.T) {
req := cortexpb.ToWriteRequest([]labels.Labels{metricLabels}, nil, nil, tc.histograms, cortexpb.API)
// Push timeseries
_, err = i.Push(ctx, req)
assert.Equal(t, httpgrpc.Errorf(http.StatusBadRequest, wrapWithUser(wrappedTSDBIngestErr(tc.expectedErr, model.Time(10), metricLabelAdapters), userID).Error()), err)
assert.Equal(t, httpgrpc.Errorf(http.StatusBadRequest, "%s", wrapWithUser(wrappedTSDBIngestErr(tc.expectedErr, model.Time(10), metricLabelAdapters), userID).Error()), err)

require.Equal(t, testutil.ToFloat64(i.metrics.ingestedHistogramsFail), float64(1))
})
Expand Down Expand Up @@ -5557,7 +5557,7 @@ func TestIngesterPushErrorDuringForcedCompaction(t *testing.T) {
req, _ := mockWriteRequest(t, labels.Labels{{Name: labels.MetricName, Value: "test"}}, 0, util.TimeToMillis(time.Now()))
ctx := user.InjectOrgID(context.Background(), userID)
_, err = i.Push(ctx, req)
require.Equal(t, httpgrpc.Errorf(http.StatusServiceUnavailable, wrapWithUser(errors.New("forced compaction in progress"), userID).Error()), err)
require.Equal(t, httpgrpc.Errorf(http.StatusServiceUnavailable, "%s", wrapWithUser(errors.New("forced compaction in progress"), userID).Error()), err)

// Ingestion is successful after a flush.
require.True(t, db.casState(forceCompacting, active))
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/tripperware/instantquery/instant_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (instantQueryCodec) DecodeResponse(ctx context.Context, r *http.Response, _
return nil, err
}
if r.StatusCode/100 != 2 {
return nil, httpgrpc.Errorf(r.StatusCode, string(buf))
return nil, httpgrpc.Errorf(r.StatusCode, "%s", string(buf))
}

var resp tripperware.PrometheusResponse
Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/tripperware/instantquery/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ func (l limitsMiddleware) Do(ctx context.Context, r tripperware.Request) (trippe

tenantIDs, err := tenant.TenantIDs(ctx)
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

// Enforce the max query length.
if maxQueryLength := validation.SmallestPositiveNonZeroDurationPerTenant(tenantIDs, l.MaxQueryLength); maxQueryLength > 0 {
expr, err := parser.ParseExpr(r.GetQuery())
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

// Enforce query length across all selectors in the query.
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/tripperware/instantquery/limits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestLimitsMiddleware_MaxQueryLength(t *testing.T) {
"even though failed to parse expression, should return no error since request will pass to next middleware": {
query: `up[`,
maxQueryLength: thirtyDays,
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, parserErr.Error()).Error(),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", parserErr.Error()).Error(),
},
"should succeed on a query not exceeding time range": {
query: `up`,
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/tripperware/query_attribute_matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func rejectQueryOrSetPriority(r *http.Request, now time.Time, lookbackDelta time
query := r.FormValue("query")
expr, err := parser.ParseExpr(query)
if err != nil {
return httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}
minTime, maxTime := util.FindMinMaxTime(r, expr, lookbackDelta, now)

Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/tripperware/queryrange/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (l limitsMiddleware) Do(ctx context.Context, r tripperware.Request) (trippe

tenantIDs, err := tenant.TenantIDs(ctx)
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

// Clamp the time range based on the max query lookback.
Expand Down Expand Up @@ -84,7 +84,7 @@ func (l limitsMiddleware) Do(ctx context.Context, r tripperware.Request) (trippe

expr, err := parser.ParseExpr(r.GetQuery())
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

// Enforce query length across all selectors in the query.
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/tripperware/queryrange/limits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestLimitsMiddleware_MaxQueryLength(t *testing.T) {
reqStartTime: now.Add(-time.Hour),
reqEndTime: now,
maxQueryLength: thirtyDays,
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, parserErr.Error()).Error(),
expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "%s", parserErr.Error()).Error(),
},
"should succeed on a query on short time range, ending now": {
maxQueryLength: thirtyDays,
Expand Down
8 changes: 4 additions & 4 deletions pkg/querier/tripperware/queryrange/query_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ var (
SortMapKeys: true,
ValidateJsonRawMessage: false,
}.Froze()
errEndBeforeStart = httpgrpc.Errorf(http.StatusBadRequest, "end timestamp must not be before start time")
errNegativeStep = httpgrpc.Errorf(http.StatusBadRequest, "zero or negative query resolution step widths are not accepted. Try a positive integer")
errStepTooSmall = httpgrpc.Errorf(http.StatusBadRequest, "exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)")
errEndBeforeStart = httpgrpc.Errorf(http.StatusBadRequest, "%s", "end timestamp must not be before start time")
errNegativeStep = httpgrpc.Errorf(http.StatusBadRequest, "%s", "zero or negative query resolution step widths are not accepted. Try a positive integer")
errStepTooSmall = httpgrpc.Errorf(http.StatusBadRequest, "%s", "exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)")

// Name of the cache control header.
cacheControlHeader = "Cache-Control"
Expand Down Expand Up @@ -204,7 +204,7 @@ func (c prometheusCodec) DecodeResponse(ctx context.Context, r *http.Response, _
return nil, err
}
if r.StatusCode/100 != 2 {
return nil, httpgrpc.Errorf(r.StatusCode, string(buf))
return nil, httpgrpc.Errorf(r.StatusCode, "%s", string(buf))
}
log.LogFields(otlog.Int("bytes", len(buf)))

Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/tripperware/queryrange/results_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (s resultsCache) Do(ctx context.Context, r tripperware.Request) (tripperwar
tenantIDs, err := tenant.TenantIDs(ctx)
respWithStats := r.GetStats() != "" && s.cacheQueryableSamplesStats
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

// If cache_queryable_samples_stats is enabled we always need request the status upstream
Expand All @@ -241,7 +241,7 @@ func (s resultsCache) Do(ctx context.Context, r tripperware.Request) (tripperwar

key := s.splitter.GenerateCacheKey(ctx, tenant.JoinTenantIDs(tenantIDs), r)
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

var (
Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/tripperware/queryrange/split_by_interval.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func (s splitByInterval) Do(ctx context.Context, r tripperware.Request) (tripper
// to line up the boundaries with step.
interval, err := s.interval(ctx, r)
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}
reqs, err := splitQuery(r, interval)
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}
s.splitByCounter.Add(float64(len(reqs)))

Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/tripperware/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func NewQueryTripperware(
tenantIDs, err := tenant.TenantIDs(r.Context())
// This should never happen anyways because we have auth middleware before this.
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}
now := time.Now()
userStr := tenant.JoinTenantIDs(tenantIDs)
Expand Down Expand Up @@ -255,7 +255,7 @@ func (q roundTripper) Do(ctx context.Context, r Request) (Response, error) {
}

if err := user.InjectOrgIDIntoHTTPRequest(ctx, request); err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

response, err := q.next.RoundTrip(request)
Expand Down
Loading
Loading