Skip to main content
Source: AL0131DirectGenAiSdkUsageAnalyzer.cs

Description

Calling a GenAI SDK type directly prevents automatic OpenTelemetry span emission. Wrap the provider client through Microsoft.Extensions.AI.IChatClient so all LLM calls are traced without changes to call sites.

Properties

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

Configuration

dotnet_diagnostic.AL0131.severity = warning