From 126f390d0141cb5b81fe415d8a8fa82982d5b81a Mon Sep 17 00:00:00 2001 From: Zach Leslie Date: Tue, 11 Apr 2023 22:00:13 +0000 Subject: [PATCH] Relocate spanmetrics.FilterPolicy to sharedconfig package and implement overrides Signed-off-by: Zach Leslie --- modules/generator/overrides.go | 2 + modules/generator/overrides_test.go | 11 +- .../generator/processor/spanmetrics/config.go | 25 +--- .../processor/spanmetrics/spanmetrics.go | 33 ++--- .../processor/spanmetrics/spanmetrics_test.go | 121 +++++++++--------- modules/overrides/limits.go | 26 ++-- modules/overrides/overrides.go | 6 + 7 files changed, 112 insertions(+), 112 deletions(-) diff --git a/modules/generator/overrides.go b/modules/generator/overrides.go index f564ec8040b..3808445a42b 100644 --- a/modules/generator/overrides.go +++ b/modules/generator/overrides.go @@ -3,6 +3,7 @@ package generator import ( "github.com/grafana/tempo/modules/generator/registry" "github.com/grafana/tempo/modules/overrides" + "github.com/grafana/tempo/pkg/sharedconfig" ) type metricsGeneratorOverrides interface { @@ -14,6 +15,7 @@ type metricsGeneratorOverrides interface { MetricsGeneratorProcessorSpanMetricsHistogramBuckets(userID string) []float64 MetricsGeneratorProcessorSpanMetricsDimensions(userID string) []string MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions(userID string) map[string]bool + MetricsGeneratorProcessorSpanMetricsFilterPolicies(userID string) []sharedconfig.FilterPolicy } var _ metricsGeneratorOverrides = (*overrides.Overrides)(nil) diff --git a/modules/generator/overrides_test.go b/modules/generator/overrides_test.go index bf7fe9bf1d4..57c7627d229 100644 --- a/modules/generator/overrides_test.go +++ b/modules/generator/overrides_test.go @@ -1,6 +1,10 @@ package generator -import "time" +import ( + "time" + + "github.com/grafana/tempo/pkg/sharedconfig" +) type mockOverrides struct { processors map[string]struct{} @@ -9,6 +13,7 @@ type mockOverrides struct { spanMetricsHistogramBuckets []float64 spanMetricsDimensions []string spanMetricsIntrinsicDimensions map[string]bool + spanMetricsFilterPolicies []sharedconfig.FilterPolicy } var _ metricsGeneratorOverrides = (*mockOverrides)(nil) @@ -48,3 +53,7 @@ func (m *mockOverrides) MetricsGeneratorProcessorSpanMetricsDimensions(userID st func (m *mockOverrides) MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions(userID string) map[string]bool { return m.spanMetricsIntrinsicDimensions } + +func (m *mockOverrides) MetricsGeneratorProcessorSpanMetricsFilterPolicies(userID string) []sharedconfig.FilterPolicy { + return m.spanMetricsFilterPolicies +} diff --git a/modules/generator/processor/spanmetrics/config.go b/modules/generator/processor/spanmetrics/config.go index e9a0a620589..e0cd9be7e23 100644 --- a/modules/generator/processor/spanmetrics/config.go +++ b/modules/generator/processor/spanmetrics/config.go @@ -3,6 +3,7 @@ package spanmetrics import ( "flag" + "github.com/grafana/tempo/pkg/sharedconfig" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" ) @@ -32,7 +33,7 @@ type Config struct { SpanMultiplierKey string `yaml:"span_multiplier_key"` // FilterPolicies is a list of policies that will be applied to spans for inclusion or exlusion. - FilterPolicies []FilterPolicy `yaml:"filter_policies"` + FilterPolicies []sharedconfig.FilterPolicy `yaml:"filter_policies"` } func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet) { @@ -70,25 +71,3 @@ func (ic *IntrinsicDimensions) ApplyFromMap(dimensions map[string]bool) error { } return nil } - -type FilterPolicy struct { - Include *PolicyMatch `yaml:"include"` - Exclude *PolicyMatch `yaml:"exclude"` -} - -type MatchType string - -const ( - Strict MatchType = "strict" - Regex MatchType = "regex" -) - -type PolicyMatch struct { - MatchType MatchType `yaml:"match_type"` - Attributes []MatchPolicyAttribute `yaml:"attributes"` -} - -type MatchPolicyAttribute struct { - Key string `yaml:"key"` - Value interface{} `yaml:"value"` -} diff --git a/modules/generator/processor/spanmetrics/spanmetrics.go b/modules/generator/processor/spanmetrics/spanmetrics.go index 13bb3f06695..2e149c26dda 100644 --- a/modules/generator/processor/spanmetrics/spanmetrics.go +++ b/modules/generator/processor/spanmetrics/spanmetrics.go @@ -12,6 +12,7 @@ import ( gen "github.com/grafana/tempo/modules/generator/processor" processor_util "github.com/grafana/tempo/modules/generator/processor/util" "github.com/grafana/tempo/modules/generator/registry" + "github.com/grafana/tempo/pkg/sharedconfig" "github.com/grafana/tempo/pkg/tempopb" v1_common "github.com/grafana/tempo/pkg/tempopb/common/v1" v1 "github.com/grafana/tempo/pkg/tempopb/resource/v1" @@ -50,9 +51,9 @@ type filterPolicy struct { // SplitPolicy is the result of parsing a policy from the config file to be specific about the area the given policy is applied to. type splitPolicy struct { - ResourceMatch *PolicyMatch - SpanMatch *PolicyMatch - IntrinsicMatch *PolicyMatch + ResourceMatch *sharedconfig.PolicyMatch + SpanMatch *sharedconfig.PolicyMatch + IntrinsicMatch *sharedconfig.PolicyMatch } func New(cfg Config, registry registry.Registry) gen.Processor { @@ -199,7 +200,7 @@ func policyMatch(policy *splitPolicy, rs *v1.Resource, span *v1_trace.Span) bool } // policyMatchIntrinsicAttrs returns true when all intrinsic values in the polciy match the span. -func policyMatchIntrinsicAttrs(policy *PolicyMatch, span *v1_trace.Span) bool { +func policyMatchIntrinsicAttrs(policy *sharedconfig.PolicyMatch, span *v1_trace.Span) bool { matches := 0 for _, pa := range policy.Attributes { attr := traceql.MustParseIdentifier(pa.Key) @@ -226,7 +227,7 @@ func policyMatchIntrinsicAttrs(policy *PolicyMatch, span *v1_trace.Span) bool { } // policyMatchAttrs returns true if all attributes in the policy match the attributes in the span. String, bool, int, and floats are supported. Regex MatchType may be applied to string span attributes. -func policyMatchAttrs(policy *PolicyMatch, attrs []*v1_common.KeyValue) bool { +func policyMatchAttrs(policy *sharedconfig.PolicyMatch, attrs []*v1_common.KeyValue) bool { matches := 0 var v *v1_common.AnyValue @@ -297,11 +298,11 @@ func isIntrinsicDimension(name string) bool { name == dimStatusMessage } -func stringMatch(matchType MatchType, s, pattern string) bool { +func stringMatch(matchType sharedconfig.MatchType, s, pattern string) bool { switch matchType { - case Strict: + case sharedconfig.Strict: return s == pattern - case Regex: + case sharedconfig.Regex: re := regexp.MustCompile(pattern) return re.MatchString(s) default: @@ -309,32 +310,32 @@ func stringMatch(matchType MatchType, s, pattern string) bool { } } -func getSplitPolicy(policy *PolicyMatch) *splitPolicy { +func getSplitPolicy(policy *sharedconfig.PolicyMatch) *splitPolicy { if policy == nil { return nil } // A policy to match against the resource attributes - resourcePolicy := &PolicyMatch{ + resourcePolicy := &sharedconfig.PolicyMatch{ MatchType: policy.MatchType, - Attributes: make([]MatchPolicyAttribute, 0), + Attributes: make([]sharedconfig.MatchPolicyAttribute, 0), } // A policy to match against the span attributes - spanPolicy := &PolicyMatch{ + spanPolicy := &sharedconfig.PolicyMatch{ MatchType: policy.MatchType, - Attributes: make([]MatchPolicyAttribute, 0), + Attributes: make([]sharedconfig.MatchPolicyAttribute, 0), } - intrinsicPolicy := &PolicyMatch{ + intrinsicPolicy := &sharedconfig.PolicyMatch{ MatchType: policy.MatchType, - Attributes: make([]MatchPolicyAttribute, 0), + Attributes: make([]sharedconfig.MatchPolicyAttribute, 0), } for _, pa := range policy.Attributes { attr := traceql.MustParseIdentifier(pa.Key) - attribute := MatchPolicyAttribute{ + attribute := sharedconfig.MatchPolicyAttribute{ Key: attr.Name, Value: pa.Value, } diff --git a/modules/generator/processor/spanmetrics/spanmetrics_test.go b/modules/generator/processor/spanmetrics/spanmetrics_test.go index 944ec026dbd..8a5508c4cc3 100644 --- a/modules/generator/processor/spanmetrics/spanmetrics_test.go +++ b/modules/generator/processor/spanmetrics/spanmetrics_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/tempo/modules/generator/registry" + "github.com/grafana/tempo/pkg/sharedconfig" "github.com/grafana/tempo/pkg/tempopb" common_v1 "github.com/grafana/tempo/pkg/tempopb/common/v1" v1 "github.com/grafana/tempo/pkg/tempopb/resource/v1" @@ -157,19 +158,19 @@ func TestSpanMetrics_collisions(t *testing.T) { func TestSpanMetrics_applyFilterPolicy(t *testing.T) { cases := []struct { - filterPolicies []FilterPolicy + filterPolicies []sharedconfig.FilterPolicy expectedMatches float64 expectedRejections float64 }{ { expectedMatches: 10.0, expectedRejections: 0.0, - filterPolicies: []FilterPolicy{ + filterPolicies: []sharedconfig.FilterPolicy{ { - Include: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + Include: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "span.foo", Value: "foo-value", @@ -182,12 +183,12 @@ func TestSpanMetrics_applyFilterPolicy(t *testing.T) { { expectedMatches: 0.0, expectedRejections: 10.0, - filterPolicies: []FilterPolicy{ + filterPolicies: []sharedconfig.FilterPolicy{ { - Include: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + Include: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "span.nope", Value: "nothere", @@ -200,11 +201,11 @@ func TestSpanMetrics_applyFilterPolicy(t *testing.T) { { expectedMatches: 0.0, expectedRejections: 10.0, - filterPolicies: []FilterPolicy{ + filterPolicies: []sharedconfig.FilterPolicy{ { - Exclude: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + Exclude: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "status", Value: "STATUS_CODE_OK", @@ -217,11 +218,11 @@ func TestSpanMetrics_applyFilterPolicy(t *testing.T) { { expectedMatches: 10.0, expectedRejections: 0.0, - filterPolicies: []FilterPolicy{ + filterPolicies: []sharedconfig.FilterPolicy{ { - Include: &PolicyMatch{ - MatchType: Regex, - Attributes: []MatchPolicyAttribute{ + Include: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Regex, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "kind", Value: "SPAN_KIND_.*", @@ -300,16 +301,16 @@ func TestSpanMetrics_applyFilterPolicy(t *testing.T) { func TestSpanMetrics_policyMatch(t *testing.T) { cases := []struct { - policy *PolicyMatch + policy *sharedconfig.PolicyMatch resource *v1.Resource span *trace_v1.Span expect bool }{ { expect: true, - policy: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "span.kind", Value: "client", @@ -371,9 +372,9 @@ func TestSpanMetrics_policyMatch(t *testing.T) { }, { expect: true, - policy: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "span.kind", Value: "client", @@ -415,9 +416,9 @@ func TestSpanMetrics_policyMatch(t *testing.T) { }, { expect: true, - policy: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "resource.location", Value: "earth", @@ -471,15 +472,15 @@ func TestSpanMetrics_policyMatch(t *testing.T) { func TestSpanMetrics_policyMatchIntrinsicAttrs(t *testing.T) { cases := []struct { - policy *PolicyMatch + policy *sharedconfig.PolicyMatch span *trace_v1.Span expect bool }{ { expect: true, - policy: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "kind", Value: "SPAN_KIND_SERVER", @@ -513,16 +514,16 @@ func TestSpanMetrics_policyMatchIntrinsicAttrs(t *testing.T) { func TestSpanMetrics_policyMatchAttrs(t *testing.T) { cases := []struct { - policy *PolicyMatch + policy *sharedconfig.PolicyMatch attrs []*common_v1.KeyValue expect bool }{ // Single string match { expect: true, - policy: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "foo", Value: "bar", @@ -543,9 +544,9 @@ func TestSpanMetrics_policyMatchAttrs(t *testing.T) { // Multiple string match { expect: true, - policy: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "foo", Value: "bar", @@ -578,9 +579,9 @@ func TestSpanMetrics_policyMatchAttrs(t *testing.T) { // Multiple string non match { expect: false, - policy: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "foo", Value: "bar", @@ -613,9 +614,9 @@ func TestSpanMetrics_policyMatchAttrs(t *testing.T) { // Combination match { expect: true, - policy: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "one", Value: "1", @@ -672,9 +673,9 @@ func TestSpanMetrics_policyMatchAttrs(t *testing.T) { // Regex basic match { expect: true, - policy: &PolicyMatch{ - MatchType: Regex, - Attributes: []MatchPolicyAttribute{ + policy: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Regex, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "dd", Value: `\d\d\w{5}`, @@ -703,19 +704,19 @@ func TestSpanMetrics_policyMatchAttrs(t *testing.T) { func TestSpanMetrics_stringMatch(t *testing.T) { cases := []struct { - matchType MatchType + matchType sharedconfig.MatchType s string pattern string expect bool }{ { - matchType: Strict, + matchType: sharedconfig.Strict, s: "foo", pattern: "foo", expect: true, }, { - matchType: Strict, + matchType: sharedconfig.Strict, s: "foo", pattern: "bar", expect: false, @@ -753,7 +754,7 @@ func BenchmarkSpanMetrics_applyFilterPolicyNone(b *testing.B) { // b.Logf("size: %s", humanize.Bytes(uint64(batch.Size()))) // b.Logf("span count: %d", len(batch.ScopeSpans)) - policies := []FilterPolicy{} + policies := []sharedconfig.FilterPolicy{} benchmarkFilterPolicy(b, policies, batch) } @@ -766,11 +767,11 @@ func BenchmarkSpanMetrics_applyFilterPolicySmall(b *testing.B) { err = batch.Unmarshal(data) require.NoError(b, err) - policies := []FilterPolicy{ + policies := []sharedconfig.FilterPolicy{ { - Include: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + Include: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "span.foo", Value: "foo-value", @@ -791,11 +792,11 @@ func BenchmarkSpanMetrics_applyFilterPolicyMedium(b *testing.B) { err = batch.Unmarshal(data) require.NoError(b, err) - policies := []FilterPolicy{ + policies := []sharedconfig.FilterPolicy{ { - Include: &PolicyMatch{ - MatchType: Strict, - Attributes: []MatchPolicyAttribute{ + Include: &sharedconfig.PolicyMatch{ + MatchType: sharedconfig.Strict, + Attributes: []sharedconfig.MatchPolicyAttribute{ { Key: "span.foo", Value: "foo-value", @@ -820,7 +821,7 @@ func BenchmarkSpanMetrics_applyFilterPolicyMedium(b *testing.B) { benchmarkFilterPolicy(b, policies, batch) } -func benchmarkFilterPolicy(b *testing.B, policies []FilterPolicy, batch *trace_v1.ResourceSpans) { +func benchmarkFilterPolicy(b *testing.B, policies []sharedconfig.FilterPolicy, batch *trace_v1.ResourceSpans) { testRegistry := registry.NewTestRegistry() cfg := Config{} cfg.RegisterFlagsAndApplyDefaults("", nil) diff --git a/modules/overrides/limits.go b/modules/overrides/limits.go index d6c64b6c1b0..3104c2fadee 100644 --- a/modules/overrides/limits.go +++ b/modules/overrides/limits.go @@ -4,6 +4,7 @@ import ( "flag" "time" + "github.com/grafana/tempo/pkg/sharedconfig" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" ) @@ -57,18 +58,19 @@ type Limits struct { 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 `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"` - 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"` + 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 `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"` + 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 []sharedconfig.FilterPolicy `yaml:"metrics_generator_processor_span_metrics_filter_policies" json:"metrics_generator_processor_span_metrics_filter_policies"` // Compactor enforced limits. BlockRetention model.Duration `yaml:"block_retention" json:"block_retention"` diff --git a/modules/overrides/overrides.go b/modules/overrides/overrides.go index dbc18f4b738..fdd685a2d19 100644 --- a/modules/overrides/overrides.go +++ b/modules/overrides/overrides.go @@ -12,6 +12,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "gopkg.in/yaml.v2" + "github.com/grafana/tempo/pkg/sharedconfig" "github.com/grafana/tempo/pkg/util" "github.com/grafana/tempo/pkg/util/log" ) @@ -341,6 +342,11 @@ func (o *Overrides) MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions(user return o.getOverridesForUser(userID).MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions } +// MetricsGeneratorProcessorSpanMetricsFilterPolicies controls the filter policies that are added to the spanmetrics processor. +func (o *Overrides) MetricsGeneratorProcessorSpanMetricsFilterPolicies(userID string) []sharedconfig.FilterPolicy { + return o.getOverridesForUser(userID).MetricsGeneratorProcessorSpanMetricsFilterPolicies +} + // BlockRetention is the duration of the block retention for this tenant. func (o *Overrides) BlockRetention(userID string) time.Duration { return time.Duration(o.getOverridesForUser(userID).BlockRetention)