> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AL0131 - Direct GenAI SDK call bypasses automatic OTel instrumentation

> Calling a GenAI SDK type directly prevents automatic OpenTelemetry span emission

Source: [AL0131DirectGenAiSdkUsageAnalyzer.cs](https://github.com/ANcpLua/ANcpLua.Analyzers/blob/main/src/ANcpLua.Analyzers/Analyzers/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

```editorconfig theme={null}
dotnet_diagnostic.AL0131.severity = warning
```
