Files
Marioandzeekay 32b4585911 Support per-tenant left-padding of trace IDs (#6489)
* Support per-tenant left-padding of trace IDs

* Update docs

* chlog
2026-02-22 00:55:25 -08:00

296 lines
25 KiB
Go

package overrides
import (
"time"
"github.com/grafana/tempo/modules/overrides/histograms"
"github.com/grafana/tempo/pkg/util/listtomap"
"github.com/grafana/tempo/tempodb/backend"
"github.com/prometheus/common/model"
"github.com/grafana/tempo/pkg/sharedconfig"
filterconfig "github.com/grafana/tempo/pkg/spanfilter/config"
)
func (c *Overrides) toLegacy() LegacyOverrides {
return LegacyOverrides{
IngestionRateStrategy: c.Ingestion.RateStrategy,
IngestionRateLimitBytes: c.Ingestion.RateLimitBytes,
IngestionBurstSizeBytes: c.Ingestion.BurstSizeBytes,
IngestionTenantShardSize: c.Ingestion.TenantShardSize,
MaxLocalTracesPerUser: c.Ingestion.MaxLocalTracesPerUser,
MaxGlobalTracesPerUser: c.Ingestion.MaxGlobalTracesPerUser,
IngestionMaxAttributeBytes: c.Ingestion.MaxAttributeBytes,
IngestionArtificialDelay: c.Ingestion.ArtificialDelay,
IngestionRetryInfoEnabled: c.Ingestion.RetryInfoEnabled,
Forwarders: c.Forwarders,
MetricsGeneratorRingSize: c.MetricsGenerator.RingSize,
MetricsGeneratorProcessors: c.MetricsGenerator.Processors,
MetricsGeneratorMaxActiveSeries: c.MetricsGenerator.MaxActiveSeries,
MetricsGeneratorMaxActiveEntities: c.MetricsGenerator.MaxActiveEntities,
MetricsGeneratorCollectionInterval: c.MetricsGenerator.CollectionInterval,
MetricsGeneratorDisableCollection: c.MetricsGenerator.DisableCollection,
MetricsGeneratorGenerateNativeHistograms: c.MetricsGenerator.GenerateNativeHistograms,
MetricsGeneratorTraceIDLabelName: c.MetricsGenerator.TraceIDLabelName,
MetricsGeneratorRemoteWriteHeaders: c.MetricsGenerator.RemoteWriteHeaders,
MetricsGeneratorForwarderQueueSize: c.MetricsGenerator.Forwarder.QueueSize,
MetricsGeneratorForwarderWorkers: c.MetricsGenerator.Forwarder.Workers,
MetricsGeneratorProcessorServiceGraphsHistogramBuckets: c.MetricsGenerator.Processor.ServiceGraphs.HistogramBuckets,
MetricsGeneratorProcessorServiceGraphsDimensions: c.MetricsGenerator.Processor.ServiceGraphs.Dimensions,
MetricsGeneratorProcessorServiceGraphsPeerAttributes: c.MetricsGenerator.Processor.ServiceGraphs.PeerAttributes,
MetricsGeneratorProcessorServiceGraphsFilterPolicies: c.MetricsGenerator.Processor.ServiceGraphs.FilterPolicies,
MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix: c.MetricsGenerator.Processor.ServiceGraphs.EnableClientServerPrefix,
MetricsGeneratorProcessorServiceGraphsEnableMessagingSystemLatencyHistogram: c.MetricsGenerator.Processor.ServiceGraphs.EnableMessagingSystemLatencyHistogram,
MetricsGeneratorProcessorServiceGraphsEnableVirtualNodeLabel: c.MetricsGenerator.Processor.ServiceGraphs.EnableVirtualNodeLabel,
MetricsGeneratorProcessorServiceGraphsSpanMultiplierKey: c.MetricsGenerator.Processor.ServiceGraphs.SpanMultiplierKey,
MetricsGeneratorProcessorSpanMetricsHistogramBuckets: c.MetricsGenerator.Processor.SpanMetrics.HistogramBuckets,
MetricsGeneratorProcessorSpanMetricsDimensions: c.MetricsGenerator.Processor.SpanMetrics.Dimensions,
MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions: c.MetricsGenerator.Processor.SpanMetrics.IntrinsicDimensions,
MetricsGeneratorProcessorSpanMetricsFilterPolicies: c.MetricsGenerator.Processor.SpanMetrics.FilterPolicies,
MetricsGeneratorProcessorSpanMetricsDimensionMappings: c.MetricsGenerator.Processor.SpanMetrics.DimensionMappings,
MetricsGeneratorProcessorSpanMetricsEnableTargetInfo: c.MetricsGenerator.Processor.SpanMetrics.EnableTargetInfo,
MetricsGeneratorProcessorSpanMetricsTargetInfoExcludedDimensions: c.MetricsGenerator.Processor.SpanMetrics.TargetInfoExcludedDimensions,
MetricsGeneratorProcessorSpanMetricsEnableInstanceLabel: c.MetricsGenerator.Processor.SpanMetrics.EnableInstanceLabel,
MetricsGeneratorProcessorSpanMetricsSpanMultiplierKey: c.MetricsGenerator.Processor.SpanMetrics.SpanMultiplierKey,
MetricsGeneratorProcessorLocalBlocksMaxLiveTraces: c.MetricsGenerator.Processor.LocalBlocks.MaxLiveTraces,
MetricsGeneratorProcessorLocalBlocksMaxBlockDuration: c.MetricsGenerator.Processor.LocalBlocks.MaxBlockDuration,
MetricsGeneratorProcessorLocalBlocksMaxBlockBytes: c.MetricsGenerator.Processor.LocalBlocks.MaxBlockBytes,
MetricsGeneratorProcessorLocalBlocksFlushCheckPeriod: c.MetricsGenerator.Processor.LocalBlocks.FlushCheckPeriod,
MetricsGeneratorProcessorLocalBlocksTraceIdlePeriod: c.MetricsGenerator.Processor.LocalBlocks.TraceIdlePeriod,
MetricsGeneratorProcessorLocalBlocksCompleteBlockTimeout: c.MetricsGenerator.Processor.LocalBlocks.CompleteBlockTimeout,
MetricsGeneratorProcessorHostInfoHostIdentifiers: c.MetricsGenerator.Processor.HostInfo.HostIdentifiers,
MetricsGeneratorProcessorHostInfoMetricName: c.MetricsGenerator.Processor.HostInfo.MetricName,
MetricsGeneratorIngestionSlack: c.MetricsGenerator.IngestionSlack,
MetricsGeneratorNativeHistogramBucketFactor: c.MetricsGenerator.NativeHistogramBucketFactor,
MetricsGeneratorNativeHistogramMaxBucketNumber: c.MetricsGenerator.NativeHistogramMaxBucketNumber,
MetricsGeneratorNativeHistogramMinResetDuration: c.MetricsGenerator.NativeHistogramMinResetDuration,
MetricsGeneratorSpanNameSanitization: c.MetricsGenerator.SpanNameSanitization,
MetricsGeneratorMaxCardinalityPerLabel: c.MetricsGenerator.MaxCardinalityPerLabel,
BlockRetention: c.Compaction.BlockRetention,
CompactionWindow: c.Compaction.CompactionWindow,
CompactionDisabled: c.Compaction.CompactionDisabled,
MaxBytesPerTagValuesQuery: c.Read.MaxBytesPerTagValuesQuery,
MaxBlocksPerTagValuesQuery: c.Read.MaxBlocksPerTagValuesQuery,
MaxSearchDuration: c.Read.MaxSearchDuration,
MaxMetricsDuration: c.Read.MaxMetricsDuration,
UnsafeQueryHints: c.Read.UnsafeQueryHints,
LeftPadTraceIDs: c.Read.LeftPadTraceIDs,
MaxBytesPerTrace: c.Global.MaxBytesPerTrace,
DedicatedColumns: c.Storage.DedicatedColumns,
CostAttribution: CostAttributionOverrides{
Dimensions: c.CostAttribution.Dimensions,
MaxCardinality: c.CostAttribution.MaxCardinality,
},
}
}
// LegacyOverrides describe all the limits for users; can be used to describe global default
// limits via flags, or per-user limits via yaml config.
type LegacyOverrides 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"`
IngestionTenantShardSize int `yaml:"ingestion_tenant_shard_size" json:"ingestion_tenant_shard_size"`
IngestionMaxAttributeBytes int `yaml:"ingestion_max_attribute_bytes" json:"ingestion_max_attribute_bytes"`
IngestionArtificialDelay *time.Duration `yaml:"ingestion_artificial_delay" json:"ingestion_artificial_delay"`
IngestionRetryInfoEnabled bool `yaml:"ingestion_retry_info_enabled" json:"ingestion_retry_info_enabled"`
// 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"`
// Forwarders
Forwarders []string `yaml:"forwarders" json:"forwarders"`
// Metrics-generator config
MetricsGeneratorRingSize int `yaml:"metrics_generator_ring_size" json:"metrics_generator_ring_size"`
MetricsGeneratorProcessors listtomap.ListToMap `yaml:"metrics_generator_processors" json:"metrics_generator_processors"`
MetricsGeneratorMaxActiveSeries uint32 `yaml:"metrics_generator_max_active_series" json:"metrics_generator_max_active_series"`
MetricsGeneratorMaxActiveEntities uint32 `yaml:"metrics_generator_max_active_entities" json:"metrics_generator_max_active_entities"`
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"`
MetricsGeneratorGenerateNativeHistograms histograms.HistogramMethod `yaml:"metrics_generator_generate_native_histograms" json:"metrics_generator_generate_native_histograms"`
MetricsGeneratorNativeHistogramBucketFactor float64 `yaml:"metrics_generator_native_histogram_bucket_factor,omitempty" json:"metrics_generator_native_histogram_bucket_factor,omitempty"`
MetricsGeneratorNativeHistogramMaxBucketNumber uint32 `yaml:"metrics_generator_native_histogram_max_bucket_number,omitempty" json:"metrics_generator_native_histogram_max_bucket_number,omitempty"`
MetricsGeneratorNativeHistogramMinResetDuration time.Duration `yaml:"metrics_generator_native_histogram_min_reset_duration,omitempty" json:"native_histogram_min_reset_duration,omitempty"`
MetricsGeneratorSpanNameSanitization string `yaml:"metrics_generator_span_name_sanitization" json:"metrics_generator_span_name_sanitization"`
MetricsGeneratorMaxCardinalityPerLabel uint64 `yaml:"metrics_generator_max_cardinality_per_label,omitempty" json:"metrics_generator_max_cardinality_per_label,omitempty"`
MetricsGeneratorTraceIDLabelName string `yaml:"metrics_generator_trace_id_label_name" json:"metrics_generator_trace_id_label_name"`
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"`
MetricsGeneratorRemoteWriteHeaders RemoteWriteHeaders `yaml:"metrics_generator_remote_write_headers,omitempty" json:"metrics_generator_remote_write_headers,omitempty"`
MetricsGeneratorProcessorServiceGraphsHistogramBuckets []float64 `yaml:"metrics_generator_processor_service_graphs_histogram_buckets" json:"metrics_generator_processor_service_graphs_histogram_buckets"`
MetricsGeneratorProcessorServiceGraphsDimensions []string `yaml:"metrics_generator_processor_service_graphs_dimensions" json:"metrics_generator_processor_service_graphs_dimensions"`
MetricsGeneratorProcessorServiceGraphsPeerAttributes []string `yaml:"metrics_generator_processor_service_graphs_peer_attributes" json:"metrics_generator_processor_service_graphs_peer_attributes"`
MetricsGeneratorProcessorServiceGraphsFilterPolicies []filterconfig.FilterPolicy `yaml:"metrics_generator_processor_service_graphs_filter_policies" json:"metrics_generator_processor_service_graphs_filter_policies"`
MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix *bool `yaml:"metrics_generator_processor_service_graphs_enable_client_server_prefix" json:"metrics_generator_processor_service_graphs_enable_client_server_prefix"`
MetricsGeneratorProcessorServiceGraphsEnableMessagingSystemLatencyHistogram *bool `yaml:"metrics_generator_processor_service_graphs_enable_messaging_system_latency_histogram" json:"metrics_generator_processor_service_graphs_enable_messaging_system_latency_histogram"`
MetricsGeneratorProcessorServiceGraphsEnableVirtualNodeLabel *bool `yaml:"metrics_generator_processor_service_graphs_enable_virtual_node_label" json:"metrics_generator_processor_service_graphs_enable_virtual_node_label"`
MetricsGeneratorProcessorServiceGraphsSpanMultiplierKey string `yaml:"metrics_generator_processor_service_graphs_span_multiplier_key" json:"metrics_generator_processor_service_graphs_span_multiplier_key"`
MetricsGeneratorProcessorSpanMetricsHistogramBuckets []float64 `yaml:"metrics_generator_processor_span_metrics_histogram_buckets" json:"metrics_generator_processor_span_metrics_histogram_buckets"`
MetricsGeneratorProcessorSpanMetricsDimensions []string `yaml:"metrics_generator_processor_span_metrics_dimensions" json:"metrics_generator_processor_span_metrics_dimensions"`
MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions map[string]bool `yaml:"metrics_generator_processor_span_metrics_intrinsic_dimensions" json:"metrics_generator_processor_span_metrics_intrinsic_dimensions"`
MetricsGeneratorProcessorSpanMetricsFilterPolicies []filterconfig.FilterPolicy `yaml:"metrics_generator_processor_span_metrics_filter_policies" json:"metrics_generator_processor_span_metrics_filter_policies"`
MetricsGeneratorProcessorSpanMetricsDimensionMappings []sharedconfig.DimensionMappings `yaml:"metrics_generator_processor_span_metrics_dimension_mappings" json:"metrics_generator_processor_span_metrics_dimension_mapings"`
MetricsGeneratorProcessorSpanMetricsEnableTargetInfo *bool `yaml:"metrics_generator_processor_span_metrics_enable_target_info" json:"metrics_generator_processor_span_metrics_enable_target_info"`
MetricsGeneratorProcessorSpanMetricsTargetInfoExcludedDimensions []string `yaml:"metrics_generator_processor_span_metrics_target_info_excluded_dimensions" json:"metrics_generator_processor_span_metrics_target_info_excluded_dimensions"`
MetricsGeneratorProcessorSpanMetricsEnableInstanceLabel *bool `yaml:"metrics_generator_processor_span_metrics_enable_instance_label" json:"metrics_generator_processor_span_metrics_enable_instance_label"`
MetricsGeneratorProcessorSpanMetricsSpanMultiplierKey string `yaml:"metrics_generator_processor_span_metrics_span_multiplier_key" json:"metrics_generator_processor_span_metrics_span_multiplier_key"`
MetricsGeneratorProcessorLocalBlocksMaxLiveTraces uint64 `yaml:"metrics_generator_processor_local_blocks_max_live_traces" json:"metrics_generator_processor_local_blocks_max_live_traces"`
MetricsGeneratorProcessorLocalBlocksMaxBlockDuration time.Duration `yaml:"metrics_generator_processor_local_blocks_max_block_duration" json:"metrics_generator_processor_local_blocks_max_block_duration"`
MetricsGeneratorProcessorLocalBlocksMaxBlockBytes uint64 `yaml:"metrics_generator_processor_local_blocks_max_block_bytes" json:"metrics_generator_processor_local_blocks_max_block_bytes"`
MetricsGeneratorProcessorLocalBlocksFlushCheckPeriod time.Duration `yaml:"metrics_generator_processor_local_blocks_flush_check_period" json:"metrics_generator_processor_local_blocks_flush_check_period"`
MetricsGeneratorProcessorLocalBlocksTraceIdlePeriod time.Duration `yaml:"metrics_generator_processor_local_blocks_trace_idle_period" json:"metrics_generator_processor_local_blocks_trace_idle_period"`
MetricsGeneratorProcessorLocalBlocksCompleteBlockTimeout time.Duration `yaml:"metrics_generator_processor_local_blocks_complete_block_timeout" json:"metrics_generator_processor_local_blocks_complete_block_timeout"`
MetricsGeneratorProcessorHostInfoHostIdentifiers []string `yaml:"metrics_generator_processor_host_info_host_identifiers" json:"metrics_generator_processor_host_info_host_identifiers"`
MetricsGeneratorProcessorHostInfoMetricName string `yaml:"metrics_generator_processor_host_info_metric_name" json:"metrics_generator_processor_host_info_metric_name"`
MetricsGeneratorIngestionSlack time.Duration `yaml:"metrics_generator_ingestion_time_range_slack" json:"metrics_generator_ingestion_time_range_slack,omitempty"`
// Backend-worker/scheduler enforced limits.
BlockRetention model.Duration `yaml:"block_retention" json:"block_retention"`
CompactionDisabled bool `yaml:"compaction_disabled" json:"compaction_disabled"`
CompactionWindow model.Duration `yaml:"compaction_window" json:"compaction_window"`
// Querier and Ingester enforced limits.
MaxBytesPerTagValuesQuery int `yaml:"max_bytes_per_tag_values_query" json:"max_bytes_per_tag_values_query"`
MaxBlocksPerTagValuesQuery int `yaml:"max_blocks_per_tag_values_query" json:"max_blocks_per_tag_values_query"`
// QueryFrontend enforced limits
MaxSearchDuration model.Duration `yaml:"max_search_duration" json:"max_search_duration"`
MaxMetricsDuration model.Duration `yaml:"max_metrics_duration" json:"max_metrics_duration"`
UnsafeQueryHints bool `yaml:"unsafe_query_hints" json:"unsafe_query_hints"`
LeftPadTraceIDs bool `yaml:"left_pad_trace_ids" json:"left_pad_trace_ids"`
// MaxBytesPerTrace is enforced in the Ingester, Compactor, Querier (Search). It
// is not used when doing a trace by id lookup.
MaxBytesPerTrace int `yaml:"max_bytes_per_trace" json:"max_bytes_per_trace"`
CostAttribution CostAttributionOverrides `yaml:"cost_attribution" json:"cost_attribution"`
// tempodb limits
DedicatedColumns backend.DedicatedColumns `yaml:"parquet_dedicated_columns" json:"parquet_dedicated_columns"`
}
func (l *LegacyOverrides) toNewLimits() Overrides {
return Overrides{
Ingestion: IngestionOverrides{
RateStrategy: l.IngestionRateStrategy,
RateLimitBytes: l.IngestionRateLimitBytes,
BurstSizeBytes: l.IngestionBurstSizeBytes,
MaxLocalTracesPerUser: l.MaxLocalTracesPerUser,
MaxGlobalTracesPerUser: l.MaxGlobalTracesPerUser,
TenantShardSize: l.IngestionTenantShardSize,
MaxAttributeBytes: l.IngestionMaxAttributeBytes,
ArtificialDelay: l.IngestionArtificialDelay,
RetryInfoEnabled: l.IngestionRetryInfoEnabled,
},
Read: ReadOverrides{
MaxBytesPerTagValuesQuery: l.MaxBytesPerTagValuesQuery,
MaxBlocksPerTagValuesQuery: l.MaxBlocksPerTagValuesQuery,
MaxSearchDuration: l.MaxSearchDuration,
MaxMetricsDuration: l.MaxMetricsDuration,
UnsafeQueryHints: l.UnsafeQueryHints,
LeftPadTraceIDs: l.LeftPadTraceIDs,
},
Compaction: CompactionOverrides{
BlockRetention: l.BlockRetention,
CompactionDisabled: l.CompactionDisabled,
CompactionWindow: l.CompactionWindow,
},
MetricsGenerator: MetricsGeneratorOverrides{
RingSize: l.MetricsGeneratorRingSize,
Processors: l.MetricsGeneratorProcessors,
MaxActiveSeries: l.MetricsGeneratorMaxActiveSeries,
MaxActiveEntities: l.MetricsGeneratorMaxActiveEntities,
CollectionInterval: l.MetricsGeneratorCollectionInterval,
DisableCollection: l.MetricsGeneratorDisableCollection,
TraceIDLabelName: l.MetricsGeneratorTraceIDLabelName,
IngestionSlack: l.MetricsGeneratorIngestionSlack,
RemoteWriteHeaders: l.MetricsGeneratorRemoteWriteHeaders,
GenerateNativeHistograms: l.MetricsGeneratorGenerateNativeHistograms,
Forwarder: ForwarderOverrides{
QueueSize: l.MetricsGeneratorForwarderQueueSize,
Workers: l.MetricsGeneratorForwarderWorkers,
},
Processor: ProcessorOverrides{
ServiceGraphs: ServiceGraphsOverrides{
HistogramBuckets: l.MetricsGeneratorProcessorServiceGraphsHistogramBuckets,
Dimensions: l.MetricsGeneratorProcessorServiceGraphsDimensions,
PeerAttributes: l.MetricsGeneratorProcessorServiceGraphsPeerAttributes,
FilterPolicies: l.MetricsGeneratorProcessorServiceGraphsFilterPolicies,
EnableClientServerPrefix: l.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix,
EnableMessagingSystemLatencyHistogram: l.MetricsGeneratorProcessorServiceGraphsEnableMessagingSystemLatencyHistogram,
EnableVirtualNodeLabel: l.MetricsGeneratorProcessorServiceGraphsEnableVirtualNodeLabel,
SpanMultiplierKey: l.MetricsGeneratorProcessorServiceGraphsSpanMultiplierKey,
},
SpanMetrics: SpanMetricsOverrides{
HistogramBuckets: l.MetricsGeneratorProcessorSpanMetricsHistogramBuckets,
Dimensions: l.MetricsGeneratorProcessorSpanMetricsDimensions,
IntrinsicDimensions: l.MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions,
FilterPolicies: l.MetricsGeneratorProcessorSpanMetricsFilterPolicies,
DimensionMappings: l.MetricsGeneratorProcessorSpanMetricsDimensionMappings,
EnableTargetInfo: l.MetricsGeneratorProcessorSpanMetricsEnableTargetInfo,
TargetInfoExcludedDimensions: l.MetricsGeneratorProcessorSpanMetricsTargetInfoExcludedDimensions,
EnableInstanceLabel: l.MetricsGeneratorProcessorSpanMetricsEnableInstanceLabel,
SpanMultiplierKey: l.MetricsGeneratorProcessorSpanMetricsSpanMultiplierKey,
},
LocalBlocks: LocalBlocksOverrides{
MaxLiveTraces: l.MetricsGeneratorProcessorLocalBlocksMaxLiveTraces,
MaxBlockDuration: l.MetricsGeneratorProcessorLocalBlocksMaxBlockDuration,
MaxBlockBytes: l.MetricsGeneratorProcessorLocalBlocksMaxBlockBytes,
FlushCheckPeriod: l.MetricsGeneratorProcessorLocalBlocksFlushCheckPeriod,
TraceIdlePeriod: l.MetricsGeneratorProcessorLocalBlocksTraceIdlePeriod,
CompleteBlockTimeout: l.MetricsGeneratorProcessorLocalBlocksCompleteBlockTimeout,
},
HostInfo: HostInfoOverrides{
HostIdentifiers: l.MetricsGeneratorProcessorHostInfoHostIdentifiers,
MetricName: l.MetricsGeneratorProcessorHostInfoMetricName,
},
},
NativeHistogramBucketFactor: l.MetricsGeneratorNativeHistogramBucketFactor,
NativeHistogramMaxBucketNumber: l.MetricsGeneratorNativeHistogramMaxBucketNumber,
NativeHistogramMinResetDuration: l.MetricsGeneratorNativeHistogramMinResetDuration,
SpanNameSanitization: l.MetricsGeneratorSpanNameSanitization,
MaxCardinalityPerLabel: l.MetricsGeneratorMaxCardinalityPerLabel,
},
Forwarders: l.Forwarders,
Global: GlobalOverrides{
MaxBytesPerTrace: l.MaxBytesPerTrace,
},
Storage: StorageOverrides{
DedicatedColumns: l.DedicatedColumns,
},
CostAttribution: CostAttributionOverrides{
Dimensions: l.CostAttribution.Dimensions,
MaxCardinality: l.CostAttribution.MaxCardinality,
},
}
}
// perTenantLegacyOverrides represents the Overrides config file with the legacy representation
type perTenantLegacyOverrides struct {
TenantLimits map[string]*LegacyOverrides `yaml:"overrides"`
}
// Convert to new format
func (l *perTenantLegacyOverrides) toNewOverrides() perTenantOverrides {
overrides := perTenantOverrides{
TenantLimits: make(map[string]*Overrides, len(l.TenantLimits)),
}
for tenantID, legacyLimits := range l.TenantLimits {
limits := legacyLimits.toNewLimits()
overrides.TenantLimits[tenantID] = &limits
}
return overrides
}