| 29 | type sanitizeModeFunc func(tenant string) string |
| 30 | |
| 31 | type DrainSanitizer struct { |
| 32 | mtx sync.Mutex |
| 33 | drain *drain.Drain |
| 34 | demand *Cardinality |
| 35 | |
| 36 | tenant string |
| 37 | sanitizeModeF sanitizeModeFunc |
| 38 | |
| 39 | metricTotalSpansSanitized prometheus.Counter |
| 40 | demandGauge prometheus.Gauge |
| 41 | |
| 42 | // channels for periodic maintenance. these allow us to avoid spawning |
| 43 | // additional goroutines and rely on the fact that Sanitize is called |
| 44 | // frequently from the registry. |
| 45 | demandUpdateChan <-chan time.Time |
| 46 | pruneChan <-chan time.Time |
| 47 | } |
| 48 | |
| 49 | func NewDrainSanitizer(tenant string, sanitizeModeF sanitizeModeFunc, staleDuration time.Duration) *DrainSanitizer { |
| 50 | return &DrainSanitizer{ |
nothing calls this directly
no outgoing calls
no test coverage detected