Skip to content

Commit 85424d0

Browse files
committed
fix unit for burst
1 parent 5c64d11 commit 85424d0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎modules/distributor/distributor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,12 @@ func (d *Distributor) checkForRateLimits(tracesSize, spanCount int, userID strin
393393
// batch size is too big if it's more than the limit and burst both
394394
if tracesSize > limit && tracesSize > burst {
395395
return status.Errorf(codes.ResourceExhausted,
396-
"%s: batch size (%d bytes) exceeds ingestion limit (local: %d bytes/s, global: %d bytes/s, burst: %d bytes/s) while adding %d bytes for user %s. Consider reducing batch size or increasing rate limit.",
396+
"%s: batch size (%d bytes) exceeds ingestion limit (local: %d bytes/s, global: %d bytes/s, burst: %d bytes) while adding %d bytes for user %s. consider reducing batch size or increasing rate limit.",
397397
overrides.ErrorPrefixRateLimited, tracesSize, limit, globalLimit, burst, tracesSize, userID)
398398
}
399399

400400
return status.Errorf(codes.ResourceExhausted,
401-
"%s: ingestion rate limit (local: %d bytes/s, global: %d bytes/s, burst: %d bytes/s) exceeded while adding %d bytes for user %s. Consider increasing the limit or reducing ingestion rate.",
401+
"%s: ingestion rate limit (local: %d bytes/s, global: %d bytes/s, burst: %d bytes) exceeded while adding %d bytes for user %s. consider increasing the limit or reducing ingestion rate.",
402402
overrides.ErrorPrefixRateLimited, limit, globalLimit, burst, tracesSize, userID)
403403
}
404404

‎modules/distributor/distributor_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,23 +2066,23 @@ func TestCheckForRateLimits(t *testing.T) {
20662066
tracesSize: 1100,
20672067
rateLimitBytes: 500,
20682068
burstLimitBytes: 500,
2069-
expectError: "RATE_LIMITED: batch size (1100 bytes) exceeds ingestion limit (local: 500 bytes/s, global: 0 bytes/s, burst: 500 bytes/s) while adding 1100 bytes for user test-user. Consider reducing batch size or increasing rate limit.",
2069+
expectError: "RATE_LIMITED: batch size (1100 bytes) exceeds ingestion limit (local: 500 bytes/s, global: 0 bytes/s, burst: 500 bytes) while adding 1100 bytes for user test-user. consider reducing batch size or increasing rate limit.",
20702070
errCode: codes.ResourceExhausted,
20712071
},
20722072
{
20732073
name: "size over rate limit and burst limit",
20742074
tracesSize: 1000,
20752075
rateLimitBytes: 500,
20762076
burstLimitBytes: 500,
2077-
expectError: "RATE_LIMITED: batch size (1000 bytes) exceeds ingestion limit (local: 500 bytes/s, global: 0 bytes/s, burst: 500 bytes/s) while adding 1000 bytes for user test-user. Consider reducing batch size or increasing rate limit.",
2077+
expectError: "RATE_LIMITED: batch size (1000 bytes) exceeds ingestion limit (local: 500 bytes/s, global: 0 bytes/s, burst: 500 bytes) while adding 1000 bytes for user test-user. consider reducing batch size or increasing rate limit.",
20782078
errCode: codes.ResourceExhausted,
20792079
},
20802080
{
20812081
name: "size exactly at rate limit but over the burst limit",
20822082
tracesSize: 500,
20832083
rateLimitBytes: 500,
20842084
burstLimitBytes: 200,
2085-
expectError: "RATE_LIMITED: ingestion rate limit (local: 500 bytes/s, global: 0 bytes/s, burst: 200 bytes/s) exceeded while adding 500 bytes for user test-user. Consider increasing the limit or reducing ingestion rate.",
2085+
expectError: "RATE_LIMITED: ingestion rate limit (local: 500 bytes/s, global: 0 bytes/s, burst: 200 bytes) exceeded while adding 500 bytes for user test-user. consider increasing the limit or reducing ingestion rate.",
20862086
errCode: codes.ResourceExhausted,
20872087
},
20882088
}

0 commit comments

Comments
 (0)