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

Function New

pkg/drain/drain.go:29–47  ·  view source on GitHub ↗

New creates a new Drain instance.

(tenant string, config *Config)

Source from the content-addressed store, hash-verified

27
28// New creates a new Drain instance.
29func New(tenant string, config *Config) *Drain {
30 if config.LogClusterDepth < 3 {
31 config.LogClusterDepth = 3
32 }
33
34 metrics := metricsForTenant(tenant)
35 d := &Drain{
36 config: config,
37 maxNodeDepth: config.LogClusterDepth - 2,
38 metrics: metrics,
39 tokenizer: &defaultTokenizer{},
40 tokenIsLikelyData: defaultIsDataHeuristic,
41
42 rootNode: newNode(),
43 idToCluster: newLogClusterCache(config.StaleClusterAge, config.MaxClusters, metrics.PatternsEvictedTotal, metrics.PatternsExpiredTotal),
44 }
45
46 return d
47}
48
49// Node is a node in the prefix tree.
50type Node struct {

Calls 3

metricsForTenantFunction · 0.85
newNodeFunction · 0.85
newLogClusterCacheFunction · 0.85