The whole hunk
from line 194, old and new numbered
/
lines
from line 194
194194
195195**`claude_code.interaction`**
196196
197| Attribute | Description | Gated by |
198| ------------------------- | --------------------------------------------------------- | ----------------------- |
199| `user_prompt` | Prompt text. Value is `<REDACTED>` unless the gate is set | `OTEL_LOG_USER_PROMPTS` |
200| `user_prompt_length` | Prompt length in characters | |
201| `interaction.sequence` | 1-based counter of interactions in this session | |
202| `interaction.duration_ms` | Wall-clock duration of the turn | |
197| Attribute | Description | Gated by |
198| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
199| `user_prompt` | Prompt text. Value is `<REDACTED>` unless the gate is set | `OTEL_LOG_USER_PROMPTS` |
200| `user_prompt_length` | Prompt length in characters | |
201| `interaction.sequence` | 1-based counter of interactions in this session | |
202| `parent.source` | How the span got its trace parent: `env` when it parented under an inbound `TRACEPARENT`, `none` when it started its own trace. Requires Claude Code v2.1.268 or later | |
203| `interaction.duration_ms` | Wall-clock duration of the turn | |
203204
204205**`claude_code.llm_request`**
205206
206| Attribute | Description | Gated by |
207| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
208| `model` | Model identifier | |
209| `gen_ai.system` | Always `anthropic`. OpenTelemetry GenAI semantic convention | |
210| `gen_ai.request.model` | Same value as `model`. OpenTelemetry GenAI semantic convention | |
211| `query_source` | Subsystem that issued the request, such as `repl_main_thread` or a subagent name | |
212| `agent_id` | Identifier of the subagent or teammate that issued the request. Absent on the main session | |
213| `parent_agent_id` | Identifier of the agent that spawned this one. Absent for the main session and for agents spawned directly from it | |
214| `workflow.run_id` | Run identifier of the [Workflow](/docs/en/workflows) tool run that spawned this agent, prefixed `wf_`. Absent for agents not spawned by a workflow | |
215| `workflow.name` | Name of the workflow that spawned this agent. User-authored names are replaced with `custom` unless the gate is set | `OTEL_LOG_TOOL_DETAILS` |
216| `speed` | `fast` or `normal` | |
217| `llm_request.context` | `interaction`, `tool`, or `standalone` depending on the parent span | |
218| `duration_ms` | Wall-clock duration including retries | |
219| `ttft_ms` | Time to first token in milliseconds | |
220| `input_tokens` | Input token count from the API usage block | |
221| `output_tokens` | Output token count | |
222| `cache_read_tokens` | Tokens read from prompt cache | |
223| `cache_creation_tokens` | Tokens written to prompt cache | |
224| `request_id` | Anthropic API request ID from the `request-id` response header | |
225| `gen_ai.response.id` | Same value as `request_id`. OpenTelemetry GenAI semantic convention | |
226| `client_request_id` | Client-generated `x-client-request-id` of the final attempt | |
227| `attempt` | Total attempts made for this request | |
228| `success` | `true` or `false` | |
229| `status_code` | HTTP status code when the request failed | |
230| `error` | Error message when the request failed | |
231| `response.has_tool_call` | `true` when the response contained tool-use blocks | |
232| `stop_reason` | API response `stop_reason`, such as `end_turn`, `tool_use`, `max_tokens`, `stop_sequence`, `pause_turn`, or `refusal` | |
233| `gen_ai.response.finish_reasons` | Same value as `stop_reason`, wrapped in a string array. OpenTelemetry GenAI semantic convention | |
207| Attribute | Description | Gated by |
208| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
209| `model` | Model identifier | |
210| `gen_ai.system` | Always `anthropic`. OpenTelemetry GenAI semantic convention | |
211| `gen_ai.request.model` | Same value as `model`. OpenTelemetry GenAI semantic convention | |
212| `query_source` | Subsystem that issued the request, such as `repl_main_thread` or a subagent name | `ENABLE_BETA_TRACING_DETAILED` |
213| `query_source_safe` | Bounded form of `query_source`, emitted whether or not detailed beta tracing is active, with values such as `repl_main_thread` or `agent.builtin.general-purpose`. `:` becomes `.` and user-named agents appear as `agent.custom`. Requires Claude Code v2.1.268 or later | |
214| `agent_id` | Identifier of the subagent or teammate that issued the request. Absent on the main session | |
215| `parent_agent_id` | Identifier of the agent that spawned this one. Absent for the main session and for agents spawned directly from it | |
216| `workflow.run_id` | Run identifier of the [Workflow](/docs/en/workflows) tool run that spawned this agent, prefixed `wf_`. Absent for agents not spawned by a workflow | |
217| `workflow.name` | Name of the workflow that spawned this agent. User-authored names are replaced with `custom` unless the gate is set | `OTEL_LOG_TOOL_DETAILS` |
218| `speed` | `fast` or `normal` | |
219| `llm_request.context` | `interaction`, `tool`, or `standalone` depending on the parent span | |
220| `duration_ms` | Wall-clock duration including retries | |
221| `ttft_ms` | Time to first token in milliseconds | |
222| `first_content_ms` | Time from request start to the first content block of the successful attempt, in milliseconds. Absent on requests that fell back to the non-streaming path. Requires Claude Code v2.1.268 or later | |
223| `input_tokens` | Input token count from the API usage block | |
224| `output_tokens` | Output token count | |
225| `cache_read_tokens` | Tokens read from prompt cache | |
226| `cache_creation_tokens` | Tokens written to prompt cache | |
227| `request_id` | Anthropic API request ID from the `request-id` response header | |
228| `gen_ai.response.id` | Same value as `request_id`. OpenTelemetry GenAI semantic convention | |
229| `client_request_id` | Client-generated `x-client-request-id` of the final attempt | |
230| `attempt` | Total attempts made for this request | |
231| `success` | `true` or `false` | |
232| `status_code` | HTTP status code when the request failed | |
233| `error` | Error message when the request failed | |
234| `error_class` | Short error class token when the request failed, such as `api_timeout` or `server_overload`. Requires Claude Code v2.1.268 or later | |
235| `response.has_tool_call` | `true` when the response contained tool-use blocks | |
236| `stop_reason` | API response `stop_reason`, such as `end_turn`, `tool_use`, `max_tokens`, `stop_sequence`, `pause_turn`, or `refusal` | |
237| `gen_ai.response.finish_reasons` | Same value as `stop_reason`, wrapped in a string array. OpenTelemetry GenAI semantic convention | |
234238
235239Each retry attempt is also recorded as a `gen_ai.request.attempt` span event with `attempt` and `client_request_id` attributes.
236240
237241**`claude_code.tool`**
238242
239| Attribute | Description | Gated by |
240| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- |
241| `tool_name` | Tool name | |
242| `duration_ms` | Wall-clock duration including permission wait and execution | |
243| `result_tokens` | Approximate token size of the tool result | |
244| `agent_id` | Identifier of the subagent or teammate that ran the tool. Absent on the main session | |
245| `parent_agent_id` | Identifier of the agent that spawned this one. Absent for the main session and for agents spawned directly from it | |
246| `workflow.run_id` | Run identifier of the Workflow tool run that spawned this agent, prefixed `wf_`. Absent for agents not spawned by a workflow | |
247| `workflow.name` | Name of the workflow that spawned this agent. User-authored names are replaced with `custom` unless the gate is set | `OTEL_LOG_TOOL_DETAILS` |
248| `tool_use_id` | The model's `tool_use` block id for this call. Matches the `tool_use_id` on the [tool\_result](#tool-result-event) and [tool\_decision](#tool-decision-event) events and in hook payloads, so you can join the span to those records | |
249| `gen_ai.tool.call.id` | Same value as `tool_use_id`. OpenTelemetry GenAI semantic convention | |
250| `file_path` | Target file path for Read, Edit, and Write tools | `OTEL_LOG_TOOL_DETAILS` |
251| `full_command` | Command string for the Bash tool | `OTEL_LOG_TOOL_DETAILS` |
252| `skill_name` | Skill name for the Skill tool | `OTEL_LOG_TOOL_DETAILS` |
253| `subagent_type` | Subagent type for the Agent tool or legacy Task tool | `OTEL_LOG_TOOL_DETAILS` |
243| Attribute | Description | Gated by |
244| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
245| `tool_name` | Tool name | |
246| `tool_name_safe` | Form of `tool_name` that carries no user-chosen names. Built-in tool names pass verbatim. MCP tool names appear as `mcp_other`, except tool names matching a few fixed shapes, such as `playwright` tools named `browser_*`, which pass verbatim. Requires Claude Code v2.1.268 or later | |
247| `bash_command_class` | For the Bash tool: category of the command's first program from a fixed list, such as `vcs` or `package_manager`. `other` for a program outside the list, `unparsed` when the line can't be parsed. Requires Claude Code v2.1.268 or later | |
248| `bash_argv0` | For the Bash tool: the command's first program when it's on the same fixed list, such as `git` or `npm`. `other` for any program outside the list. Requires Claude Code v2.1.268 or later | |
249| `duration_ms` | Wall-clock duration including permission wait and execution | |
250| `result_tokens` | Approximate token size of the tool result | |
251| `agent_id` | Identifier of the subagent or teammate that ran the tool. Absent on the main session | |
252| `parent_agent_id` | Identifier of the agent that spawned this one. Absent for the main session and for agents spawned directly from it | |
253| `workflow.run_id` | Run identifier of the Workflow tool run that spawned this agent, prefixed `wf_`. Absent for agents not spawned by a workflow | |
254| `workflow.name` | Name of the workflow that spawned this agent. User-authored names are replaced with `custom` unless the gate is set | `OTEL_LOG_TOOL_DETAILS` |
255| `tool_use_id` | The model's `tool_use` block id for this call. Matches the `tool_use_id` on the [tool\_result](#tool-result-event) and [tool\_decision](#tool-decision-event) events and in hook payloads, so you can join the span to those records | |
256| `gen_ai.tool.call.id` | Same value as `tool_use_id`. OpenTelemetry GenAI semantic convention | |
257| `file_path` | Target file path for Read, Edit, and Write tools | `OTEL_LOG_TOOL_DETAILS` |
258| `full_command` | Command string for the Bash tool | `OTEL_LOG_TOOL_DETAILS` |
259| `skill_name` | Skill name for the Skill tool | `OTEL_LOG_TOOL_DETAILS` |
260| `subagent_type` | Subagent type for the Agent tool or legacy Task tool | `OTEL_LOG_TOOL_DETAILS` |
254261
255262When `OTEL_LOG_TOOL_CONTENT=1`, this span also records a `tool.output` span event whose attributes contain the tool's input and output bodies, truncated at the content limit (60 KB by default) per attribute.
256263
from line 271
264271
265272**`claude_code.tool.execution`**
266273
267| Attribute | Description | Gated by |
268| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
269| `duration_ms` | Time spent running the tool body | |
270| `tool_use_id` | Same value as on the parent `claude_code.tool` span | |
271| `gen_ai.tool.call.id` | Same value as `tool_use_id`. OpenTelemetry GenAI semantic convention | |
272| `success` | `true` or `false` | |
273| `error` | Error category string when execution failed, such as `Error:ENOENT` or `ShellError`. Contains the full error message instead when the gate is set | `OTEL_LOG_TOOL_DETAILS` |
274| Attribute | Description | Gated by |
275| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
276| `duration_ms` | Time spent running the tool body | |
277| `tool_use_id` | Same value as on the parent `claude_code.tool` span | |
278| `gen_ai.tool.call.id` | Same value as `tool_use_id`. OpenTelemetry GenAI semantic convention | |
279| `success` | `true` or `false` | |
280| `error` | Error category string when execution failed, such as `Error:ENOENT` or `ShellError`. Contains the full error message instead when the gate is set | `OTEL_LOG_TOOL_DETAILS` |
281| `error_class` | The error category in identifier form, with characters outside letters, digits, and underscores replaced by `_`, such as `Error_ENOENT` or `ShellError`. Carries the category even when `error` carries the full message. Requires Claude Code v2.1.268 or later | |
274282
275283**`claude_code.hook`**
276284