Skip to content

Commit 57cf04e

Browse files
juliomenendezclaude
andcommitted
docs: clarify Chat vs chat casing discrepancy in span name table
Manual instrumentation produces InferenceOperationType.value (e.g. "Chat", capitalized) while auto-instrumentation extensions produce the lowercase OTel GenAI semconv form (e.g. "chat"). Tracked as an SDK issue; documented here so users can interpret what they see in their backend. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 427d5b5 commit 57cf04e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/integrating-with-existing-opentelemetry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ The SDK produces three core span kinds. Your backend should show them in this ty
8282
| `gen_ai.operation.name` | Produced by | Typical parent | Span name (default) | Notes |
8383
|-------------------------|---------------------------------------------------|----------------|---------------------|-------|
8484
| `invoke_agent` | `InvokeAgentScope` (one per user turn) | (root or app) | `invoke_agent <agent_name>` when set, else `invoke_agent` | |
85-
| `Chat` / `TextCompletion` / `GenerateContent` | `InferenceScope` (one per LLM call) | `invoke_agent` | `<operation> <model>` (e.g. `Chat gpt-4o-mini`) | Value matches the chosen `InferenceOperationType`. Records model, token counts, finish reasons. |
85+
| (varies — see notes) | `InferenceScope` (one per LLM call) | `invoke_agent` | `<operation> <model>` | **Manual instrumentation** uses `InferenceOperationType.value` (currently `Chat` / `TextCompletion` / `GenerateContent`, capitalized). **Auto-instrumentation** (e.g. `OpenAIAgentsTraceInstrumentor`) uses lowercase per the [OTel GenAI semconv](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/) (e.g. `chat`). The two are inconsistent today. |
8686
| `execute_tool` | `ExecuteToolScope` (one per tool invocation) | `invoke_agent` | `execute_tool <tool_name>` when set, else `execute_tool` | Records tool name, args, and result. |
8787

88-
Filter your backend by the `gen_ai.operation.name` attribute or by span name. Note that `inference` is *not* the literal attribute value — that value comes from `InferenceOperationType` (`Chat`, `TextCompletion`, or `GenerateContent`).
88+
Filter your backend by the `gen_ai.operation.name` attribute or by span name. Note that `inference` is *not* the literal attribute value — manual instrumentation produces `Chat` / `TextCompletion` / `GenerateContent` (the `InferenceOperationType.value`), while auto-instrumentation extension packages produce the lowercase OTel-spec form (e.g. `chat`). This casing discrepancy is tracked as an SDK issue.
8989

9090
## Verifying the integration
9191

0 commit comments

Comments
 (0)