Documentation ¶
Index ¶
- Constants
- func AllTrueBooleansPerTenant(tenantIDs []string, f func(string) bool) bool
- func DiscardedExemplarsCounter(reg prometheus.Registerer, reason string) *prometheus.CounterVec
- func DiscardedMetadataCounter(reg prometheus.Registerer, reason string) *prometheus.CounterVec
- func DiscardedRequestsCounter(reg prometheus.Registerer, reason string) *prometheus.CounterVec
- func DiscardedSamplesCounter(reg prometheus.Registerer, reason string) *prometheus.CounterVec
- func GroupLabel(o *Overrides, userID string, timeseries []mimirpb.PreallocTimeseries) string
- func IsLimitError(err error) bool
- func MaxDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration
- func MinDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration
- func MustRegisterExtension[E interface{ ... }](name string) func(*Limits) E
- func SetDefaultLimitsForYAMLUnmarshalling(defaults Limits)
- func SmallestPositiveIntPerTenant(tenantIDs []string, f func(string) int) int
- func SmallestPositiveNonZeroDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration
- func SmallestPositiveNonZeroIntPerTenant(tenantIDs []string, f func(string) int) int
- func UserLimitsHandler(defaultLimits Limits, tenantLimits TenantLimits) http.HandlerFunc
- type BlockedQuery
- type LimitError
- type Limits
- type LimitsMap
- func (m LimitsMap[T]) Clone() LimitsMap[T]
- func (m LimitsMap[T]) Equal(other LimitsMap[T]) bool
- func (m LimitsMap[T]) IsInitialized() bool
- func (m LimitsMap[T]) MarshalYAML() (interface{}, error)
- func (m LimitsMap[T]) Read() map[string]T
- func (m LimitsMap[T]) Set(s string) error
- func (m LimitsMap[T]) String() string
- func (m LimitsMap[T]) UnmarshalYAML(value *yaml.Node) error
- type Overrides
- func (o *Overrides) AcceptHASamples(userID string) bool
- func (o *Overrides) ActiveSeriesCustomTrackersConfig(userID string) asmodel.CustomTrackersConfig
- func (o *Overrides) ActiveSeriesResultsMaxSizeBytes(userID string) int
- func (o *Overrides) AlertmanagerMaxAlertsCount(userID string) int
- func (o *Overrides) AlertmanagerMaxAlertsSizeBytes(userID string) int
- func (o *Overrides) AlertmanagerMaxConfigSize(userID string) int
- func (o *Overrides) AlertmanagerMaxDispatcherAggregationGroups(userID string) int
- func (o *Overrides) AlertmanagerMaxGrafanaConfigSize(userID string) int
- func (o *Overrides) AlertmanagerMaxGrafanaStateSize(userID string) int
- func (o *Overrides) AlertmanagerMaxSilenceSizeBytes(userID string) int
- func (o *Overrides) AlertmanagerMaxSilencesCount(userID string) int
- func (o *Overrides) AlertmanagerMaxTemplateSize(userID string) int
- func (o *Overrides) AlertmanagerMaxTemplatesCount(userID string) int
- func (o *Overrides) AlertmanagerReceiversBlockCIDRNetworks(user string) []flagext.CIDR
- func (o *Overrides) AlertmanagerReceiversBlockPrivateAddresses(user string) bool
- func (o *Overrides) AlignQueriesWithStep(userID string) bool
- func (o *Overrides) BlockedQueries(userID string) []*BlockedQuery
- func (o *Overrides) CardinalityAnalysisEnabled(userID string) bool
- func (o *Overrides) CompactorBlockUploadEnabled(tenantID string) bool
- func (o *Overrides) CompactorBlockUploadMaxBlockSizeBytes(userID string) int64
- func (o *Overrides) CompactorBlockUploadValidationEnabled(tenantID string) bool
- func (o *Overrides) CompactorBlockUploadVerifyChunks(tenantID string) bool
- func (o *Overrides) CompactorBlocksRetentionPeriod(userID string) time.Duration
- func (o *Overrides) CompactorInMemoryTenantMetaCacheSize(userID string) int
- func (o *Overrides) CompactorPartialBlockDeletionDelay(userID string) (delay time.Duration, valid bool)
- func (o *Overrides) CompactorSplitAndMergeShards(userID string) int
- func (o *Overrides) CompactorSplitGroups(userID string) int
- func (o *Overrides) CompactorTenantShardSize(userID string) int
- func (o *Overrides) CreationGracePeriod(userID string) time.Duration
- func (o *Overrides) DistributorIngestionArtificialDelay(tenantID string) time.Duration
- func (o *Overrides) DropLabels(userID string) flagext.StringSlice
- func (o *Overrides) EnabledPromQLExperimentalFunctions(userID string) []string
- func (o *Overrides) EnforceMetadataMetricName(userID string) bool
- func (o *Overrides) EvaluationDelay(userID string) time.Duration
- func (o *Overrides) HAClusterLabel(userID string) string
- func (o *Overrides) HAReplicaLabel(userID string) string
- func (o *Overrides) IgnoreOOOExemplars(userID string) bool
- func (o *Overrides) IngestStorageReadConsistency(userID string) string
- func (o *Overrides) IngestionBurstFactor(userID string) float64
- func (o *Overrides) IngestionBurstSize(userID string) int
- func (o *Overrides) IngestionPartitionsTenantShardSize(userID string) int
- func (o *Overrides) IngestionRate(userID string) float64
- func (o *Overrides) IngestionTenantShardSize(userID string) int
- func (o *Overrides) LabelNamesAndValuesResultsMaxSizeBytes(userID string) int
- func (o *Overrides) LabelValuesMaxCardinalityLabelNamesPerRequest(userID string) int
- func (o *Overrides) MaxCacheFreshness(userID string) time.Duration
- func (o *Overrides) MaxChunksPerQuery(userID string) int
- func (o *Overrides) MaxEstimatedChunksPerQuery(userID string) int
- func (o *Overrides) MaxEstimatedMemoryConsumptionPerQuery(userID string) uint64
- func (o *Overrides) MaxExemplarsPerSeriesPerRequest(userID string) int
- func (o *Overrides) MaxFetchedChunkBytesPerQuery(userID string) int
- func (o *Overrides) MaxFetchedSeriesPerQuery(userID string) int
- func (o *Overrides) MaxGlobalExemplarsPerUser(userID string) int
- func (o *Overrides) MaxGlobalMetadataPerMetric(userID string) int
- func (o *Overrides) MaxGlobalMetricsWithMetadataPerUser(userID string) int
- func (o *Overrides) MaxGlobalSeriesPerMetric(userID string) int
- func (o *Overrides) MaxGlobalSeriesPerUser(userID string) int
- func (o *Overrides) MaxHAClusters(user string) int
- func (o *Overrides) MaxLabelNameLength(userID string) int
- func (o *Overrides) MaxLabelNamesPerInfoSeries(userID string) int
- func (o *Overrides) MaxLabelNamesPerSeries(userID string) int
- func (o *Overrides) MaxLabelValueLength(userID string) int
- func (o *Overrides) MaxLabelsQueryLength(userID string) time.Duration
- func (o *Overrides) MaxMetadataLength(userID string) int
- func (o *Overrides) MaxNativeHistogramBuckets(userID string) int
- func (o *Overrides) MaxPartialQueryLength(userID string) time.Duration
- func (o *Overrides) MaxQueriersPerUser(userID string) int
- func (o *Overrides) MaxQueryExpressionSizeBytes(userID string) int
- func (o *Overrides) MaxQueryLookback(userID string) time.Duration
- func (o *Overrides) MaxQueryParallelism(userID string) int
- func (o *Overrides) MaxTotalQueryLength(userID string) time.Duration
- func (o *Overrides) MetricRelabelConfigs(userID string) []*relabel.Config
- func (o *Overrides) MetricRelabelingEnabled(userID string) bool
- func (o *Overrides) NativeHistogramsIngestionEnabled(userID string) bool
- func (o *Overrides) NotificationBurstSize(user string, integration string) int
- func (o *Overrides) NotificationRateLimit(user string, integration string) rate.Limit
- func (o *Overrides) OOONativeHistogramsIngestionEnabled(userID string) bool
- func (o *Overrides) OTelCreatedTimestampZeroIngestionEnabled(tenantID string) bool
- func (o *Overrides) OTelKeepIdentifyingResourceAttributes(tenantID string) bool
- func (o *Overrides) OTelMetricSuffixesEnabled(tenantID string) bool
- func (o *Overrides) OutOfOrderBlocksExternalLabelEnabled(userID string) bool
- func (o *Overrides) OutOfOrderTimeWindow(userID string) time.Duration
- func (o *Overrides) PastGracePeriod(userID string) time.Duration
- func (o *Overrides) PromoteOTelResourceAttributes(tenantID string) []string
- func (o *Overrides) QueryIngestersWithin(userID string) time.Duration
- func (o *Overrides) QueryShardingMaxRegexpSizeBytes(userID string) int
- func (o *Overrides) QueryShardingMaxShardedQueries(userID string) int
- func (o *Overrides) QueryShardingTotalShards(userID string) int
- func (o *Overrides) ReduceNativeHistogramOverMaxBuckets(userID string) bool
- func (o *Overrides) RequestBurstSize(userID string) int
- func (o *Overrides) RequestRate(userID string) float64
- func (o *Overrides) ResultsCacheForUnalignedQueryEnabled(userID string) bool
- func (o *Overrides) ResultsCacheTTL(user string) time.Duration
- func (o *Overrides) ResultsCacheTTLForCardinalityQuery(user string) time.Duration
- func (o *Overrides) ResultsCacheTTLForErrors(user string) time.Duration
- func (o *Overrides) ResultsCacheTTLForLabelsQuery(user string) time.Duration
- func (o *Overrides) ResultsCacheTTLForOutOfOrderTimeWindow(user string) time.Duration
- func (o *Overrides) RulerAlertingRulesEvaluationEnabled(userID string) bool
- func (o *Overrides) RulerMaxIndependentRuleEvaluationConcurrencyPerTenant(userID string) int64
- func (o *Overrides) RulerMaxRuleGroupsPerTenant(userID, namespace string) int
- func (o *Overrides) RulerMaxRulesPerRuleGroup(userID, namespace string) int
- func (o *Overrides) RulerProtectedNamespaces(userID string) []string
- func (o *Overrides) RulerRecordingRulesEvaluationEnabled(userID string) bool
- func (o *Overrides) RulerSyncRulesOnChangesEnabled(userID string) bool
- func (o *Overrides) RulerTenantShardSize(userID string) int
- func (o *Overrides) S3SSEKMSEncryptionContext(user string) string
- func (o *Overrides) S3SSEKMSKeyID(user string) string
- func (o *Overrides) S3SSEType(user string) string
- func (o *Overrides) SeparateMetricsGroupLabel(userID string) string
- func (o *Overrides) ServiceOverloadStatusCodeOnRateLimitEnabled(userID string) bool
- func (o *Overrides) SplitInstantQueriesByInterval(userID string) time.Duration
- func (o *Overrides) StoreGatewayTenantShardSize(userID string) int
- type TenantLimits
- type UserLimitsResponse
Constants ¶
const ( MaxSeriesPerMetricFlag = "ingester.max-global-series-per-metric" MaxMetadataPerMetricFlag = "ingester.max-global-metadata-per-metric" MaxSeriesPerUserFlag = "ingester.max-global-series-per-user" MaxMetadataPerUserFlag = "ingester.max-global-metadata-per-user" MaxChunksPerQueryFlag = "querier.max-fetched-chunks-per-query" MaxChunkBytesPerQueryFlag = "querier.max-fetched-chunk-bytes-per-query" MaxSeriesPerQueryFlag = "querier.max-fetched-series-per-query" MaxEstimatedChunksPerQueryMultiplierFlag = "querier.max-estimated-fetched-chunks-per-query-multiplier" MaxEstimatedMemoryConsumptionPerQueryFlag = "querier.max-estimated-memory-consumption-per-query" MaxLabelNamesPerSeriesFlag = "validation.max-label-names-per-series" MaxLabelNamesPerInfoSeriesFlag = "validation.max-label-names-per-info-series" MaxLabelNameLengthFlag = "validation.max-length-label-name" MaxLabelValueLengthFlag = "validation.max-length-label-value" MaxMetadataLengthFlag = "validation.max-metadata-length" ReduceNativeHistogramOverMaxBucketsFlag = "validation.reduce-native-histogram-over-max-buckets" CreationGracePeriodFlag = "validation.create-grace-period" PastGracePeriodFlag = "validation.past-grace-period" MaxPartialQueryLengthFlag = "querier.max-partial-query-length" MaxTotalQueryLengthFlag = "query-frontend.max-total-query-length" MaxQueryExpressionSizeBytesFlag = "query-frontend.max-query-expression-size-bytes" RequestRateFlag = "distributor.request-rate-limit" RequestBurstSizeFlag = "distributor.request-burst-size" IngestionRateFlag = "distributor.ingestion-rate-limit" IngestionBurstSizeFlag = "distributor.ingestion-burst-size" IngestionBurstFactorFlag = "distributor.ingestion-burst-factor" HATrackerMaxClustersFlag = "distributor.ha-tracker.max-clusters" QueryIngestersWithinFlag = "querier.query-ingesters-within" AlertmanagerMaxGrafanaConfigSizeFlag = "alertmanager.max-grafana-config-size-bytes" AlertmanagerMaxGrafanaStateSizeFlag = "alertmanager.max-grafana-state-size-bytes" // MinCompactorPartialBlockDeletionDelay is the minimum partial blocks deletion delay that can be configured in Mimir. MinCompactorPartialBlockDeletionDelay = 4 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func AllTrueBooleansPerTenant ¶
AllTrueBooleansPerTenant returns true only if limit func is true for all given tenants
func DiscardedExemplarsCounter ¶
func DiscardedExemplarsCounter(reg prometheus.Registerer, reason string) *prometheus.CounterVec
DiscardedExemplarsCounter creates per-user counter vector for exemplars discarded for a given reason.
func DiscardedMetadataCounter ¶
func DiscardedMetadataCounter(reg prometheus.Registerer, reason string) *prometheus.CounterVec
DiscardedMetadataCounter creates per-user counter vector for metadata discarded for a given reason.
func DiscardedRequestsCounter ¶
func DiscardedRequestsCounter(reg prometheus.Registerer, reason string) *prometheus.CounterVec
DiscardedRequestsCounter creates per-user counter vector for requests discarded for a given reason.
func DiscardedSamplesCounter ¶
func DiscardedSamplesCounter(reg prometheus.Registerer, reason string) *prometheus.CounterVec
DiscardedSamplesCounter creates per-user counter vector for samples discarded for a given reason.
func GroupLabel ¶
func GroupLabel(o *Overrides, userID string, timeseries []mimirpb.PreallocTimeseries) string
GroupLabel obtains the first non-empty group label from the first timeseries in the list of incoming timeseries.
func IsLimitError ¶
func MaxDurationPerTenant ¶
MaxDurationPerTenant is returning the maximum duration per tenant. Without tenants given it will return a time.Duration(0).
func MinDurationPerTenant ¶
MinDurationPerTenant is returning the minimum duration per tenant. Without tenants given it will return a time.Duration(0).
func MustRegisterExtension ¶
MustRegisterExtension registers the extensions type with given name and returns a function to get the extensions value from a *Limits instance.
The provided name will be used as YAML/JSON key to decode the extensions.
The returned getter will return the result of E.Default() if *Limits is nil.
This method is not thread safe and should be called only during package initialization. Registering same name twice, or registering a name that is already a *Limits JSON or YAML key will cause a panic.
func SetDefaultLimitsForYAMLUnmarshalling ¶
func SetDefaultLimitsForYAMLUnmarshalling(defaults Limits)
SetDefaultLimitsForYAMLUnmarshalling sets global default limits, used when loading Limits from YAML files. This is used to ensure per-tenant limits are defaulted to those values.
func SmallestPositiveIntPerTenant ¶
SmallestPositiveIntPerTenant is returning the minimal positive value of the supplied limit function for all given tenants.
func SmallestPositiveNonZeroDurationPerTenant ¶
func SmallestPositiveNonZeroDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration
SmallestPositiveNonZeroDurationPerTenant is returning the minimal positive and non-zero value of the supplied limit function for all given tenants. In many limits a value of 0 means unlimited so the method will return 0 only if all inputs have a limit of 0 or an empty tenant list is given.
func SmallestPositiveNonZeroIntPerTenant ¶
SmallestPositiveNonZeroIntPerTenant is returning the minimal positive and non-zero value of the supplied limit function for all given tenants. In many limits a value of 0 means unlimited so the method will return 0 only if all inputs have a limit of 0 or an empty tenant list is given.
func UserLimitsHandler ¶
func UserLimitsHandler(defaultLimits Limits, tenantLimits TenantLimits) http.HandlerFunc
UserLimitsHandler handles user limits.
Types ¶
type BlockedQuery ¶
type LimitError ¶
type LimitError interface { error // contains filtered or unexported methods }
LimitError is a marker interface for the errors that do not comply with the specified limits.
func NewLimitError ¶
func NewLimitError(msg string) LimitError
type Limits ¶
type Limits struct { // Distributor enforced limits. RequestRate float64 `yaml:"request_rate" json:"request_rate"` RequestBurstSize int `yaml:"request_burst_size" json:"request_burst_size"` IngestionRate float64 `yaml:"ingestion_rate" json:"ingestion_rate"` IngestionBurstSize int `yaml:"ingestion_burst_size" json:"ingestion_burst_size"` IngestionBurstFactor float64 `yaml:"ingestion_burst_factor" json:"ingestion_burst_factor" category:"experimental"` AcceptHASamples bool `yaml:"accept_ha_samples" json:"accept_ha_samples"` HAClusterLabel string `yaml:"ha_cluster_label" json:"ha_cluster_label"` HAReplicaLabel string `yaml:"ha_replica_label" json:"ha_replica_label"` HAMaxClusters int `yaml:"ha_max_clusters" json:"ha_max_clusters"` DropLabels flagext.StringSlice `yaml:"drop_labels" json:"drop_labels" category:"advanced"` MaxLabelNameLength int `yaml:"max_label_name_length" json:"max_label_name_length"` MaxLabelValueLength int `yaml:"max_label_value_length" json:"max_label_value_length"` MaxLabelNamesPerSeries int `yaml:"max_label_names_per_series" json:"max_label_names_per_series"` MaxLabelNamesPerInfoSeries int `yaml:"max_label_names_per_info_series" json:"max_label_names_per_info_series"` MaxMetadataLength int `yaml:"max_metadata_length" json:"max_metadata_length"` MaxNativeHistogramBuckets int `yaml:"max_native_histogram_buckets" json:"max_native_histogram_buckets"` MaxExemplarsPerSeriesPerRequest int `yaml:"max_exemplars_per_series_per_request" json:"max_exemplars_per_series_per_request" category:"experimental"` ReduceNativeHistogramOverMaxBuckets bool `yaml:"reduce_native_histogram_over_max_buckets" json:"reduce_native_histogram_over_max_buckets"` CreationGracePeriod model.Duration `yaml:"creation_grace_period" json:"creation_grace_period" category:"advanced"` PastGracePeriod model.Duration `yaml:"past_grace_period" json:"past_grace_period" category:"advanced"` EnforceMetadataMetricName bool `yaml:"enforce_metadata_metric_name" json:"enforce_metadata_metric_name" category:"advanced"` IngestionTenantShardSize int `yaml:"ingestion_tenant_shard_size" json:"ingestion_tenant_shard_size"` MetricRelabelConfigs []*relabel.Config `` /* 405-byte string literal not displayed */ MetricRelabelingEnabled bool `yaml:"metric_relabeling_enabled" json:"metric_relabeling_enabled" category:"experimental"` ServiceOverloadStatusCodeOnRateLimitEnabled bool `` /* 139-byte string literal not displayed */ IngestionArtificialDelay model.Duration `yaml:"ingestion_artificial_delay" json:"ingestion_artificial_delay" category:"experimental" doc:"hidden"` // Ingester enforced limits. // Series MaxGlobalSeriesPerUser int `yaml:"max_global_series_per_user" json:"max_global_series_per_user"` MaxGlobalSeriesPerMetric int `yaml:"max_global_series_per_metric" json:"max_global_series_per_metric"` // Metadata MaxGlobalMetricsWithMetadataPerUser int `yaml:"max_global_metadata_per_user" json:"max_global_metadata_per_user"` MaxGlobalMetadataPerMetric int `yaml:"max_global_metadata_per_metric" json:"max_global_metadata_per_metric"` // Exemplars MaxGlobalExemplarsPerUser int `yaml:"max_global_exemplars_per_user" json:"max_global_exemplars_per_user" category:"experimental"` IgnoreOOOExemplars bool `yaml:"ignore_ooo_exemplars" json:"ignore_ooo_exemplars" category:"experimental"` // Native histograms NativeHistogramsIngestionEnabled bool `yaml:"native_histograms_ingestion_enabled" json:"native_histograms_ingestion_enabled" category:"experimental"` // OOO native histograms OOONativeHistogramsIngestionEnabled bool `yaml:"ooo_native_histograms_ingestion_enabled" json:"ooo_native_histograms_ingestion_enabled" category:"experimental"` // Active series custom trackers ActiveSeriesCustomTrackersConfig asmodel.CustomTrackersConfig `` /* 400-byte string literal not displayed */ // Max allowed time window for out-of-order samples. OutOfOrderTimeWindow model.Duration `yaml:"out_of_order_time_window" json:"out_of_order_time_window" category:"experimental"` OutOfOrderBlocksExternalLabelEnabled bool `yaml:"out_of_order_blocks_external_label_enabled" json:"out_of_order_blocks_external_label_enabled" category:"experimental"` // User defined label to give the option of subdividing specific metrics by another label SeparateMetricsGroupLabel string `yaml:"separate_metrics_group_label" json:"separate_metrics_group_label" category:"experimental"` // Querier enforced limits. MaxChunksPerQuery int `yaml:"max_fetched_chunks_per_query" json:"max_fetched_chunks_per_query"` MaxEstimatedChunksPerQueryMultiplier float64 `` /* 137-byte string literal not displayed */ MaxFetchedSeriesPerQuery int `yaml:"max_fetched_series_per_query" json:"max_fetched_series_per_query"` MaxFetchedChunkBytesPerQuery int `yaml:"max_fetched_chunk_bytes_per_query" json:"max_fetched_chunk_bytes_per_query"` MaxEstimatedMemoryConsumptionPerQuery uint64 `yaml:"max_estimated_memory_consumption_per_query" json:"max_estimated_memory_consumption_per_query" category:"experimental"` MaxQueryLookback model.Duration `yaml:"max_query_lookback" json:"max_query_lookback"` MaxPartialQueryLength model.Duration `yaml:"max_partial_query_length" json:"max_partial_query_length"` MaxQueryParallelism int `yaml:"max_query_parallelism" json:"max_query_parallelism"` MaxLabelsQueryLength model.Duration `yaml:"max_labels_query_length" json:"max_labels_query_length"` MaxCacheFreshness model.Duration `yaml:"max_cache_freshness" json:"max_cache_freshness" category:"advanced"` MaxQueriersPerTenant int `yaml:"max_queriers_per_tenant" json:"max_queriers_per_tenant"` QueryShardingTotalShards int `yaml:"query_sharding_total_shards" json:"query_sharding_total_shards"` QueryShardingMaxShardedQueries int `yaml:"query_sharding_max_sharded_queries" json:"query_sharding_max_sharded_queries"` QueryShardingMaxRegexpSizeBytes int `yaml:"query_sharding_max_regexp_size_bytes" json:"query_sharding_max_regexp_size_bytes"` SplitInstantQueriesByInterval model.Duration `yaml:"split_instant_queries_by_interval" json:"split_instant_queries_by_interval" category:"experimental"` QueryIngestersWithin model.Duration `yaml:"query_ingesters_within" json:"query_ingesters_within" category:"advanced"` // Query-frontend limits. MaxTotalQueryLength model.Duration `yaml:"max_total_query_length" json:"max_total_query_length"` ResultsCacheTTL model.Duration `yaml:"results_cache_ttl" json:"results_cache_ttl"` ResultsCacheTTLForOutOfOrderTimeWindow model.Duration `yaml:"results_cache_ttl_for_out_of_order_time_window" json:"results_cache_ttl_for_out_of_order_time_window"` ResultsCacheTTLForCardinalityQuery model.Duration `yaml:"results_cache_ttl_for_cardinality_query" json:"results_cache_ttl_for_cardinality_query"` ResultsCacheTTLForLabelsQuery model.Duration `yaml:"results_cache_ttl_for_labels_query" json:"results_cache_ttl_for_labels_query"` ResultsCacheTTLForErrors model.Duration `yaml:"results_cache_ttl_for_errors" json:"results_cache_ttl_for_errors" category:"experimental"` ResultsCacheForUnalignedQueryEnabled bool `yaml:"cache_unaligned_requests" json:"cache_unaligned_requests" category:"advanced"` MaxQueryExpressionSizeBytes int `yaml:"max_query_expression_size_bytes" json:"max_query_expression_size_bytes"` BlockedQueries []*BlockedQuery `` /* 139-byte string literal not displayed */ AlignQueriesWithStep bool `yaml:"align_queries_with_step" json:"align_queries_with_step"` EnabledPromQLExperimentalFunctions flagext.StringSliceCSV `yaml:"enabled_promql_experimental_functions" json:"enabled_promql_experimental_functions" category:"experimental"` // Cardinality CardinalityAnalysisEnabled bool `yaml:"cardinality_analysis_enabled" json:"cardinality_analysis_enabled"` LabelNamesAndValuesResultsMaxSizeBytes int `yaml:"label_names_and_values_results_max_size_bytes" json:"label_names_and_values_results_max_size_bytes"` LabelValuesMaxCardinalityLabelNamesPerRequest int `yaml:"label_values_max_cardinality_label_names_per_request" json:"label_values_max_cardinality_label_names_per_request"` ActiveSeriesResultsMaxSizeBytes int `yaml:"active_series_results_max_size_bytes" json:"active_series_results_max_size_bytes" category:"experimental"` // Ruler defaults and limits. RulerEvaluationDelay model.Duration `yaml:"ruler_evaluation_delay_duration" json:"ruler_evaluation_delay_duration"` RulerTenantShardSize int `yaml:"ruler_tenant_shard_size" json:"ruler_tenant_shard_size"` RulerMaxRulesPerRuleGroup int `yaml:"ruler_max_rules_per_rule_group" json:"ruler_max_rules_per_rule_group"` RulerMaxRuleGroupsPerTenant int `yaml:"ruler_max_rule_groups_per_tenant" json:"ruler_max_rule_groups_per_tenant"` RulerRecordingRulesEvaluationEnabled bool `yaml:"ruler_recording_rules_evaluation_enabled" json:"ruler_recording_rules_evaluation_enabled"` RulerAlertingRulesEvaluationEnabled bool `yaml:"ruler_alerting_rules_evaluation_enabled" json:"ruler_alerting_rules_evaluation_enabled"` RulerSyncRulesOnChangesEnabled bool `yaml:"ruler_sync_rules_on_changes_enabled" json:"ruler_sync_rules_on_changes_enabled" category:"advanced"` RulerMaxRulesPerRuleGroupByNamespace LimitsMap[int] `yaml:"ruler_max_rules_per_rule_group_by_namespace" json:"ruler_max_rules_per_rule_group_by_namespace" category:"experimental"` RulerMaxRuleGroupsPerTenantByNamespace LimitsMap[int] `` /* 129-byte string literal not displayed */ RulerProtectedNamespaces flagext.StringSliceCSV `yaml:"ruler_protected_namespaces" json:"ruler_protected_namespaces" category:"experimental"` RulerMaxIndependentRuleEvaluationConcurrencyPerTenant int64 `` /* 159-byte string literal not displayed */ // Store-gateway. StoreGatewayTenantShardSize int `yaml:"store_gateway_tenant_shard_size" json:"store_gateway_tenant_shard_size"` // Compactor. CompactorBlocksRetentionPeriod model.Duration `yaml:"compactor_blocks_retention_period" json:"compactor_blocks_retention_period"` CompactorSplitAndMergeShards int `yaml:"compactor_split_and_merge_shards" json:"compactor_split_and_merge_shards"` CompactorSplitGroups int `yaml:"compactor_split_groups" json:"compactor_split_groups"` CompactorTenantShardSize int `yaml:"compactor_tenant_shard_size" json:"compactor_tenant_shard_size"` CompactorPartialBlockDeletionDelay model.Duration `yaml:"compactor_partial_block_deletion_delay" json:"compactor_partial_block_deletion_delay"` CompactorBlockUploadEnabled bool `yaml:"compactor_block_upload_enabled" json:"compactor_block_upload_enabled"` CompactorBlockUploadValidationEnabled bool `yaml:"compactor_block_upload_validation_enabled" json:"compactor_block_upload_validation_enabled"` CompactorBlockUploadVerifyChunks bool `yaml:"compactor_block_upload_verify_chunks" json:"compactor_block_upload_verify_chunks"` CompactorBlockUploadMaxBlockSizeBytes int64 `yaml:"compactor_block_upload_max_block_size_bytes" json:"compactor_block_upload_max_block_size_bytes" category:"advanced"` CompactorInMemoryTenantMetaCacheSize int `` /* 136-byte string literal not displayed */ // This config doesn't have a CLI flag registered here because they're registered in // their own original config struct. S3SSEType string `` /* 221-byte string literal not displayed */ S3SSEKMSKeyID string `` /* 156-byte string literal not displayed */ S3SSEKMSEncryptionContext string `` /* 284-byte string literal not displayed */ // Alertmanager. AlertmanagerReceiversBlockCIDRNetworks flagext.CIDRSliceCSV `yaml:"alertmanager_receivers_firewall_block_cidr_networks" json:"alertmanager_receivers_firewall_block_cidr_networks"` AlertmanagerReceiversBlockPrivateAddresses bool `yaml:"alertmanager_receivers_firewall_block_private_addresses" json:"alertmanager_receivers_firewall_block_private_addresses"` NotificationRateLimit float64 `yaml:"alertmanager_notification_rate_limit" json:"alertmanager_notification_rate_limit"` NotificationRateLimitPerIntegration LimitsMap[float64] `yaml:"alertmanager_notification_rate_limit_per_integration" json:"alertmanager_notification_rate_limit_per_integration"` AlertmanagerMaxGrafanaConfigSizeBytes flagext.Bytes `yaml:"alertmanager_max_grafana_config_size_bytes" json:"alertmanager_max_grafana_config_size_bytes"` AlertmanagerMaxConfigSizeBytes int `yaml:"alertmanager_max_config_size_bytes" json:"alertmanager_max_config_size_bytes"` AlertmanagerMaxGrafanaStateSizeBytes flagext.Bytes `yaml:"alertmanager_max_grafana_state_size_bytes" json:"alertmanager_max_grafana_state_size_bytes"` AlertmanagerMaxSilencesCount int `yaml:"alertmanager_max_silences_count" json:"alertmanager_max_silences_count"` AlertmanagerMaxSilenceSizeBytes int `yaml:"alertmanager_max_silence_size_bytes" json:"alertmanager_max_silence_size_bytes"` AlertmanagerMaxTemplatesCount int `yaml:"alertmanager_max_templates_count" json:"alertmanager_max_templates_count"` AlertmanagerMaxTemplateSizeBytes int `yaml:"alertmanager_max_template_size_bytes" json:"alertmanager_max_template_size_bytes"` AlertmanagerMaxDispatcherAggregationGroups int `yaml:"alertmanager_max_dispatcher_aggregation_groups" json:"alertmanager_max_dispatcher_aggregation_groups"` AlertmanagerMaxAlertsCount int `yaml:"alertmanager_max_alerts_count" json:"alertmanager_max_alerts_count"` AlertmanagerMaxAlertsSizeBytes int `yaml:"alertmanager_max_alerts_size_bytes" json:"alertmanager_max_alerts_size_bytes"` // OpenTelemetry OTelMetricSuffixesEnabled bool `yaml:"otel_metric_suffixes_enabled" json:"otel_metric_suffixes_enabled" category:"advanced"` OTelCreatedTimestampZeroIngestionEnabled bool `` /* 129-byte string literal not displayed */ PromoteOTelResourceAttributes flagext.StringSliceCSV `yaml:"promote_otel_resource_attributes" json:"promote_otel_resource_attributes" category:"experimental"` OTelKeepIdentifyingResourceAttributes bool `yaml:"otel_keep_identifying_resource_attributes" json:"otel_keep_identifying_resource_attributes" category:"experimental"` // Ingest storage. IngestStorageReadConsistency string `yaml:"ingest_storage_read_consistency" json:"ingest_storage_read_consistency" category:"experimental"` IngestionPartitionsTenantShardSize int `yaml:"ingestion_partitions_tenant_shard_size" json:"ingestion_partitions_tenant_shard_size" category:"experimental"` // contains filtered or unexported fields }
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 MockDefaultLimits ¶
func MockDefaultLimits() *Limits
func (*Limits) MarshalJSON ¶
func (*Limits) MarshalYAML ¶
func (*Limits) RegisterExtensionsDefaults ¶
func (l *Limits) RegisterExtensionsDefaults()
RegisterExtensionsDefaults registers the default values for extensions into l. This is especially handy for those downstream projects that wish to have control over the exact moment in which the registration happens (e.g. during service dependency initialization).
func (*Limits) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet
func (*Limits) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Limits) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type LimitsMap ¶
LimitsMap is a flag.Value implementation that looks like a generic map, holding float64s, ints, or strings as values.
func NewLimitsMap ¶
func NewLimitsMapWithData ¶
func NotificationRateLimitMap ¶
NotificationRateLimitMap returns a map that can be used as a flag for setting notification rate limits.
func (LimitsMap[T]) Equal ¶
Equal compares two LimitsMap. This is needed to allow cmp.Equal to compare two LimitsMap.
func (LimitsMap[T]) IsInitialized ¶
IsInitialized returns true if the map is initialized.
func (LimitsMap[T]) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler.
func (LimitsMap[T]) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.
type Overrides ¶
type Overrides struct {
// contains filtered or unexported fields
}
Overrides periodically fetch a set of per-user overrides, and provides convenience functions for fetching the correct value.
func MockDefaultOverrides ¶
func MockDefaultOverrides() *Overrides
func MockOverrides ¶
func NewOverrides ¶
func NewOverrides(defaults Limits, tenantLimits TenantLimits) (*Overrides, error)
NewOverrides makes a new Overrides.
func (*Overrides) AcceptHASamples ¶
AcceptHASamples returns whether the distributor should track and accept samples from HA replicas for this user.
func (*Overrides) ActiveSeriesCustomTrackersConfig ¶
func (o *Overrides) ActiveSeriesCustomTrackersConfig(userID string) asmodel.CustomTrackersConfig
func (*Overrides) ActiveSeriesResultsMaxSizeBytes ¶
func (*Overrides) AlertmanagerMaxAlertsCount ¶
func (*Overrides) AlertmanagerMaxAlertsSizeBytes ¶
func (*Overrides) AlertmanagerMaxConfigSize ¶
func (*Overrides) AlertmanagerMaxDispatcherAggregationGroups ¶
func (*Overrides) AlertmanagerMaxGrafanaConfigSize ¶
func (*Overrides) AlertmanagerMaxGrafanaStateSize ¶
func (*Overrides) AlertmanagerMaxSilenceSizeBytes ¶
func (*Overrides) AlertmanagerMaxSilencesCount ¶
func (*Overrides) AlertmanagerMaxTemplateSize ¶
func (*Overrides) AlertmanagerMaxTemplatesCount ¶
func (*Overrides) AlertmanagerReceiversBlockCIDRNetworks ¶
AlertmanagerReceiversBlockCIDRNetworks returns the list of network CIDRs that should be blocked in the Alertmanager receivers for the given user.
func (*Overrides) AlertmanagerReceiversBlockPrivateAddresses ¶
AlertmanagerReceiversBlockPrivateAddresses returns true if private addresses should be blocked in the Alertmanager receivers for the given user.
func (*Overrides) AlignQueriesWithStep ¶
func (*Overrides) BlockedQueries ¶
func (o *Overrides) BlockedQueries(userID string) []*BlockedQuery
BlockedQueries returns the blocked queries.
func (*Overrides) CardinalityAnalysisEnabled ¶
func (*Overrides) CompactorBlockUploadEnabled ¶
CompactorBlockUploadEnabled returns whether block upload is enabled for a certain tenant.
func (*Overrides) CompactorBlockUploadMaxBlockSizeBytes ¶
CompactorBlockUploadMaxBlockSizeBytes returns the maximum size in bytes of a block that is allowed to be uploaded or validated for a given user.
func (*Overrides) CompactorBlockUploadValidationEnabled ¶
CompactorBlockUploadValidationEnabled returns whether block upload validation is enabled for a certain tenant.
func (*Overrides) CompactorBlockUploadVerifyChunks ¶
CompactorBlockUploadVerifyChunks returns whether compaction chunk verification is enabled for a certain tenant.
func (*Overrides) CompactorBlocksRetentionPeriod ¶
CompactorBlocksRetentionPeriod returns the retention period for a given user.
func (*Overrides) CompactorInMemoryTenantMetaCacheSize ¶
func (*Overrides) CompactorPartialBlockDeletionDelay ¶
func (o *Overrides) CompactorPartialBlockDeletionDelay(userID string) (delay time.Duration, valid bool)
CompactorPartialBlockDeletionDelay returns the partial block deletion delay time period for a given user, and whether the configured value was valid. If the value wasn't valid, the returned delay is the default one and the caller is responsible to warn the Mimir operator about it.
func (*Overrides) CompactorSplitAndMergeShards ¶
CompactorSplitAndMergeShards returns the number of shards to use when splitting blocks.
func (*Overrides) CompactorSplitGroups ¶
CompactorSplitGroups returns the number of groups that blocks for splitting should be grouped into.
func (*Overrides) CompactorTenantShardSize ¶
CompactorTenantShardSize returns number of compactors that this user can use. 0 = all compactors.
func (*Overrides) CreationGracePeriod ¶
CreationGracePeriod is misnamed, and actually returns how far into the future we should accept samples.
func (*Overrides) DistributorIngestionArtificialDelay ¶
DistributorIngestionArtificialDelay returns the artificial ingestion latency for a given use.
func (*Overrides) DropLabels ¶
func (o *Overrides) DropLabels(userID string) flagext.StringSlice
DropLabels returns the list of labels to be dropped when ingesting HA samples for the user.
func (*Overrides) EnabledPromQLExperimentalFunctions ¶
func (*Overrides) EnforceMetadataMetricName ¶
EnforceMetadataMetricName whether to enforce the presence of a metric name on metadata.
func (*Overrides) EvaluationDelay ¶
EvaluationDelay returns the rules evaluation delay for a given user.
func (*Overrides) HAClusterLabel ¶
HAClusterLabel returns the cluster label to look for when deciding whether to accept a sample from a Prometheus HA replica.
func (*Overrides) HAReplicaLabel ¶
HAReplicaLabel returns the replica label to look for when deciding whether to accept a sample from a Prometheus HA replica.
func (*Overrides) IgnoreOOOExemplars ¶
IgnoreOOOExemplars returns whether to ignore out-of-order exemplars.
func (*Overrides) IngestStorageReadConsistency ¶
IngestStorageReadConsistency returns the default read consistency for the tenant.
func (*Overrides) IngestionBurstFactor ¶
func (*Overrides) IngestionBurstSize ¶
IngestionBurstSize returns the burst size for ingestion rate.
func (*Overrides) IngestionPartitionsTenantShardSize ¶
func (*Overrides) IngestionRate ¶
IngestionRate returns the limit on ingester rate (samples per second).
func (*Overrides) IngestionTenantShardSize ¶
IngestionTenantShardSize returns the ingesters shard size for a given user.
func (*Overrides) LabelNamesAndValuesResultsMaxSizeBytes ¶
LabelNamesAndValuesResultsMaxSizeBytes returns the maximum size in bytes of distinct label names and values
func (*Overrides) LabelValuesMaxCardinalityLabelNamesPerRequest ¶
LabelValuesMaxCardinalityLabelNamesPerRequest returns the maximum number of label names per cardinality request.
func (*Overrides) MaxCacheFreshness ¶
MaxCacheFreshness returns the period after which results are cacheable, to prevent caching of very recent results.
func (*Overrides) MaxChunksPerQuery ¶
func (*Overrides) MaxEstimatedChunksPerQuery ¶
func (*Overrides) MaxEstimatedMemoryConsumptionPerQuery ¶
MaxEstimatedMemoryConsumptionPerQuery returns the maximum allowed estimated memory consumption of a single query. This is only effective when using Mimir's query engine (not Prometheus' engine).
func (*Overrides) MaxExemplarsPerSeriesPerRequest ¶
func (*Overrides) MaxFetchedChunkBytesPerQuery ¶
MaxFetchedChunkBytesPerQuery returns the maximum number of bytes for chunks allowed per query when fetching chunks from ingesters and blocks storage.
func (*Overrides) MaxFetchedSeriesPerQuery ¶
MaxFetchedSeriesPerQuery returns the maximum number of series allowed per query when fetching chunks from ingesters and blocks storage.
func (*Overrides) MaxGlobalExemplarsPerUser ¶
MaxGlobalExemplarsPerUser returns the maximum number of exemplars held in memory across the cluster.
func (*Overrides) MaxGlobalMetadataPerMetric ¶
MaxGlobalMetadataPerMetric returns the maximum number of metadata allowed per metric across the cluster.
func (*Overrides) MaxGlobalMetricsWithMetadataPerUser ¶
MaxGlobalMetricsWithMetadataPerUser returns the maximum number of metrics with metadata a user is allowed to store across the cluster.
func (*Overrides) MaxGlobalSeriesPerMetric ¶
MaxGlobalSeriesPerMetric returns the maximum number of series allowed per metric across the cluster.
func (*Overrides) MaxGlobalSeriesPerUser ¶
MaxGlobalSeriesPerUser returns the maximum number of series a user is allowed to store across the cluster.
func (*Overrides) MaxHAClusters ¶
MaxHAClusters returns maximum number of clusters that HA tracker will track for a user.
func (*Overrides) MaxLabelNameLength ¶
MaxLabelNameLength returns maximum length a label name can be.
func (*Overrides) MaxLabelNamesPerInfoSeries ¶
MaxLabelNamesPerInfoSeries returns maximum number of label/value pairs for info timeseries.
func (*Overrides) MaxLabelNamesPerSeries ¶
MaxLabelNamesPerSeries returns maximum number of label/value pairs timeseries.
func (*Overrides) MaxLabelValueLength ¶
MaxLabelValueLength returns maximum length a label value can be. This also is the maximum length of a metric name.
func (*Overrides) MaxLabelsQueryLength ¶
MaxLabelsQueryLength returns the limit of the length (in time) of a label names or values request.
func (*Overrides) MaxMetadataLength ¶
MaxMetadataLength returns maximum length metadata can be. Metadata refers to the Metric Name, HELP and UNIT.
func (*Overrides) MaxNativeHistogramBuckets ¶
MaxNativeHistogramBuckets returns the maximum number of buckets per native histogram sample.
func (*Overrides) MaxPartialQueryLength ¶
MaxPartialQueryLength returns the limit of the length (in time) of a (partial) query.
func (*Overrides) MaxQueriersPerUser ¶
MaxQueriersPerUser returns the maximum number of queriers that can handle requests for this user.
func (*Overrides) MaxQueryExpressionSizeBytes ¶
MaxQueryExpressionSizeBytes returns the limit of the raw query size, in bytes.
func (*Overrides) MaxQueryLookback ¶
MaxQueryLookback returns the max lookback period of queries.
func (*Overrides) MaxQueryParallelism ¶
MaxQueryParallelism returns the limit to the number of split queries the frontend will process in parallel.
func (*Overrides) MaxTotalQueryLength ¶
MaxTotalQueryLength returns the limit of the total length (in time) of a query.
func (*Overrides) MetricRelabelConfigs ¶
MetricRelabelConfigs returns the metric relabel configs for a given user.
func (*Overrides) MetricRelabelingEnabled ¶
func (*Overrides) NativeHistogramsIngestionEnabled ¶
NativeHistogramsIngestionEnabled returns whether to ingest native histograms in the ingester
func (*Overrides) NotificationBurstSize ¶
func (*Overrides) NotificationRateLimit ¶
func (*Overrides) OOONativeHistogramsIngestionEnabled ¶
OOONativeHistogramsIngestionEnabled returns whether to ingest OOO native histograms in the ingester
func (*Overrides) OTelCreatedTimestampZeroIngestionEnabled ¶
func (*Overrides) OTelKeepIdentifyingResourceAttributes ¶
func (*Overrides) OTelMetricSuffixesEnabled ¶
func (*Overrides) OutOfOrderBlocksExternalLabelEnabled ¶
OutOfOrderBlocksExternalLabelEnabled returns if the shipper is flagging out-of-order blocks with an external label.
func (*Overrides) OutOfOrderTimeWindow ¶
OutOfOrderTimeWindow returns the out-of-order time window for the user.
func (*Overrides) PastGracePeriod ¶
PastGracePeriod is similar to CreationGracePeriod but looking into the past. Zero means disabled.
func (*Overrides) PromoteOTelResourceAttributes ¶
func (*Overrides) QueryIngestersWithin ¶
QueryIngestersWithin returns the maximum lookback beyond which queries are not sent to ingester. 0 means all queries are sent to ingester.
func (*Overrides) QueryShardingMaxRegexpSizeBytes ¶
QueryShardingMaxRegexpSizeBytes returns the limit to the max number of bytes allowed for a regexp matcher in a shardable query. If a query contains a regexp matcher longer than this limit, the query will not be sharded. 0 to disable limit.
func (*Overrides) QueryShardingMaxShardedQueries ¶
QueryShardingMaxShardedQueries returns the max number of sharded queries that can be run for a given received query. 0 to disable limit.
func (*Overrides) QueryShardingTotalShards ¶
QueryShardingTotalShards returns the total amount of shards to use when splitting queries via querysharding the frontend. When a query is shardable, each shards will be processed in parallel.
func (*Overrides) ReduceNativeHistogramOverMaxBuckets ¶
ReduceNativeHistogramOverMaxBuckets returns whether to reduce or reject native histogram samples with more buckets than the configured limit.
func (*Overrides) RequestBurstSize ¶
RequestBurstSize returns the burst size for request rate.
func (*Overrides) RequestRate ¶
RequestRate returns the limit on request rate (requests per second).
func (*Overrides) ResultsCacheForUnalignedQueryEnabled ¶
func (*Overrides) ResultsCacheTTLForCardinalityQuery ¶
func (*Overrides) ResultsCacheTTLForErrors ¶
func (*Overrides) ResultsCacheTTLForLabelsQuery ¶
func (*Overrides) ResultsCacheTTLForOutOfOrderTimeWindow ¶
func (*Overrides) RulerAlertingRulesEvaluationEnabled ¶
RulerAlertingRulesEvaluationEnabled returns whether the alerting rules evaluation is enabled for a given user.
func (*Overrides) RulerMaxIndependentRuleEvaluationConcurrencyPerTenant ¶
RulerMaxIndependentRuleEvaluationConcurrencyPerTenant returns the maximum number of independent rules that can run concurrently for a given user.
func (*Overrides) RulerMaxRuleGroupsPerTenant ¶
RulerMaxRuleGroupsPerTenant returns the maximum number of rule groups for a given user. This limit is special. Limits are returned in the following order: 1. Per tenant limit for the given namespace. 2. Default limit for the given namespace. 3. Per tenant limit set by RulerMaxRuleGroupsPerTenant 4. Default limit set by RulerMaxRuleGroupsPerTenant
func (*Overrides) RulerMaxRulesPerRuleGroup ¶
RulerMaxRulesPerRuleGroup returns the maximum number of rules per rule group for a given user. This limit is special. Limits are returned in the following order: 1. Per tenant limit for the given namespace. 2. Default limit for the given namespace. 3. Per tenant limit set by RulerMaxRulesPerRuleGroup 4. Default limit set by RulerMaxRulesPerRuleGroup
func (*Overrides) RulerProtectedNamespaces ¶
RulerProtectedNamespaces returns the list of namespaces that are protected from modification.
func (*Overrides) RulerRecordingRulesEvaluationEnabled ¶
RulerRecordingRulesEvaluationEnabled returns whether the recording rules evaluation is enabled for a given user.
func (*Overrides) RulerSyncRulesOnChangesEnabled ¶
RulerSyncRulesOnChangesEnabled returns whether the ruler's event-based sync is enabled.
func (*Overrides) RulerTenantShardSize ¶
RulerTenantShardSize returns shard size (number of rulers) used by this tenant when using shuffle-sharding strategy.
func (*Overrides) S3SSEKMSEncryptionContext ¶
S3SSEKMSEncryptionContext returns the per-tenant S3 KMS-SSE encryption context.
func (*Overrides) S3SSEKMSKeyID ¶
S3SSEKMSKeyID returns the per-tenant S3 KMS-SSE key id.
func (*Overrides) SeparateMetricsGroupLabel ¶
SeparateMetricsGroupLabel returns the custom label used to separate specific metrics
func (*Overrides) ServiceOverloadStatusCodeOnRateLimitEnabled ¶
ServiceOverloadStatusCodeOnRateLimitEnabled return whether the distributor uses status code 529 instead of 429 when the rate limit is exceeded.
func (*Overrides) SplitInstantQueriesByInterval ¶
SplitInstantQueriesByInterval returns the split time interval to use when splitting an instant query via the query-frontend. 0 to disable limit.
func (*Overrides) StoreGatewayTenantShardSize ¶
StoreGatewayTenantShardSize returns the store-gateway shard size for a given user.
type TenantLimits ¶
type TenantLimits interface { // ByUserID gets limits specific to a particular tenant or nil if there are none ByUserID(userID string) *Limits // AllByUserID gets a mapping of all tenant IDs and limits for that user AllByUserID() map[string]*Limits }
TenantLimits exposes per-tenant limit overrides to various resource usage limits
func NewMockTenantLimits ¶
func NewMockTenantLimits(limits map[string]*Limits) TenantLimits
NewMockTenantLimits creates a new mockTenantLimits that returns per-tenant limits based on the given map
type UserLimitsResponse ¶
type UserLimitsResponse struct { CompactorBlocksRetentionPeriod int64 `json:"compactor_blocks_retention_period_seconds"` // suffix with second to make it explicit the value is in seconds // Write path limits IngestionRate float64 `json:"ingestion_rate"` IngestionBurstSize int `json:"ingestion_burst_size"` IngestionBurstFactor float64 `json:"ingestion_burst_factor"` MaxGlobalSeriesPerUser int `json:"max_global_series_per_user"` MaxGlobalSeriesPerMetric int `json:"max_global_series_per_metric"` MaxGlobalExemplarsPerUser int `json:"max_global_exemplars_per_user"` // Read path limits MaxChunksPerQuery int `json:"max_fetched_chunks_per_query"` MaxFetchedSeriesPerQuery int `json:"max_fetched_series_per_query"` MaxFetchedChunkBytesPerQuery int `json:"max_fetched_chunk_bytes_per_query"` // Ruler limits RulerMaxRulesPerRuleGroup int `json:"ruler_max_rules_per_rule_group"` RulerMaxRuleGroupsPerTenant int `json:"ruler_max_rule_groups_per_tenant"` }