Skip to main content
Source: Al0073TracedActivitySourceNameAnalyzer.cs

Description

The [Traced] attribute requires a non-empty ActivitySourceName to identify which ActivitySource the generated spans belong to.

Bad Code

[Traced("")] // empty name
public partial class OrderService { }

Good Code

[Traced("MyService.Orders")]
public partial class OrderService { }

Properties

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

Configuration

dotnet_diagnostic.AL0073.severity = error