(id []byte)
| 1515 | } |
| 1516 | |
| 1517 | func (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. |
no outgoing calls
no test coverage detected