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

Method Matches

pkg/spanfilter/policymatch/intrinsic.go:109–129  ·  view source on GitHub ↗

Matches returns true if the given span matches the filter.

(span *tracev1.Span)

Source from the content-addressed store, hash-verified

107
108// Matches returns true if the given span matches the filter.
109func (a *IntrinsicFilter) Matches(span *tracev1.Span) bool {
110 switch a.intrinsic {
111 case traceql.IntrinsicName:
112 if a.regex != nil {
113 return a.regex.MatchString(span.Name)
114 }
115 return a.name == span.Name
116 case traceql.IntrinsicStatus:
117 if a.regex != nil {
118 return a.regex.MatchString(span.GetStatus().GetCode().String())
119 }
120 return a.statusCode == span.GetStatus().GetCode()
121 case traceql.IntrinsicKind:
122 if a.regex != nil {
123 return a.regex.MatchString(span.Kind.String())
124 }
125 return a.kind == span.Kind
126 default:
127 return false
128 }
129}

Callers 4

MatchMethod · 0.45
MatchesMethod · 0.45

Calls 4

MatchStringMethod · 0.80
GetCodeMethod · 0.80
StringMethod · 0.45
GetStatusMethod · 0.45