Distributor: Add org_id to log error (#9475)

**What this PR does / why we need it**:
Add `org_id` to push error when the error is "max active streams limit
exceeded". Apparently all other push errors correctly report the
`org_id`, but not this one.

**Which issue(s) this PR fixes**:
N/A
is-this-qfs-cure
Dylan Guedes 2 years ago committed by GitHub
parent 306c96ce8a
commit 358b8965c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/ingester/instance.go
  2. 2
      pkg/validation/validate.go

@ -253,7 +253,7 @@ func (i *instance) createStream(pushReqStream logproto.Stream, record *wal.Recor
bytes += len(e.Line)
}
validation.DiscardedBytes.WithLabelValues(validation.StreamLimit, i.instanceID).Add(float64(bytes))
return nil, httpgrpc.Errorf(http.StatusTooManyRequests, validation.StreamLimitErrorMsg)
return nil, httpgrpc.Errorf(http.StatusTooManyRequests, validation.StreamLimitErrorMsg, i.instanceID)
}
labels, err := syntax.ParseLabels(pushReqStream.Labels)

@ -27,7 +27,7 @@ const (
// StreamLimit is a reason for discarding lines when we can't create a new stream
// because the limit of active streams has been reached.
StreamLimit = "stream_limit"
StreamLimitErrorMsg = "Maximum active stream limit exceeded, reduce the number of active streams (reduce labels or reduce label values), or contact your Loki administrator to see if the limit can be increased"
StreamLimitErrorMsg = "Maximum active stream limit exceeded, reduce the number of active streams (reduce labels or reduce label values), or contact your Loki administrator to see if the limit can be increased, user: '%s'"
// StreamRateLimit is a reason for discarding lines when the streams own rate limit is hit
// rather than the overall ingestion rate limit.
StreamRateLimit = "per_stream_rate_limit"

Loading…
Cancel
Save