Skip to main content
Source: Al0087PreferConstantAttributeAnalyzer.cs

Description

Attribute names used in SetTag() calls should reference constant fields instead of string literals to prevent typos and enable refactoring.

Bad Code

Good Code

Properties

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

Configuration