Skip to main content
Source: Al0078InvalidActivitySourceNameAnalyzer.cs

Description

ActivitySource names should follow the reverse-DNS naming convention (e.g., MyCompany.MyService) to avoid collisions and enable filtering.

Bad Code

private static readonly ActivitySource Source = new("orders");

Good Code

private static readonly ActivitySource Source = new("MyCompany.OrderService");

Properties

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

Configuration

dotnet_diagnostic.AL0078.severity = error