Documentation ¶
Index ¶
- Constants
- type Limits
- type Overrides
- func (o *Overrides) BlockRetention(userID string) time.Duration
- func (o *Overrides) IngestionBurstSize(userID string) int
- func (o *Overrides) IngestionRateSpans(userID string) float64
- func (o *Overrides) IngestionRateStrategy() string
- func (o *Overrides) MaxGlobalTracesPerUser(userID string) int
- func (o *Overrides) MaxLocalTracesPerUser(userID string) int
- func (o *Overrides) MaxSpansPerTrace(userID string) int
- type TenantLimits
Constants ¶
const ( // LocalIngestionRateStrategy indicates that this limit can be evaluated in local terms only LocalIngestionRateStrategy = "local" // GlobalIngestionRateStrategy indicates that an attempt should be made to consider this limit across the entire Tempo cluster GlobalIngestionRateStrategy = "global" // 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 ErrorPrefixTraceTooLarge = "TRACE_TOO_LARGE:" // ErrorPrefixRateLimited is used to flag batches that have exceeded the spans/second of the tenant ErrorPrefixRateLimited = "RATE_LIMITED:" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limits ¶
type Limits struct { // Distributor enforced limits. IngestionRateStrategy string `yaml:"ingestion_rate_strategy"` IngestionRateSpans int `yaml:"ingestion_rate_limit"` IngestionBurstSize int `yaml:"ingestion_burst_size"` // Ingester enforced limits. MaxLocalTracesPerUser int `yaml:"max_traces_per_user"` MaxGlobalTracesPerUser int `yaml:"max_global_traces_per_user"` MaxSpansPerTrace int `yaml:"max_spans_per_trace"` // Compactor enforced limits. BlockRetention time.Duration `yaml:"block_retention"` // Config for overrides, convenient if it goes here. PerTenantOverrideConfig string `yaml:"per_tenant_override_config"` PerTenantOverridePeriod time.Duration `yaml:"per_tenant_override_period"` }
Limits describe all the limits for users; can be used to describe global default limits via flags, or per-user limits via yaml config.
func (*Limits) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet
type Overrides ¶
Overrides periodically fetch a set of per-user overrides, and provides convenience functions for fetching the correct value.
func NewOverrides ¶
NewOverrides makes a new Overrides. We store the supplied limits in a global variable to ensure per-tenant limits are defaulted to those values. As such, the last call to NewOverrides will become the new global defaults.
func (*Overrides) BlockRetention ¶ added in v0.6.0
func (*Overrides) IngestionBurstSize ¶ added in v0.5.0
IngestionBurstSize is the burst size in spans allowed for this tenant
func (*Overrides) IngestionRateSpans ¶
IngestionRateSpans is the number of spans per second allowed for this tenant
func (*Overrides) IngestionRateStrategy ¶
IngestionRateStrategy returns whether the ingestion rate limit should be individually applied to each distributor instance (local) or evenly shared across the cluster (global).
func (*Overrides) MaxGlobalTracesPerUser ¶
MaxGlobalTracesPerUser returns the maximum number of traces a user is allowed to store across the cluster.
func (*Overrides) MaxLocalTracesPerUser ¶
MaxLocalTracesPerUser returns the maximum number of traces a user is allowed to store in a single ingester.
func (*Overrides) MaxSpansPerTrace ¶
MaxSpansPerTrace returns the maximum number of spans a user can have in a live trace.
type TenantLimits ¶
TenantLimits is a function that returns limits for given tenant, or nil, if there are no tenant-specific limits.