-
Notifications
You must be signed in to change notification settings - Fork 166
feat(tracer): Update the TagsList infrastructure to allow a secondary OtelName #8971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
59cd901
0403a47
5ab6bed
4aa8d2a
77b5fec
4d9676d
471f234
0067259
807e7ff
2a29f8b
9712b4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,10 @@ static void BuildFilterTags(List<string>? filters, out List<string> keyFilters, | |
| /// <summary> | ||
| /// Returns true if the trace should be kept, false if it should be rejected. | ||
| /// Evaluation is based on the root span only. | ||
| /// Note: When a tag has both a DD and OTel name and is strongly typed in our ITags implementations, | ||
| /// there are two diverging behaviors: | ||
| /// - When applying a filter tag, the search checks both DD and OTel tag keys (and the singular tag value) | ||
| /// - When applying a filter tag regex, the search only checks one tag key (DD or Otel) based on the span's configured semantics setting. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could tweak that, so that it applies to both cases, at the expense of an additional enumeration for every span, regardless of the setting. Given the performance impact for everyone, and the generally low usage, I think the current approach makes total sense, even though it is potentially a bit confusing. |
||
| /// </summary> | ||
| public bool ShouldKeepTrace(Span rootSpan) | ||
| { | ||
|
|
@@ -95,6 +99,7 @@ public bool ShouldKeepTrace(Span rootSpan) | |
| } | ||
|
|
||
| // 2a. Reject filtering: reject if any tag matches reject filters | ||
| // With DD vs OTel semantics: Simple tag names check both key names and the (singular) value. | ||
| foreach (var filter in _filterTagKeysReject) | ||
| { | ||
| // Key-only filter: matches if tag key exists with any value | ||
|
|
@@ -159,7 +164,7 @@ public bool ShouldKeepTrace(Span rootSpan) | |
| private static bool MatchesRegexTagFilter(Span span, RegexTagFilter filter) | ||
| { | ||
| var processor = new RegexTagFilterProcessor(filter); | ||
| span.Tags.EnumerateTags(ref processor); | ||
| span.Tags.EnumerateTags(ref processor, span.OpenTelemetrySemanticsEnabled); | ||
| return processor.Matched; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case where a tag is only used by Otel, we'd still set
TagName. I'm wondering if it will confuse anyone 🤔 Maybe we could/should call it out explicitly in doc comments forTagName? WDYT?