Skip to content

Commit 807e7ff

Browse files
Add code comment for trace filter
1 parent 0067259 commit 807e7ff

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tracer/src/Datadog.Trace/Agent/TraceSamplers/TraceFilter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ static void BuildFilterTags(List<string>? filters, out List<string> keyFilters,
7474
/// <summary>
7575
/// Returns true if the trace should be kept, false if it should be rejected.
7676
/// Evaluation is based on the root span only.
77+
/// Note: When a tag has both a DD and OTel name and is strongly typed in our ITags implementations,
78+
/// there are two diverging behaviors:
79+
/// - When applying a filter tag, the search checks both DD and OTel tag keys (and the singular tag value)
80+
/// - When applying a filter tag regex, the search only checks one tag key (DD or Otel) based on the span's configured semantics setting.
7781
/// </summary>
7882
public bool ShouldKeepTrace(Span rootSpan)
7983
{
@@ -95,6 +99,7 @@ public bool ShouldKeepTrace(Span rootSpan)
9599
}
96100

97101
// 2a. Reject filtering: reject if any tag matches reject filters
102+
// With DD vs OTel semantics: Simple tag names check both key names and the (singular) value.
98103
foreach (var filter in _filterTagKeysReject)
99104
{
100105
// Key-only filter: matches if tag key exists with any value

0 commit comments

Comments
 (0)