Skip to content

Commit

Permalink
expose 429 errors for other causes beyond timestamp conflicts (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnyi authored May 10, 2024
2 parents 65d236e + 3fd1778 commit 74c2326
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions pkg/receive/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1240,11 +1240,6 @@ func (p *peerWorker) RemoteWriteAsync(ctx context.Context, req *storepb.WriteReq

tracing.DoInSpan(ctx, "receive_forward", func(ctx context.Context) {
_, err := storepb.NewWriteableStoreClient(p.cc).RemoteWrite(ctx, req)
if isConflict(err) && p.wp.Size() > 1 {
// conflict errors are valid in our dual scraping setup, worker pool size > 1 to bypass unit tests
// see original PR: https://github.com/databricks/thanos/pull/27
err = nil
}
responseWriter <- newWriteResponse(
seriesIDs,
errors.Wrapf(err, "forwarding request to endpoint %v", er.endpoint),
Expand Down
4 changes: 2 additions & 2 deletions pkg/receive/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func (r *Writer) Write(ctx context.Context, tenantID string, wreq *prompb.WriteR
case storage.ErrDuplicateSampleForTimestamp:
// we don't care about duplicated sample for the same timestamp
continue
// numSamplesDuplicates++
// level.Debug(tLogger).Log("msg", "Duplicate sample for timestamp", "lset", lset, "value", s.Value, "timestamp", s.Timestamp)
//numSamplesDuplicates++
//level.Debug(tLogger).Log("msg", "Duplicate sample for timestamp", "lset", lset, "value", s.Value, "timestamp", s.Timestamp)
case storage.ErrOutOfBounds:
numSamplesOutOfBounds++
level.Debug(tLogger).Log("msg", "Out of bounds metric", "lset", lset, "value", s.Value, "timestamp", s.Timestamp)
Expand Down

0 comments on commit 74c2326

Please sign in to comment.