Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return rate limit error according to ingestion rate strategy #3485

Merged
merged 6 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
babo
  • Loading branch information
ie-pham committed Mar 14, 2024
commit 1a08ca3f0826f81b135823c657ce9442794619a7
3 changes: 0 additions & 3 deletions modules/overrides/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ const (
// GlobalIngestionRateStrategy indicates that an attempt should be made to consider this limit across the entire Tempo cluster
GlobalIngestionRateStrategy = "global"

// IngestionRateUser since ingestion rate strategy is not per tenant config
IngestionRateUserVariable = "ingestion rate strategy user variable"

// ErrorPrefixLiveTracesExceeded is used to flag batches from the ingester that were rejected b/c they had too many traces
ErrorPrefixLiveTracesExceeded = "LIVE_TRACES_EXCEEDED"
// ErrorPrefixTraceTooLarge is used to flag batches from the ingester that were rejected b/c they exceeded the single trace limit
Expand Down
6 changes: 3 additions & 3 deletions modules/overrides/runtime_config_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ func (o *runtimeConfigOverridesManager) GetRuntimeOverridesFor(userID string) *O
// to each distributor instance (local) or evenly shared across the cluster (global).
func (o *runtimeConfigOverridesManager) IngestionRateStrategy() string {
// The ingestion rate strategy can't be overridden on a per-tenant basis,
// so here we just pass this specific variable to fetch the defaults value.
return o.getOverridesForUser(IngestionRateUserVariable).Ingestion.RateStrategy
// so here we are returning the defaults overrides
return o.defaultLimits.Ingestion.RateStrategy
}

// MaxLocalTracesPerUser returns the maximum number of traces a user is allowed to store
Expand Down Expand Up @@ -484,7 +484,7 @@ func (o *runtimeConfigOverridesManager) DedicatedColumns(userID string) backend.
}

func (o *runtimeConfigOverridesManager) getOverridesForUser(userID string) *Overrides {
if tenantOverrides := o.tenantOverrides(); tenantOverrides != nil && userID != IngestionRateUserVariable {
if tenantOverrides := o.tenantOverrides(); tenantOverrides != nil {
l := tenantOverrides.forUser(userID)
if l != nil {
return l
Expand Down
Loading