From 91fabb0be07ca720dc8eb064c821115dd65eefba Mon Sep 17 00:00:00 2001 From: lshippy Date: Fri, 25 Aug 2023 09:01:55 -0700 Subject: [PATCH 1/3] Add userID to rate_limited log message --- modules/distributor/distributor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/distributor/distributor.go b/modules/distributor/distributor.go index 5360a5916ae..462c7bb09ba 100644 --- a/modules/distributor/distributor.go +++ b/modules/distributor/distributor.go @@ -272,7 +272,7 @@ func (d *Distributor) checkForRateLimits(tracesSize, spanCount int, userID strin if !d.ingestionRateLimiter.AllowN(now, userID, tracesSize) { overrides.RecordDiscardedSpans(spanCount, reasonRateLimited, userID) return status.Errorf(codes.ResourceExhausted, - "%s ingestion rate limit (%d bytes) exceeded while adding %d bytes", + "%s ingestion rate limit (%d bytes) exceeded while adding %d bytes for user %s", overrides.ErrorPrefixRateLimited, int(d.ingestionRateLimiter.Limit(now, userID)), tracesSize) From 616afa831a064df8a505d0230090782241e20227 Mon Sep 17 00:00:00 2001 From: lshippy Date: Fri, 25 Aug 2023 09:05:39 -0700 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6645e486bac..9d157785084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * [ENHANCEMENT] Tempo CLI command to convert from vParquet2 -> 3. [#2828](https://github.com/grafana/tempo/pull/2828) (@joe-elliott) * [ENHANCEMENT] Add `TempoUserConfigurableOverridesReloadFailing` alert [#2784](https://github.com/grafana/tempo/pull/2784) (@kvrhdn) * [ENHANCEMENT] Add RootSpanName and RootServiceName to log about discarded spans [#2816](https://github.com/grafana/tempo/pull/2816) (@marcinginszt) +* [ENHANCEMENT] Add `UserID` to log message about rate limiting [#2850](https://github.com/grafana/tempo/pull/2850) (@lshippy) * [BUGFIX] Fix panic in metrics summary api [#2738](https://github.com/grafana/tempo/pull/2738) (@mdisibio) * [BUGFIX] Fix node role auth IDMSv1 [#2760](https://github.com/grafana/tempo/pull/2760) (@coufalja) * [BUGFIX] Only search ingester blocks that fall within the request time range. [#2783](https://github.com/grafana/tempo/pull/2783) (@joe-elliott) From f2aac5485565f992ec4f520a7b40cd89f9ef6f72 Mon Sep 17 00:00:00 2001 From: lshippy Date: Fri, 25 Aug 2023 09:14:00 -0700 Subject: [PATCH 3/3] Adding userID parameter to parameter list --- modules/distributor/distributor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/distributor/distributor.go b/modules/distributor/distributor.go index 462c7bb09ba..27a304b9a20 100644 --- a/modules/distributor/distributor.go +++ b/modules/distributor/distributor.go @@ -275,7 +275,7 @@ func (d *Distributor) checkForRateLimits(tracesSize, spanCount int, userID strin "%s ingestion rate limit (%d bytes) exceeded while adding %d bytes for user %s", overrides.ErrorPrefixRateLimited, int(d.ingestionRateLimiter.Limit(now, userID)), - tracesSize) + tracesSize, userID) } return nil