Skip to main content
Source: Al0107OrphanedTracedTagAnalyzer.cs

Description

[TracedTag] marks a parameter to be recorded as a span tag during instrumentation. Without [Traced] on the method or its declaring class, no span is created and the tag is silently ignored.

Bad Code

public class OrderService
{
    // No [Traced] on method or class — tag is orphaned
    public void Process([TracedTag] string orderId) { }
}

Good Code

[Traced("MyApp")]
public class OrderService
{
    public void Process([TracedTag] string orderId) { }
}

Properties

  • Category: OpenTelemetry
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: True

Configuration

dotnet_diagnostic.AL0107.severity = warning