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

Method sampleExemplar

pkg/traceql/engine_metrics.go:1517–1534  ·  view source on GitHub ↗
(id []byte)

Source from the content-addressed store, hash-verified

1515}
1516
1517func (e *MetricsEvaluator) sampleExemplar(id []byte) bool {
1518 if len(e.exemplarMap) >= e.maxExemplars {
1519 return false
1520 }
1521 if len(id) == 0 {
1522 return false
1523 }
1524
1525 // Avoid sampling exemplars for the same trace
1526 // Check does zero allocs
1527 if _, ok := e.exemplarMap[string(id)]; ok {
1528 return false
1529 }
1530
1531 e.exemplarMap[string(id)] = struct{}{}
1532 e.exemplarCount++
1533 return true
1534}
1535
1536// MetricsFrontendEvaluator pipes the sharded job results back into the engine for the rest
1537// of the pipeline. i.e. This evaluator is for the query-frontend.

Callers 2

DoMethod · 0.95
DoSpansOnlyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected