OpenTelemetry span reference
The OpenTelemetry spans and span attributes that the Claude API and the Claude SDK emit.
To set up export, see Use OpenTelemetry with the Claude SDK and Use OpenTelemetry with the Claude API.
Span names and kinds
| Property | SDK spans | API spans |
|---|---|---|
service.name | The application's service.name | claude-platform |
| Instrumentation scope | com.anthropic.sdk.<language> or com.anthropic.sdk.cli, plus .<platform> on a cloud platform's client, with the package's version | com.anthropic.claude-platform |
| Span kind | CLIENT on the span for a request, INTERNAL otherwise | SERVER on the span for a request, INTERNAL otherwise |
- Spans for requests have the name of the request's API method:
anthropic.followed by the method's path in the API reference, with dots instead of slashes and withoutbeta. For example,client.beta.sessions.events.send()sends a request to send session events, and its spans have the nameanthropic.sessions.events.send. - Tool spans have a fixed name, a space, and the tool name, for example
anthropic.tool_use bash.
Span status
OK: The step completed.ERROR: The step failed.- Unset: The application canceled the step, for example when it sent a
user.interruptevent.
A stream's span ends when the stream ends. If the application closes the stream early, the SDK span has the status unset, so the SDK span for a stream that never completes, such as anthropic.sessions.events.stream, has the status unset or ERROR.
Attributes
Attributes use the OpenTelemetry semantic conventions for generative AI (gen_ai.*) where one exists. Anthropic attributes start with anthropic.. The spans follow the conventions at commit e57c543b of September 24, 2026. The conventions are still in development.
Common attributes
Every span for a request has the following attributes, except where a description says otherwise. Other spans can have only the first three:
| Attribute | Type | Description |
|---|---|---|
gen_ai.provider.name | string | anthropic. On every span.SDK: aws.bedrock on the Amazon Bedrock clients (Mantle included), and gcp.vertex_ai on the client for Google Cloud's Agent Platform. |
anthropic.organization.id | string | The organization ID. |
anthropic.workspace.id | string | The ID of the workspace that the work runs in. |
anthropic.request.id | string | The value of the request-id response header. |
http.request.method | string | The request's HTTP method, for example POST. |
http.route | string | The endpoint's path, with placeholders for its path parameters, for example /v1/sessions/{session_id}. |
http.response.status_code | int | The final response's HTTP status code. For a stream, the status code sent with the headers. Absent when there was no response. |
server.address | string | The host that the request was sent to, for example api.anthropic.com. |
server.port | int | The request URL's port, or the default port of its scheme when the URL doesn't have one. |
url.scheme | string | The URL's scheme, for example https. |
url.path | string | The URL's path, for example /v1/messages. |
url.query | string | The URL's query string, with only the query parameters that the endpoint defines. Absent when there are none. |
url.full | string | The request's URL. |
server.address, server.port, or url.full.
Session attributes
In a Managed Agents session, spans have the following attributes. A session's spans can be in more than one trace, so to assemble a view of the session, such as a transcript, group its spans by these IDs.
| Attribute | Type | Description |
|---|---|---|
anthropic.session.id | string | The session ID. Absent on the spans for methods that don't act on one session, such as anthropic.sessions.list. |
gen_ai.conversation.id | string | The ID of the session thread that the span belongs to. The SDK's conversation_id option replaces it with your own conversation ID. Absent on SDK spans with no thread unless you set the option, and on API spans for Sessions API requests other than requests to one thread. |
Content attributes
Attributes tagged with Content are only on spans in content mode, from the SDK and the API alike. See how the content modes differ in the guide. When this content is too large, the SDK and the API shorten it and set anthropic.content.truncated to true. If Anthropic's safeguards withhold content from a response, the API's spans don't include that content either.
The message attributes are JSON strings in the message format of the OpenTelemetry GenAI conventions. Each Anthropic content block becomes one GenAI conventions message part, on the Messages API and in Managed Agents message events such as agent.message:
| Anthropic content block | GenAI conventions message part |
|---|---|
text | text |
tool_use, server_tool_use | tool_call, with anthropic_toolset_name for a tool_use block that has a toolset_name, such as computer |
mcp_tool_use | tool_call with anthropic_mcp_server_name |
tool_result, mcp_tool_result, a server tool's result block such as web_search_tool_result | tool_call_response |
thinking | reasoning, without the thinking block's signature. Not in Managed Agents spans, because the agent.thinking event doesn't include the thinking content. |
Any other block, such as image | The block's type with the prefix anthropic_, such as anthropic_image. The part has no other fields. |
Each Managed Agents tool use or tool result event also becomes one GenAI conventions message part:
| Managed Agents event | GenAI conventions message part |
|---|---|
agent.tool_use, agent.custom_tool_use | tool_call |
agent.mcp_tool_use | tool_call with anthropic_mcp_server_name |
user.tool_result, user.custom_tool_result, agent.tool_result, agent.mcp_tool_result | tool_call_response |
Token usage
The following spans have token usage attributes: anthropic.messages.create, anthropic.model_request, anthropic.compaction, and anthropic.session.outcome_evaluation. The values are for each span's step, for example the request, the model request, or the compaction. To count each token once, see how to count tokens in the guide.
| Attribute | Type | Description |
|---|---|---|
gen_ai.usage.input_tokens | int | The input tokens, cache reads and writes included. |
gen_ai.usage.output_tokens | int | The output tokens. |
gen_ai.usage.cache_write.input_tokens | int | The tokens written to the prompt cache. Absent on anthropic.session.outcome_evaluation spans. |
anthropic.usage.cache_creation.ephemeral_5m_input_tokens | int | The tokens written to the 5-minute cache. Only on the spans for Messages API requests. On a streaming response's SDK span, only the tokens written before the first output token. |
anthropic.usage.cache_creation.ephemeral_1h_input_tokens | int | The tokens written to the 1-hour cache. Only on the spans for Messages API requests. On a streaming response's SDK span, only the tokens written before the first output token. |
gen_ai.usage.cache_read.input_tokens | int | The tokens read from the prompt cache. Absent on anthropic.session.outcome_evaluation spans. |
Spans
A span can come from the SDK in the application or from the API, so each span in this reference lists its sources. Descriptions that start with Messages API: or Managed Agents: are for that product's spans. Attribute descriptions that start with a source, such as SDK: or API:, are for that source's spans.
anthropic.messages.create
- Source: The SDK and the API.
- Kind:
CLIENTfrom the SDK,SERVERfrom the API. - Parent of the SDK span: The span that is current in the application when it calls the method. If no span is current, there's no parent.
- Parent of the API span: The span in the request's
traceparentheader, which is the SDK span when the request comes from the SDK. Without the header, the API span has no parent. See how to send thetraceparentheader. - Children of the SDK span: The API span for that request.
- Children of the API span: An
anthropic.model_requestspan for each model request, a tool span for each use of a server tool or an MCP connector tool that the API runs in the request, and ananthropic.compactionspan for each compaction.
The SDK emits this span for each Messages request, streamed or not.
The API emits this span for each POST /v1/messages request that it authenticates. It doesn't emit the span for a request to the OpenAI-compatible endpoint, POST /v1/chat/completions.
The API emits one span for a request, even when a fallback model serves it.
The span has the token usage attributes. The SDK span also has the attributes of every SDK span for a request.
| Attribute | Type | Description |
|---|---|---|
gen_ai.operation.name | string | chat |
gen_ai.request.model | string | The request's model. |
gen_ai.response.id | string | The response's id. |
gen_ai.response.model | string | The model that served the request. It differs from the requested model when the request uses a model alias, or when a fallback model served the request. |
anthropic.message.stop_reason | string | The response's stop_reason, for example end_turn. |
anthropic.response.service_tier | string | The service tier that served the request: the response's usage.service_tier. See how requests get assigned tiers. |
error.type | string | A failed request's error type, for example rate_limit_error.SDK: Also the other values in SDK spans for requests. API: api_error when the API ends the request without an error response. |
gen_ai.response.time_to_first_chunk | double | Only on a streaming response's SDK span. The seconds from when the SDK first sent the request to the stream's first content_block_delta event, if it has one. |
gen_ai.usage.reasoning.output_tokens | int | The response's thinking tokens. They are part of the output tokens. Absent when the response's usage doesn't have details for the output tokens. |
anthropic.usage.compaction.input_tokens | int | Input tokens of the request's compactions, including cache reads and writes. Not part of gen_ai.usage.input_tokens. Absent when the response has no compaction. |
anthropic.usage.compaction.output_tokens | int | Output tokens of the request's compactions. Not part of gen_ai.usage.output_tokens. Absent when the response has no compaction. |
gen_ai.request.max_tokens | int | The request's max_tokens. |
gen_ai.request.temperature | double | The request's temperature. Absent when the request doesn't set it. |
gen_ai.request.top_p | double | The request's top_p. Absent when the request doesn't set it. |
gen_ai.request.top_k | int | The request's top_k. Absent when the request doesn't set it. |
gen_ai.request.stream | boolean | true when the request sets stream: true. Absent otherwise. |
gen_ai.request.reasoning.level | string | The effort in the request's output_config. Absent when the request doesn't set it. |
gen_ai.output.type | string | json when the request sets the output format to JSON. Absent otherwise. |
anthropic.request.service_tier | string | The request's service_tier. Absent when the request doesn't set it. |
anthropic.thinking.type | string | The request's thinking.type. Absent when the request doesn't set it. |
anthropic.thinking.budget_tokens | int | The budget_tokens in the request's thinking object. Absent when the request doesn't set it. |
anthropic.beta | string[] | Only on the SDK span. The beta names in the request's anthropic-beta header. |
gen_ai.system_instructions | string | Content A JSON string that follows the OpenTelemetry SystemInstructions schema. The request's system prompt. |
gen_ai.input.messages | string | Content A JSON string that follows the OpenTelemetry InputMessages schema. The request's messages. |
gen_ai.output.messages | string | Content A JSON string that follows the OpenTelemetry OutputMessages schema. The response's content, as one assistant message.SDK: On a stream, only when the application reads the stream as Tracing a stream describes. |
gen_ai.request.stop_sequences | string[] | Content The request's stop_sequences. |
A request's spans don't have the response's server tool usage counts, such as web_search_requests. Instead, the API emits a tool span for each use of a server tool.
anthropic.messages.count_tokens
- Source: The SDK. The API doesn't emit a span for
POST /v1/messages/count_tokens. - Kind:
CLIENT. - Parent: The span that is current in the application when it calls the method, or none if no span is current.
- Children: None.
| Attribute | Type | Description |
|---|---|---|
gen_ai.request.model | string | The request's model. |
anthropic.message.count_tokens.input_tokens | int | The token count in the response. This count isn't usage. Don't include it when you sum token usage. |
anthropic.sessions.create
The same as anthropic.sessions.<method>, except for the following children and attributes:
- Children of the SDK span: The API span for that request.
- Children of the API span: The first turn's
anthropic.session.turnspan, when the request has non-emptyinitial_events.
| Attribute | Type | Description |
|---|---|---|
gen_ai.agent.id | string | The ID of the agent that the session was created from. |
gen_ai.agent.name | string | That agent's name. SDK: Absent when the request failed. |
gen_ai.request.model | string | The model of that agent, which runs the primary thread. SDK: Absent when the request failed. |
anthropic.session.environment.id | string | The ID of the session's environment. |
anthropic.sessions.events.send
The same as anthropic.sessions.<method>, except for the API span's children.
- Children of the SDK span: The API span for that request.
- Children of the API span: The
anthropic.session.turnspan for each turn that starts because of the request's events.
anthropic.sessions.update
The same as anthropic.sessions.<method>, except for the API span's children.
- Children of the SDK span: The API span for that request.
- Children of the API span: The
anthropic.session.turnspan for each turn that resumes because the request raises or removes the session budget.
anthropic.session.turn
- Source: The API, for Managed Agents sessions.
- Kind:
INTERNAL. - Parent: It depends on why the turn started:
- The
anthropic.sessions.createspan, for the first turn of a session that was created with non-emptyinitial_events. - The
anthropic.sessions.events.sendspan for the request in which the event was sent, for a turn that started because of an event, for example auser.messageevent. - The
anthropic.sessions.updatespan, for a turn that resumes because the session budget was raised or removed through the request. - The
anthropic.session.turnspan for the turn of the agent that the session runs during which that agent started this turn, for a turn on another thread. - None, for a turn that starts because an agent on another thread replied or finished its turn, such as an agent that the primary agent called.
- The
- Children:
- An
anthropic.model_requestspan for each model request in the turn. - A tool span each time the API runs a tool in the turn, except in the cases listed in the tool span section.
- An
anthropic.session.turnspan for each turn that the agent that the session runs started on another thread during this turn. - An
anthropic.session.outcome_evaluationspan for each iteration of an outcome evaluation that this turn starts.
- An
A turn starts when its thread enters the running state and ends when the thread leaves it.
| Attribute | Type | Description |
|---|---|---|
gen_ai.operation.name | string | invoke_agent |
gen_ai.agent.id | string | The ID of the agent that runs the turn's thread. Absent on an advisor thread. |
gen_ai.agent.name | string | That agent's name. anthropic.advisor on an advisor thread. |
gen_ai.request.model | string | That agent's model. On an advisor thread, the advisor's model. |
anthropic.session.turn.stop_reason | string | Why the turn ended: the session.thread_status_idle event's stop_reason.type, for example requires_action. Absent when the thread didn't go idle. |
error.type | string | The error.type of the session.error event that ended the turn, if the turn failed. |
gen_ai.agent.description | string | That agent's description. Absent on an advisor thread or when the agent doesn't have one. |
gen_ai.system_instructions | string | Content A JSON string that follows the OpenTelemetry SystemInstructions schema. The system prompt in effect for the turn. Only on a thread's first turn. Absent on an advisor thread. |
gen_ai.input.messages | string | Content A JSON string that follows the OpenTelemetry InputMessages schema. The turn's input events: user messages and tool results, system.message events, and messages from other threads. Absent on an advisor thread. |
gen_ai.output.messages | string | Content A JSON string that follows the OpenTelemetry OutputMessages schema. The turn's output events: the agent's messages, tool uses, and tool results. |
anthropic.model_request
- Source: The API, for Messages API requests and Managed Agents sessions.
- Kind:
INTERNAL. - Parent:
- Messages API: The
anthropic.messages.createspan for the request. - Managed Agents: The
anthropic.session.turnspan for the turn that makes the request.
- Messages API: The
- Children: None.
On the Messages API, each span is one model request within the API request.
The span has the token usage attributes.
| Attribute | Type | Description |
|---|---|---|
gen_ai.operation.name | string | Only on the spans for Managed Agents sessions, where it's chat. On the Messages API, the anthropic.messages.create span for the request is the chat operation. |
gen_ai.request.model | string | The request's model. |
gen_ai.response.model | string | Only on the spans for Messages API requests. The model that ran the model request. |
error.type | string | Messages API: The anthropic.messages.create span's error.type, if the request failed during this model request.Managed Agents: If the model request failed, its error type, for example rate_limit_error. api_error if the model request failed without a response. |
anthropic.tool_use, anthropic.mcp_tool_use, and anthropic.custom_tool_use
- Source: The SDK and the API.
- Name:
anthropic.tool_use <tool>,anthropic.mcp_tool_use <tool>, oranthropic.custom_tool_use <tool>, where<tool>is the tool's name. - Kind:
INTERNAL. - Parent of the SDK span: The span that is current in the application when the tool starts, which in the Messages tool runner is the
anthropic.messages.tool_runnerspan. If no span is current, there's no parent. - Parent of the API span:
- Messages API: The
anthropic.messages.createspan for the request in which the API runs the tool. - Managed Agents: The
anthropic.session.turnspan for the turn in which the tool runs. For a tool use that waits for auser.tool_confirmationevent, that is the turn that starts because of the confirmation. - For a tool use from code that another tool runs, the tool span for that tool. On the Messages API, that tool is the code execution tool.
- Messages API: The
- Children of the SDK span: The spans that the tool's code starts.
- Children of the API span: A tool span for each tool use from the code that this tool runs. For example, code that the code execution tool runs might use
web_search.
The span name prefix depends on the type of tool:
anthropic.tool_use <tool>is the span for each use of a server tool on the Messages API or of a tool from the agent toolset of Managed Agents. The API runs the agent toolset tools, except in a self-hosted sandbox, where the environment worker runs them.anthropic.mcp_tool_use <tool>is the span for each use of an MCP tool, in the SDK, on the Messages API, and on Managed Agents. In the SDK, it's a tool from an MCP helper that the Messages tool runner or the session tool runner runs. On the Messages API, the tool comes from the MCP connector. On Managed Agents, if the connection to the MCP server fails, the span name doesn't include the tool name.anthropic.custom_tool_use <tool>is the span for each use of a tool that the application defines and a tool runner runs. Only the SDK emits this span.
The API doesn't emit a tool span in the following cases:
- The model asks to use a tool that the application runs, such as a custom tool. If a tool runner in the SDK runs the tool, the tool runner emits its span.
- Managed Agents: The agent uses a tool that runs in a self-hosted sandbox. The worker in the SDK, which runs the tool, emits its span. See how to trace a self-hosted sandbox.
- Managed Agents: The agent uses a multiagent tool or the advisor tool.
- Managed Agents: The agent asks to use a tool, but the server denies the use under the
autopermission policy, or the application denies it in auser.tool_confirmationevent.
| Attribute | Type | Description |
|---|---|---|
gen_ai.operation.name | string | execute_tool |
gen_ai.tool.name | string | The tool's name, for example bash. On API spans, an MCP tool's name doesn't have the server name. On Managed Agents, if the connection to the MCP server failed, it's the name that the model generated and is only on spans in content mode. |
gen_ai.tool.call.id | string | Messages API: The id of the block in which the model asked to use the tool: a tool_use, server_tool_use, or mcp_tool_use block.Managed Agents: The ID of the event in which the agent asked to use the tool: an agent.tool_use, agent.mcp_tool_use, or agent.custom_tool_use event. |
anthropic.mcp.server.name | string | Only on the API spans for MCP tools. The name of the tool's MCP server. On the Messages API, the mcp_tool_use block's server_name. |
gen_ai.conversation.id | string | The session thread ID, as Session attributes describes. In the Messages tool runner, the conversation ID passed with the conversation_id option, and absent without one. Absent on the API spans for a Messages API request. |
anthropic.session.id | string | The session ID. Absent for a tool use outside a Managed Agents session, such as on the Messages API or in the Messages tool runner. |
anthropic.session.thread.id | string | Only on the session tool runner's SDK spans. The session thread ID. Absent for a tool use on the primary thread. |
anthropic.tool.evaluated_permission | string | Only on the spans that the API emits in Managed Agents sessions. The result of evaluating the permission policy for the tool use: allow or ask. |
error.type | string | The error type, if the tool use failed: tool_error when the tool's code raises an error or when the tool returns an error result.API: On the Messages API, a server tool's error result instead has its error_code, for example max_uses_exceeded. On Managed Agents, if the connection to the MCP server failed, mcp_authentication_failed_error when authentication failed, otherwise mcp_connection_failed_error. If the request failed during the tool use, the request's error type. |
gen_ai.tool.description | string | Only on SDK spans. The description in the tool definition. Absent when the description is empty. |
gen_ai.tool.type | string | Only on SDK spans. function |
gen_ai.tool.call.arguments | string | Content A JSON string that follows the OpenTelemetry ToolCallArguments schema. The tool use's input. |
anthropic.tool_result.content | string | Content A JSON string with an array of content blocks or with one object. The content of the tool result that goes back to the model. Also for an error result, except on Managed Agents when the connection to the MCP server failed.API: On the Messages API, a string content becomes an array with one text block. |
anthropic.compaction
- Source: The API, for Messages API requests.
- Kind:
INTERNAL. - Parent: The
anthropic.messages.createspan for the request. - Children: None.
The span has the compaction's token usage attributes. On anthropic.messages.create, a compaction's usage is in the anthropic.usage.compaction.* attributes instead of the gen_ai.usage.* totals.
| Attribute | Type | Description |
|---|---|---|
error.type | string | The request's error type, if the request failed during the compaction. |
anthropic.session.outcome_evaluation
- Source: The API, for Managed Agents sessions.
- Kind:
INTERNAL. - Parent: The
anthropic.session.turnspan for the turn that started the iteration, even if that turn ends before the iteration. - Children: None.
The status is unset when the result is interrupted and OK for any other result.
The span has two of the token usage attributes: gen_ai.usage.input_tokens and gen_ai.usage.output_tokens.
| Attribute | Type | Description |
|---|---|---|
anthropic.session.outcome.id | string | The ID of the outcome that the iteration evaluates. |
anthropic.session.outcome_evaluation.result | string | The iteration's result: satisfied, needs_revision, max_iterations_reached, failed, or interrupted. |
anthropic.session.outcome_evaluation.iteration | int | The iteration number. |
anthropic.session.outcome_evaluation.explanation | string | Content The grader's explanation of the result, as plain text. |
anthropic.messages.tool_runner
- Source: The SDK.
- Kind:
INTERNAL. - Parent: The span that is current in the application when the loop starts, or none if no span is current.
- Children: The
anthropic.messages.createspan for each request in the loop and the tool span for each tool use that the runner runs.
The span ends with the loop. If the application stops the runner, the status is unset. If a tool's code raises an error, its tool span has the status ERROR and the loop continues. The span doesn't have usage attributes, so read the usage from its anthropic.messages.create children.
| Attribute | Type | Description |
|---|---|---|
gen_ai.operation.name | string | invoke_agent |
gen_ai.request.model | string | The model of the loop's first request. |
gen_ai.conversation.id | string | The conversation ID passed with the conversation_id option. Absent without one. |
error.type | string | The error type of the request that ended the loop, if the loop failed. client_error when the runner itself failed. |
gen_ai.output.type | string | json when the requests set the output format to JSON. Absent otherwise. |
anthropic.messages.batches.<method>
- Source: The SDK, for every Message Batches method.
- Kind:
CLIENT. - Parent: The span that is current in the application when it calls the method, or none if no span is current.
- Children: None.
The spans also have the attributes of every SDK span for a request.
| Attribute | Type | Description |
|---|---|---|
anthropic.message.batch.id | string | The ID of the batch that the method acts on, or of the new batch for create. Absent on list and on a failed create. |
anthropic.message.batch.request_count | int | Only on create. The number of items in the requests array. |
anthropic.sessions.<method>
- Source: The SDK and the API.
- Kind:
CLIENTfrom the SDK,SERVERfrom the API. - Parent of the SDK span: The span that is current in the application when it calls the method, or none if no span is current.
- Parent of the API span: The span in the request's
traceparentheader, which is the SDK span when the request comes from the SDK, or none without the header. - Children of the SDK span: The API span for that request.
- Children of the API span: None.
The API emits an anthropic.sessions.<method> span for each authenticated request to an endpoint of the Sessions API. Requests that the platform sends on a user's behalf, such as a message sent in the Claude Console or a session that a scheduled deployment starts, also have one, each in a new trace.
The span has the session attributes. The SDK span also has the attributes of every SDK span for a request.
| Attribute | Type | Description |
|---|---|---|
error.type | string | A failed request's error type, for example rate_limit_error.SDK: Also the other values in SDK spans for requests. API: api_error when the API closed the connection without an error response, or when a stream ended because of a failure in the API. |
anthropic.environment.work
- Source: The CLI and the SDK in Python, TypeScript, and Go.
- Kind:
INTERNAL. - Parent: The span that is current in the application when the environment worker or the work poller gets the work item, or none if no span is current. In
ant beta:worker poll, the span is a root span. - Children: The spans for the requests that the environment worker sends while it handles the work item and the tool span for each tool that it runs for the work item.
The environment worker and the work poller are the SDK helpers that claim work items in a self-hosted sandbox. They emit one anthropic.environment.work span for each work item, from when a poll returns the work item until its handling ends.
| Attribute | Type | Description |
|---|---|---|
anthropic.environment.id | string | The environment ID. |
anthropic.environment.work.id | string | The work item ID. |
anthropic.session.id | string | The ID of the session that the work item belongs to. |
error.type | string | The error.type of the span for the failed request, if a request ended the handling. client_error for any other failure. |
anthropic.<resources>.<method>
- Source: The SDK.
- Kind:
CLIENT. - Parent: The span that is current in the application when it calls the method, or none if no span is current.
- Children: None.
Each SDK method that sends a request and doesn't have a section on this page emits an anthropic.<resources>.<method> span, for example anthropic.models.list or anthropic.files.upload. The request for each later page of a list has its own span.
A span covers its whole request, retries included, and has each attribute of the same-named API span when the SDK has the value. The SDK sets http.request.method and http.route when it starts the span, so a sampler can use them.
Every SDK span for a request, including anthropic.messages.create, anthropic.messages.count_tokens, and anthropic.messages.batches.<method>, has the following attributes:
| Attribute | Type | Description |
|---|---|---|
gen_ai.conversation.id | string | The conversation ID passed with the conversation_id option. Without one, the session thread ID on the Managed Agents requests that Session attributes lists, and absent on other requests. |
anthropic.<resource>.id | string | One attribute for each ID in the request's path and one for the ID of an object that the method creates. The name comes from the path, in the singular, for example anthropic.session.id or anthropic.session.thread.id. |
gen_ai.agent.id | string | The agent ID, on the agent methods. |
gen_ai.memory.store.id | string | The memory store ID, on the memory store methods. |
gen_ai.memory.record.id | string | The memory ID, on the memory methods. |
http.request.resend_count | int | The number of times that the SDK resent the request, for any reason, such as a retry. Absent when the SDK didn't resend it. |
error.type | string | A failed call's error type, for example rate_limit_error. The HTTP status code, for example 502, when the error response doesn't have an error type. connection_error, client_timeout_error, or client_error when the call failed in the SDK. api_error when the server ended a stream early. |
server.address | string | The host of the client's base URL, api.anthropic.com by default. On a cloud platform's client, that platform's host. |
url.query | string | The URL's query string, with only the query parameters that the endpoint defines. Absent when there are none. In metadata-only mode, absent when the query has a sensitive parameter, such as email. |
url.full | string | The URL, made of url.scheme, server.address, the port when the base URL has one, url.path, and url.query. In metadata-only mode, absent whenever that mode leaves out url.query. |
Was this page helpful?