overrides

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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:"

	// metrics
	MetricMaxLocalTracesPerUser     = "max_local_traces_per_user"
	MetricMaxGlobalTracesPerUser    = "max_global_traces_per_user"
	MetricMaxBytesPerTrace          = "max_bytes_per_trace"
	MetricMaxSearchBytesPerTrace    = "max_search_bytes_per_trace"
	MetricMaxBytesPerTagValuesQuery = "max_bytes_per_tag_values_query"
	MetricIngestionRateLimitBytes   = "ingestion_rate_limit_bytes"
	MetricIngestionBurstSizeBytes   = "ingestion_burst_size_bytes"
	MetricBlockRetention            = "block_retention"
)

Variables

This section is empty.

Functions

func RecordDiscardedSpans added in v1.4.0

func RecordDiscardedSpans(spansDiscarded int, reason string, tenant string)

Types

type Config added in v1.2.0

type Config struct {
	Defaults           *Limits            `yaml:"defaults"`
	PerTenantOverrides perTenantOverrides `yaml:",inline"`
}

Config is a struct used to print the complete runtime config (defaults + overrides)

type Limits

type Limits struct {
	// Distributor enforced limits.
	IngestionRateStrategy   string    `yaml:"ingestion_rate_strategy" json:"ingestion_rate_strategy"`
	IngestionRateLimitBytes int       `yaml:"ingestion_rate_limit_bytes" json:"ingestion_rate_limit_bytes"`
	IngestionBurstSizeBytes int       `yaml:"ingestion_burst_size_bytes" json:"ingestion_burst_size_bytes"`
	SearchTagsAllowList     ListToMap `yaml:"search_tags_allow_list" json:"search_tags_allow_list"`

	// Ingester enforced limits.
	MaxLocalTracesPerUser  int `yaml:"max_traces_per_user" json:"max_traces_per_user"`
	MaxGlobalTracesPerUser int `yaml:"max_global_traces_per_user" json:"max_global_traces_per_user"`
	MaxSearchBytesPerTrace int `yaml:"max_search_bytes_per_trace" json:"max_search_bytes_per_trace"`

	// Metrics-generator config
	MetricsGeneratorRingSize                               int           `yaml:"metrics_generator_ring_size" json:"metrics_generator_ring_size"`
	MetricsGeneratorProcessors                             ListToMap     `yaml:"metrics_generator_processors" json:"metrics_generator_processors"`
	MetricsGeneratorMaxActiveSeries                        uint32        `yaml:"metrics_generator_max_active_series" json:"metrics_generator_max_active_series"`
	MetricsGeneratorCollectionInterval                     time.Duration `yaml:"metrics_generator_collection_interval" json:"metrics_generator_collection_interval"`
	MetricsGeneratorDisableCollection                      bool          `yaml:"metrics_generator_disable_collection" json:"metrics_generator_disable_collection"`
	MetricsGeneratorForwarderQueueSize                     int           `yaml:"metrics_generator_forwarder_queue_size" json:"metrics_generator_forwarder_queue_size"`
	MetricsGeneratorForwarderWorkers                       int           `yaml:"metrics_generator_forwarder_workers" json:"metrics_generator_forwarder_workers"`
	MetricsGeneratorProcessorServiceGraphsHistogramBuckets []float64     `` /* 135-byte string literal not displayed */
	MetricsGeneratorProcessorServiceGraphsDimensions       []string      `yaml:"metrics_generator_processor_service_graphs_dimensions" json:"metrics_generator_processor_service_graphs_dimensions"`
	MetricsGeneratorProcessorSpanMetricsHistogramBuckets   []float64     `` /* 131-byte string literal not displayed */
	MetricsGeneratorProcessorSpanMetricsDimensions         []string      `yaml:"metrics_generator_processor_span_metrics_dimensions" json:"metrics_generator_processor_span_metrics_dimensions"`

	// Compactor enforced limits.
	BlockRetention model.Duration `yaml:"block_retention" json:"block_retention"`

	// Querier and Ingester enforced limits.
	MaxBytesPerTagValuesQuery int `yaml:"max_bytes_per_tag_values_query" json:"max_bytes_per_tag_values_query"`

	// QueryFrontend enforced limits
	MaxSearchDuration model.Duration `yaml:"max_search_duration" json:"max_search_duration"`

	// MaxBytesPerTrace is enforced in the Ingester, Compactor, Querier (Search) and Serverless (Search). It
	//  is not used when doing a trace by id lookup.
	MaxBytesPerTrace int `yaml:"max_bytes_per_trace" json:"max_bytes_per_trace"`

	// Configuration for overrides, convenient if it goes here.
	PerTenantOverrideConfig string         `yaml:"per_tenant_override_config" json:"per_tenant_override_config"`
	PerTenantOverridePeriod model.Duration `yaml:"per_tenant_override_period" json:"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) Collect added in v1.3.0

func (l *Limits) Collect(ch chan<- prometheus.Metric)

func (*Limits) Describe added in v1.3.0

func (l *Limits) Describe(ch chan<- *prometheus.Desc)

func (*Limits) RegisterFlags

func (l *Limits) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

type ListToMap added in v1.2.0

type ListToMap map[string]struct{}

func (*ListToMap) GetMap added in v1.2.0

func (l *ListToMap) GetMap() map[string]struct{}

func (ListToMap) MarshalJSON added in v1.2.0

func (l ListToMap) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshal interface of the json pkg.

func (ListToMap) MarshalYAML added in v1.2.0

func (l ListToMap) MarshalYAML() (interface{}, error)

MarshalYAML implements the Marshal interface of the yaml pkg.

func (*ListToMap) UnmarshalJSON added in v1.2.0

func (l *ListToMap) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the Unmarshal interface of the json pkg.

func (*ListToMap) UnmarshalYAML added in v1.2.0

func (l *ListToMap) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface of the yaml pkg.

type Overrides

type Overrides struct {
	services.Service
	// contains filtered or unexported fields
}

Overrides periodically fetch a set of per-user overrides, and provides convenience functions for fetching the correct value.

func NewOverrides

func NewOverrides(defaults Limits) (*Overrides, error)

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 (o *Overrides) BlockRetention(userID string) time.Duration

BlockRetention is the duration of the block retention for this tenant.

func (*Overrides) Collect added in v1.3.0

func (o *Overrides) Collect(ch chan<- prometheus.Metric)

func (*Overrides) Describe added in v1.3.0

func (o *Overrides) Describe(ch chan<- *prometheus.Desc)

func (*Overrides) IngestionBurstSizeBytes added in v0.7.0

func (o *Overrides) IngestionBurstSizeBytes(userID string) int

IngestionBurstSizeBytes is the burst size in spans allowed for this tenant.

func (*Overrides) IngestionRateLimitBytes added in v0.7.0

func (o *Overrides) IngestionRateLimitBytes(userID string) float64

IngestionRateLimitBytes is the number of spans per second allowed for this tenant.

func (*Overrides) IngestionRateStrategy

func (o *Overrides) IngestionRateStrategy() string

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) MaxBytesPerTagValuesQuery added in v1.3.0

func (o *Overrides) MaxBytesPerTagValuesQuery(userID string) int

MaxBytesPerTagValuesQuery returns the maximum size of a response to a tag-values query allowed for a user.

func (*Overrides) MaxBytesPerTrace added in v0.7.0

func (o *Overrides) MaxBytesPerTrace(userID string) int

MaxBytesPerTrace returns the maximum size of a single trace in bytes allowed for a user.

func (*Overrides) MaxGlobalTracesPerUser

func (o *Overrides) MaxGlobalTracesPerUser(userID string) int

MaxGlobalTracesPerUser returns the maximum number of traces a user is allowed to store across the cluster.

func (*Overrides) MaxLocalTracesPerUser

func (o *Overrides) MaxLocalTracesPerUser(userID string) int

MaxLocalTracesPerUser returns the maximum number of traces a user is allowed to store in a single ingester.

func (*Overrides) MaxSearchBytesPerTrace added in v1.2.0

func (o *Overrides) MaxSearchBytesPerTrace(userID string) int

MaxSearchBytesPerTrace returns the maximum size of search data for trace (in bytes) allowed for a user.

func (*Overrides) MaxSearchDuration added in v1.5.0

func (o *Overrides) MaxSearchDuration(userID string) time.Duration

MaxSearchDuration is the duration of the max search duration for this tenant.

func (*Overrides) MetricsGeneratorCollectionInterval added in v1.4.0

func (o *Overrides) MetricsGeneratorCollectionInterval(userID string) time.Duration

MetricsGeneratorCollectionInterval is the collection interval of the metrics-generator registry for this tenant.

func (*Overrides) MetricsGeneratorDisableCollection added in v1.4.0

func (o *Overrides) MetricsGeneratorDisableCollection(userID string) bool

MetricsGeneratorDisableCollection controls whether metrics are remote written for this tenant.

func (*Overrides) MetricsGeneratorForwarderQueueSize added in v1.4.0

func (o *Overrides) MetricsGeneratorForwarderQueueSize(userID string) int

MetricsGeneratorForwarderQueueSize is the size of the buffer of requests to send to the metrics-generator from the distributor for this tenant.

func (*Overrides) MetricsGeneratorForwarderWorkers added in v1.4.0

func (o *Overrides) MetricsGeneratorForwarderWorkers(userID string) int

MetricsGeneratorForwarderWorkers is the number of workers to send metrics to the metrics-generator

func (*Overrides) MetricsGeneratorMaxActiveSeries added in v1.4.0

func (o *Overrides) MetricsGeneratorMaxActiveSeries(userID string) uint32

MetricsGeneratorMaxActiveSeries is the maximum amount of active series in the metrics-generator registry for this tenant. Note this is a local limit enforced in every instance separately.

func (*Overrides) MetricsGeneratorProcessorServiceGraphsDimensions added in v1.5.0

func (o *Overrides) MetricsGeneratorProcessorServiceGraphsDimensions(userID string) []string

MetricsGeneratorProcessorServiceGraphsDimensions controls the dimensions that are added to the service graphs processor.

func (*Overrides) MetricsGeneratorProcessorServiceGraphsHistogramBuckets added in v1.5.0

func (o *Overrides) MetricsGeneratorProcessorServiceGraphsHistogramBuckets(userID string) []float64

MetricsGeneratorProcessorServiceGraphsHistogramBuckets controls the histogram buckets to be used by the service graphs processor.

func (*Overrides) MetricsGeneratorProcessorSpanMetricsDimensions added in v1.5.0

func (o *Overrides) MetricsGeneratorProcessorSpanMetricsDimensions(userID string) []string

MetricsGeneratorProcessorSpanMetricsDimensions controls the dimensions that are added to the span metrics processor.

func (*Overrides) MetricsGeneratorProcessorSpanMetricsHistogramBuckets added in v1.5.0

func (o *Overrides) MetricsGeneratorProcessorSpanMetricsHistogramBuckets(userID string) []float64

MetricsGeneratorProcessorSpanMetricsHistogramBuckets controls the histogram buckets to be used by the span metrics processor.

func (*Overrides) MetricsGeneratorProcessors added in v1.4.0

func (o *Overrides) MetricsGeneratorProcessors(userID string) map[string]struct{}

MetricsGeneratorProcessors returns the metrics-generator processors enabled for this tenant.

func (*Overrides) MetricsGeneratorRingSize added in v1.4.0

func (o *Overrides) MetricsGeneratorRingSize(userID string) int

MetricsGeneratorRingSize is the desired size of the metrics-generator ring for this tenant. Using shuffle sharding, a tenant can use a smaller ring than the entire ring.

func (*Overrides) SearchTagsAllowList added in v1.2.0

func (o *Overrides) SearchTagsAllowList(userID string) map[string]struct{}

SearchTagsAllowList is the list of tags to be extracted for search, for this tenant.

func (*Overrides) WriteStatusRuntimeConfig added in v1.2.0

func (o *Overrides) WriteStatusRuntimeConfig(w io.Writer, r *http.Request) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL