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

Method Matches

pkg/spanfilter/policymatch/attribute.go:22–40  ·  view source on GitHub ↗

Matches returns true if the given span matches the policy.

(attrs []*commonv1.KeyValue)

Source from the content-addressed store, hash-verified

20
21// Matches returns true if the given span matches the policy.
22func (p *AttributePolicyMatch) Matches(attrs []*commonv1.KeyValue) bool {
23 // If there are no filters, then the span matches.
24 if len(p.filters) == 0 {
25 return true
26 }
27
28 // If there are no attributes, then the span does not match.
29 if len(attrs) == 0 {
30 return false
31 }
32
33 for _, pa := range p.filters {
34 if !matchesAnyFilter(pa, attrs) {
35 return false
36 }
37 }
38
39 return true
40}
41
42func matchesAnyFilter(pa AttributeFilter, attrs []*commonv1.KeyValue) bool {
43 for _, attr := range attrs {

Callers 1

Calls 1

matchesAnyFilterFunction · 0.85

Tested by 1