MCPcopy
hub / github.com/grafana/tempo / NewDrainSanitizer

Function NewDrainSanitizer

modules/generator/registry/drain_sanitizer.go:49–60  ·  modules/generator/registry/drain_sanitizer.go::NewDrainSanitizer
(tenant string, sanitizeModeF sanitizeModeFunc, staleDuration time.Duration)

Source from the content-addressed store, hash-verified

47}
48
49func NewDrainSanitizer(tenant string, sanitizeModeF sanitizeModeFunc, staleDuration time.Duration) *DrainSanitizer {
50 return &DrainSanitizer{
51 drain: drain.New(tenant, drain.DefaultConfig()),
52 tenant: tenant,
53 sanitizeModeF: sanitizeModeF,
54 metricTotalSpansSanitized: metricTotalSpansSanitized.WithLabelValues(tenant),
55 demand: NewCardinality(staleDuration, removeStaleSeriesInterval),
56 demandGauge: metricPostSanitizationDemand.WithLabelValues(tenant),
57 demandUpdateChan: time.Tick(15 * time.Second),
58 pruneChan: time.Tick(5 * time.Minute),
59 }
60}
61
62func (s *DrainSanitizer) Sanitize(lbls labels.Labels) labels.Labels {
63 // Check the override at runtime so that changes to the sanitization mode override

Callers 4

newTestDrainSanitizerFunction · 0.85
NewLabelBuilderMethod · 0.85
NewFunction · 0.85

Calls 3

NewFunction · 0.92
DefaultConfigFunction · 0.92
NewCardinalityFunction · 0.85

Tested by 2

newTestDrainSanitizerFunction · 0.68