Matches returns true if the given span matches the filter.
(span *tracev1.Span)
| 107 | |
| 108 | // Matches returns true if the given span matches the filter. |
| 109 | func (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 | } |