Documentation
¶
Index ¶
- Constants
- type Config
- type Limits
- type ListToMap
- type Overrides
- func (o *Overrides) BlockRetention(tenantID string) time.Duration
- func (o *Overrides) Collect(ch chan<- prometheus.Metric)
- func (o *Overrides) Describe(ch chan<- *prometheus.Desc)
- func (o *Overrides) Forwarders(tenantID string) []string
- func (o *Overrides) IngestionBurstSizeBytes(tenantID string) int
- func (o *Overrides) IngestionRateLimitBytes(tenantID string) float64
- func (o *Overrides) IngestionRateStrategy() string
- func (o *Overrides) MaxBytesPerSnapshot(tenantID string) int
- func (o *Overrides) MaxBytesPerTagValuesQuery(tenantID string) int
- func (o *Overrides) MaxGlobalSnapshotsPerTenant(tenantID string) int
- func (o *Overrides) MaxLocalSnapshotsPerTenant(tenantID string) int
- func (o *Overrides) MaxSearchDuration(tenantID string) time.Duration
- func (o *Overrides) MetricsGeneratorCollectionInterval(tenantID string) time.Duration
- func (o *Overrides) MetricsGeneratorDisableCollection(tenantID string) bool
- func (o *Overrides) MetricsGeneratorForwarderQueueSize(tenantID string) int
- func (o *Overrides) MetricsGeneratorForwarderWorkers(tenantID string) int
- func (o *Overrides) MetricsGeneratorMaxActiveSeries(tenantID string) uint32
- func (o *Overrides) MetricsGeneratorProcessorServiceGraphsDimensions(tenantID string) []string
- func (o *Overrides) MetricsGeneratorProcessorServiceGraphsHistogramBuckets(tenantID string) []float64
- func (o *Overrides) MetricsGeneratorProcessorSpanMetricsDimensions(tenantID string) []string
- func (o *Overrides) MetricsGeneratorProcessorSpanMetricsHistogramBuckets(tenantID string) []float64
- func (o *Overrides) MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions(tenantID string) map[string]bool
- func (o *Overrides) MetricsGeneratorProcessors(tenantID string) map[string]struct{}
- func (o *Overrides) MetricsGeneratorRingSize(tenantID string) int
- func (o *Overrides) TenantIDs() []string
- func (o *Overrides) WriteStatusRuntimeConfig(w io.Writer, r *http.Request) error
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 Deep cluster
GlobalIngestionRateStrategy = "global"
// ErrorPrefixLiveSnapshotsExceeded is used to flag batches from the ingester that were rejected b/c they had too many snapshots
ErrorPrefixLiveSnapshotsExceeded = "LIVE_SNAPSHOTS_EXCEEDED:"
// ErrorPrefixSnapshotTooLarge is used to flag batches from the ingester that were rejected b/c they exceeded the single snapshot limit
ErrorPrefixSnapshotTooLarge = "SNAPSHOT_TOO_LARGE:"
// ErrorPrefixRateLimited is used to flag batches that have exceeded the snapshot/second of the tenant
ErrorPrefixRateLimited = "RATE_LIMITED:"
// metrics
MetricMaxLocalSnapshotsPerTenant = "max_local_snapshots_per_tenant"
MetricMaxGlobalSnapshotsPerTenant = "max_global_snapshots_per_tenant"
MetricMaxBytesPerSnapshot = "max_bytes_per_snapshot"
MetricMaxBytesPerTagValuesQuery = "max_bytes_per_tag_values_query"
MetricIngestionRateLimitBytes = "ingestion_rate_limit_bytes"
MetricIngestionBurstSizeBytes = "ingestion_burst_size_bytes"
MetricBlockRetention = "block_retention"
MetricMetricsGeneratorMaxActiveSeries = "metrics_generator_max_active_series"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
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"`
// Ingester enforced limits.
MaxLocalSnapshotsPerTenant int `yaml:"max_snapshots_per_tenant" json:"max_snapshots_per_tenant"`
MaxGlobalSnapshotsPerTenant int `yaml:"max_global_snapshots_per_tenant" json:"max_global_snapshots_per_tenant"`
// Forwarders
Forwarders []string `yaml:"forwarders" json:"forwarders"`
// 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"`
MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions map[string]bool `` /* 137-byte string literal not displayed */
// 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"`
// MaxBytesPerSnapshot is enforced in the Ingester, Compactor, Querier (Search) and Serverless (Search). It
// is not used when doing a snapshot by id lookup.
MaxBytesPerSnapshot int `yaml:"max_bytes_per_snapshot" json:"max_bytes_per_snapshot"`
// PerTenantOverrideConfig is the path to the per-tenant config
PerTenantOverrideConfig string `yaml:"per_tenant_override_config" json:"per_tenant_override_config"`
// PerTenantOverridePeriod the time between reloads of the override file
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) RegisterFlags ¶
func (l *Limits) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
type ListToMap ¶
type ListToMap map[string]struct{}
func (ListToMap) MarshalJSON ¶
func (l ListToMap) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshal interface of the json pkg.
func (ListToMap) MarshalYAML ¶
func (l ListToMap) MarshalYAML() (interface{}, error)
MarshalYAML implements the Marshal interface of the yaml pkg.
func (*ListToMap) UnmarshalJSON ¶
func (l *ListToMap) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the Unmarshal interface of the json pkg.
func (*ListToMap) UnmarshalYAML ¶
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 ¶
func (o *Overrides) BlockRetention(tenantID string) time.Duration
BlockRetention is the duration of the block retention for this tenant.
func (*Overrides) Forwarders ¶
func (o *Overrides) Forwarders(tenantID string) []string
Forwarders returns the list of forwarder IDs for a user.
func (*Overrides) IngestionBurstSizeBytes ¶
func (o *Overrides) IngestionBurstSizeBytes(tenantID string) int
IngestionBurstSizeBytes is the burst size in spans allowed for this tenant.
func (*Overrides) IngestionRateLimitBytes ¶
func (o *Overrides) IngestionRateLimitBytes(tenantID 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) MaxBytesPerSnapshot ¶
func (o *Overrides) MaxBytesPerSnapshot(tenantID string) int
MaxBytesPerSnapshot returns the maximum size of a single snapshot in bytes allowed for a user.
func (*Overrides) MaxBytesPerTagValuesQuery ¶
func (o *Overrides) MaxBytesPerTagValuesQuery(tenantID string) int
MaxBytesPerTagValuesQuery returns the maximum size of a response to a tag-values query allowed for a user.
func (*Overrides) MaxGlobalSnapshotsPerTenant ¶
func (o *Overrides) MaxGlobalSnapshotsPerTenant(tenantID string) int
MaxGlobalSnapshotsPerTenant returns the maximum number of snapshots a user is allowed to store across the cluster.
func (*Overrides) MaxLocalSnapshotsPerTenant ¶
func (o *Overrides) MaxLocalSnapshotsPerTenant(tenantID string) int
MaxLocalSnapshotsPerTenant returns the maximum number of snapshots a user is allowed to store in a single ingester.
func (*Overrides) MaxSearchDuration ¶
func (o *Overrides) MaxSearchDuration(tenantID string) time.Duration
MaxSearchDuration is the duration of the max search duration for this tenant.
func (*Overrides) MetricsGeneratorCollectionInterval ¶
func (o *Overrides) MetricsGeneratorCollectionInterval(tenantID string) time.Duration
MetricsGeneratorCollectionInterval is the collection interval of the metrics-generator registry for this tenant.
func (*Overrides) MetricsGeneratorDisableCollection ¶
func (o *Overrides) MetricsGeneratorDisableCollection(tenantID string) bool
MetricsGeneratorDisableCollection controls whether metrics are remote written for this tenant.
func (*Overrides) MetricsGeneratorForwarderQueueSize ¶
func (o *Overrides) MetricsGeneratorForwarderQueueSize(tenantID 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 ¶
func (o *Overrides) MetricsGeneratorForwarderWorkers(tenantID string) int
MetricsGeneratorForwarderWorkers is the number of workers to send metrics to the metrics-generator
func (*Overrides) MetricsGeneratorMaxActiveSeries ¶
func (o *Overrides) MetricsGeneratorMaxActiveSeries(tenantID 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 ¶
func (o *Overrides) MetricsGeneratorProcessorServiceGraphsDimensions(tenantID string) []string
MetricsGeneratorProcessorServiceGraphsDimensions controls the dimensions that are added to the service graphs processor.
func (*Overrides) MetricsGeneratorProcessorServiceGraphsHistogramBuckets ¶
func (o *Overrides) MetricsGeneratorProcessorServiceGraphsHistogramBuckets(tenantID string) []float64
MetricsGeneratorProcessorServiceGraphsHistogramBuckets controls the histogram buckets to be used by the service graphs processor.
func (*Overrides) MetricsGeneratorProcessorSpanMetricsDimensions ¶
func (o *Overrides) MetricsGeneratorProcessorSpanMetricsDimensions(tenantID string) []string
MetricsGeneratorProcessorSpanMetricsDimensions controls the dimensions that are added to the span metrics processor.
func (*Overrides) MetricsGeneratorProcessorSpanMetricsHistogramBuckets ¶
func (o *Overrides) MetricsGeneratorProcessorSpanMetricsHistogramBuckets(tenantID string) []float64
MetricsGeneratorProcessorSpanMetricsHistogramBuckets controls the histogram buckets to be used by the span metrics processor.
func (*Overrides) MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions ¶
func (o *Overrides) MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions(tenantID string) map[string]bool
MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions controls the intrinsic dimensions such as service, span_kind, or span_name that are activated or deactivated on the span metrics processor.
func (*Overrides) MetricsGeneratorProcessors ¶
func (o *Overrides) MetricsGeneratorProcessors(tenantID string) map[string]struct{}
MetricsGeneratorProcessors returns the metrics-generator processors enabled for this tenant.
func (*Overrides) MetricsGeneratorRingSize ¶
func (o *Overrides) MetricsGeneratorRingSize(tenantID 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) WriteStatusRuntimeConfig ¶
func (o *Overrides) WriteStatusRuntimeConfig(w io.Writer, r *http.Request) error