---
title: OpenTelemetry 스팬 참조
url: https://platform.claude.com/docs/ko/api/opentelemetry/spans
description: Claude API와 Claude SDK가 내보내는 OpenTelemetry 스팬 및 스팬 속성입니다.
featureMetadata:
  topic:
    title: OpenTelemetry
    url: https://platform.claude.com/docs/en/manage-claude/opentelemetry
  status: beta
---

<Note>
  OpenTelemetry 내보내기는 베타 단계입니다. [서비스별 약관](https://www.anthropic.com/legal/service-specific-terms)의 베타 서비스 섹션을 포함하여 Anthropic과의 계약에 따라 제공됩니다. 스팬 이름과 속성은 베타 기간 동안 변경될 수 있습니다.
</Note>

내보내기를 설정하려면 [Claude SDK에서 OpenTelemetry 사용하기](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/sdk) 및 [Claude API에서 OpenTelemetry 사용하기](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/api)를 참조하세요.

## 스팬 이름 및 종류

| 속성             | SDK 스팬                                                                                                                  | API 스팬                                  |
| -------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `service.name` | 애플리케이션의 `service.name`                                                                                                  | `claude-platform`                       |
| 계측 범위          | `com.anthropic.sdk.<language>` 또는 `com.anthropic.sdk.cli`, 클라우드 플랫폼의 클라이언트에서는 여기에 `.<platform>`이 추가되며, 패키지 버전이 함께 포함됩니다 | `com.anthropic.claude-platform`         |
| 스팬 종류          | 요청에 대한 스팬에서는 `CLIENT`, 그 외에는 `INTERNAL`                                                                                 | 요청에 대한 스팬에서는 `SERVER`, 그 외에는 `INTERNAL` |

* **요청에 대한 스팬**은 요청의 API 메서드 이름을 가집니다. 즉, `anthropic.` 뒤에 API 참조에서의 메서드 경로가 오며, 슬래시 대신 점을 사용하고 `beta`는 포함하지 않습니다. 예를 들어, `client.beta.sessions.events.send()` (csharp, go: `client.Beta.Sessions.Events.Send()`; java: `client.beta().sessions().events().send()`; php: `$client->beta->sessions->events->send()`; ruby: `client.beta.sessions.events.send_()`)는 [세션 이벤트 전송](https://platform.claude.com/docs/ko/api/beta/sessions/events/send) 요청을 보내며, 그 스팬의 이름은 [`anthropic.sessions.events.send`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-events-send)입니다.
* **도구 스팬**은 고정된 이름, 공백, 도구 이름으로 구성됩니다. 예: [`anthropic.tool_use bash`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-tool-use-anthropic-mcp-tool-use-and-anthropic-custom-tool-use).

## 스팬 상태

* **`OK`:** 단계가 완료되었습니다.
* **`ERROR`:** 단계가 실패했습니다.
* **Unset(설정되지 않음):** 애플리케이션이 단계를 취소했습니다. 예를 들어 [`user.interrupt`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_user_interrupt_event) 이벤트를 보낸 경우입니다.

스트림의 스팬은 스트림이 끝날 때 종료됩니다. 애플리케이션이 스트림을 일찍 닫으면 SDK 스팬의 상태는 설정되지 않으므로, [`anthropic.sessions.events.stream`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-method)처럼 완료되지 않는 스트림의 SDK 스팬은 상태가 설정되지 않거나 `ERROR`입니다.

## 속성

속성은 해당하는 것이 있는 경우 [생성형 AI를 위한 OpenTelemetry 시맨틱 규칙](https://github.com/open-telemetry/semantic-conventions-genai)(`gen_ai.*`)을 사용합니다. Anthropic 속성은 `anthropic.`으로 시작합니다. 스팬은 2026년 9월 24일의 커밋 [`e57c543b`](https://github.com/open-telemetry/semantic-conventions-genai/tree/e57c543b4889619eb2a05702471937db5119165d) 시점의 규칙을 따릅니다. 이 규칙은 아직 개발 중입니다.

### 공통 속성

설명에 달리 명시된 경우를 제외하고, 요청에 대한 모든 스팬에는 다음 속성이 있습니다. 다른 스팬에는 처음 세 가지 속성만 있을 수 있습니다:

| 속성                          | 타입       | 설명                                                                                                                                                     |
| --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `gen_ai.provider.name`      | `string` | `anthropic`. 모든 스팬에 포함됩니다.<br />**SDK:** Amazon Bedrock 클라이언트(Mantle 포함)에서는 `aws.bedrock`, Google Cloud's Agent Platform용 클라이언트에서는 `gcp.vertex_ai`입니다. |
| `anthropic.organization.id` | `string` | 조직의 ID입니다.                                                                                                                                             |
| `anthropic.workspace.id`    | `string` | 작업이 실행되는 워크스페이스의 ID입니다.                                                                                                                                |
| `anthropic.request.id`      | `string` | `request-id` 응답 헤더의 값입니다.                                                                                                                              |
| `http.request.method`       | `string` | 요청의 HTTP 메서드이며, 예를 들면 `POST`입니다.                                                                                                                       |
| `http.route`                | `string` | 경로 매개변수에 대한 플레이스홀더가 포함된 엔드포인트의 경로이며, 예를 들면 `/v1/sessions/{session_id}`입니다.                                                                             |
| `http.response.status_code` | `int`    | 최종 응답의 HTTP 상태 코드입니다. 스트림의 경우 헤더와 함께 전송된 상태 코드입니다. 응답이 없으면 존재하지 않습니다.                                                                                  |
| `server.address`            | `string` | 요청이 전송된 호스트로, 예를 들면 `api.anthropic.com`입니다.                                                                                                            |
| `server.port`               | `int`    | 요청 URL의 포트이며, URL에 포트가 없으면 해당 스킴의 기본 포트입니다.                                                                                                            |
| `url.scheme`                | `string` | URL의 스킴이며, 예를 들면 `https`입니다.                                                                                                                           |
| `url.path`                  | `string` | URL의 경로이며, 예를 들면 `/v1/messages`입니다.                                                                                                                    |
| `url.query`                 | `string` | 엔드포인트가 정의하는 쿼리 매개변수만 포함된 URL의 쿼리 문자열입니다. 해당하는 매개변수가 없으면 존재하지 않습니다.                                                                                     |
| `url.full`                  | `string` | 요청의 URL입니다.                                                                                                                                            |

Claude Platform on AWS에서는 API 스팬에 `server.address`, `server.port`, `url.full`이 포함되지 않습니다.

### 세션 속성

Managed Agents 세션에서 스팬에는 다음 속성이 있습니다. 세션의 스팬은 둘 이상의 트레이스에 있을 수 있으므로, 트랜스크립트와 같은 세션 뷰를 구성하려면 [이 ID로 스팬을 그룹화](https://platform.claude.com/docs/ko/manage-claude/opentelemetry#a-managed-agents-session)하세요.

| 속성                       | 타입       | 설명                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `anthropic.session.id`   | `string` | 세션 ID입니다. [`anthropic.sessions.list`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-method)와 같이 하나의 세션에 작용하지 않는 메서드의 스팬에는 존재하지 않습니다.                                                                                                                                                                                                                      |
| `gen_ai.conversation.id` | `string` | 스팬이 속한 세션 스레드의 ID입니다. SDK의 [`conversation_id` (typescript, java, php: `conversationId`; csharp: `ConversationId`; go: `option.WithOpenTelemetryConversationID()`) 옵션](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/sdk#configure-the-sdk)이 이를 사용자 자신의 대화 ID로 대체합니다. 스레드가 없는 SDK 스팬에는 해당 옵션을 설정하지 않는 한 존재하지 않으며, 단일 스레드에 대한 요청을 제외한 API의 Sessions API 요청 스팬에도 존재하지 않습니다. |

### 콘텐츠 속성

<Badge>Content</Badge> 태그가 붙은 속성은 SDK와 API 모두에서 콘텐츠 모드의 스팬에만 있습니다. [가이드에서 콘텐츠 모드의 차이점](https://platform.claude.com/docs/ko/manage-claude/opentelemetry#choose-a-content-mode)을 참조하세요. 이 콘텐츠가 너무 크면 SDK와 API는 [콘텐츠를 줄이고](https://platform.claude.com/docs/ko/manage-claude/opentelemetry#content-limits) `anthropic.content.truncated`를 `true`로 설정합니다. Anthropic의 안전장치가 응답에서 콘텐츠를 보류하면 API의 스팬에도 해당 콘텐츠가 포함되지 않습니다.

메시지 속성은 OpenTelemetry GenAI 규칙의 메시지 형식을 따르는 JSON 문자열입니다. Messages API와 `agent.message` 같은 Managed Agents 메시지 이벤트에서 각 Anthropic 콘텐츠 블록은 하나의 GenAI 규칙 메시지 파트가 됩니다:

| Anthropic 콘텐츠 블록                                                           | GenAI 규칙 메시지 파트                                                                                              |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `text`                                                                     | `text`                                                                                                       |
| `tool_use`, `server_tool_use`                                              | `tool_call`, `computer` 같은 `toolset_name`이 있는 `tool_use` 블록의 경우 `anthropic_toolset_name` 포함                  |
| `mcp_tool_use`                                                             | `anthropic_mcp_server_name`이 있는 `tool_call`                                                                  |
| `tool_result`, `mcp_tool_result`, `web_search_tool_result` 같은 서버 도구의 결과 블록 | `tool_call_response`                                                                                         |
| `thinking`                                                                 | `reasoning`(해당 `thinking` 블록의 서명 없음). `agent.thinking` 이벤트에는 사고 내용이 포함되지 않으므로 Managed Agents 스팬에는 포함되지 않습니다. |
| `image` 같은 그 외의 모든 블록                                                      | 접두사 `anthropic_`이 붙은 블록의 `type`(예: `anthropic_image`). 이 파트에는 다른 필드가 없습니다.                                   |

각 Managed Agents 도구 사용 또는 도구 결과 이벤트도 하나의 GenAI 규칙 메시지 파트가 됩니다:

| Managed Agents 이벤트                                                                          | GenAI 규칙 메시지 파트                             |
| ------------------------------------------------------------------------------------------- | ------------------------------------------- |
| `agent.tool_use`, `agent.custom_tool_use`                                                   | `tool_call`                                 |
| `agent.mcp_tool_use`                                                                        | `anthropic_mcp_server_name`이 있는 `tool_call` |
| `user.tool_result`, `user.custom_tool_result`, `agent.tool_result`, `agent.mcp_tool_result` | `tool_call_response`                        |

### 토큰 사용량

다음 스팬에는 토큰 사용량 속성이 있습니다: [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create), [`anthropic.model_request`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-model-request), [`anthropic.compaction`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-compaction), [`anthropic.session.outcome_evaluation`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-outcome-evaluation). 값은 요청, 모델 요청, 압축 등 해당 스팬의 단계에 대한 것입니다. 각 토큰을 한 번씩만 세려면 [가이드의 토큰 계산 방법](https://platform.claude.com/docs/ko/manage-claude/opentelemetry#count-tokens)을 참조하세요.

| 속성                                                         | 타입    | 설명                                                                                                                                                                             |
| ---------------------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `gen_ai.usage.input_tokens`                                | `int` | 캐시 읽기 및 쓰기를 포함한 입력 토큰입니다.                                                                                                                                                      |
| `gen_ai.usage.output_tokens`                               | `int` | 출력 토큰입니다.                                                                                                                                                                      |
| `gen_ai.usage.cache_write.input_tokens`                    | `int` | 프롬프트 캐시에 쓰인 토큰입니다. [`anthropic.session.outcome_evaluation`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-outcome-evaluation) 스팬에는 존재하지 않습니다.  |
| `anthropic.usage.cache_creation.ephemeral_5m_input_tokens` | `int` | 5분 캐시에 쓰인 토큰입니다. Messages API 요청의 스팬에만 있습니다. 스트리밍 응답의 SDK 스팬에서는 첫 번째 출력 토큰 이전에 쓰인 토큰만 포함합니다.                                                                                   |
| `anthropic.usage.cache_creation.ephemeral_1h_input_tokens` | `int` | 1시간 캐시에 쓰인 토큰입니다. Messages API 요청에 대한 스팬에만 있습니다. 스트리밍 응답의 SDK 스팬에서는 첫 번째 출력 토큰 이전에 쓰인 토큰만 포함합니다.                                                                               |
| `gen_ai.usage.cache_read.input_tokens`                     | `int` | 프롬프트 캐시에서 읽은 토큰입니다. [`anthropic.session.outcome_evaluation`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-outcome-evaluation) 스팬에는 존재하지 않습니다. |

## 스팬

"Span"(스팬)은 애플리케이션의 SDK 또는 API에서 올 수 있으므로, 이 참조의 각 스팬에는 그 출처가 나열되어 있습니다. **Messages API:** 또는 **Managed Agents:**&#xB85C; 시작하는 설명은 해당 제품의 스팬에 대한 것입니다. **SDK:** 또는 **API:**&#xCC98;럼 출처로 시작하는 속성 설명은 해당 출처의 스팬에 대한 것입니다.

### `anthropic.messages.create`

* **출처:** SDK와 API.
* **종류:** SDK에서는 `CLIENT`, API에서는 `SERVER`.
* **SDK 스팬의 부모:** 애플리케이션이 메서드를 호출할 때 현재 활성화된 스팬입니다. 현재 스팬이 없으면 부모가 없습니다.
* **API 스팬의 부모:** 요청의 `traceparent` 헤더에 있는 스팬으로, 요청이 SDK에서 온 경우 SDK 스팬입니다. 헤더가 없으면 API 스팬에는 부모가 없습니다. [`traceparent` 헤더를 보내는 방법](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/api#connect-api-spans-to-your-own-traces)을 참조하세요.
* **SDK 스팬의 자식:** 같은 요청에 대한 API의 스팬.
* **API 스팬의 자식:** 각 모델 요청에 대한 [`anthropic.model_request`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-model-request) 스팬, API가 요청에서 실행하는 서버 도구 또는 MCP 커넥터 도구의 각 사용에 대한 [도구 스팬](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-tool-use-anthropic-mcp-tool-use-and-anthropic-custom-tool-use), 각 압축에 대한 [`anthropic.compaction`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-compaction) 스팬.

SDK는 스트리밍 여부와 관계없이 각 Messages 요청에 대해 이 스팬을 내보냅니다.

API는 인증한 각 [`POST /v1/messages`](https://platform.claude.com/docs/ko/api/messages/create) 요청에 대해 이 스팬을 내보냅니다. [OpenAI 호환 엔드포인트](https://platform.claude.com/docs/ko/cli-sdks-libraries/libraries/openai-sdk)인 `POST /v1/chat/completions`에 대한 요청에는 이 스팬을 내보내지 않습니다.

API는 [폴백 모델](https://platform.claude.com/docs/ko/build-with-claude/refusals-and-fallback)이 요청을 처리하는 경우에도 요청당 하나의 스팬을 내보냅니다.

이 스팬에는 [토큰 사용량 속성](https://platform.claude.com/docs/ko/api/opentelemetry/spans#token-usage)이 있습니다. SDK 스팬에는 모든 [요청에 대한 SDK 스팬](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-resources-method)의 속성도 있습니다.

| 속성                                         | 타입         | 설명                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gen_ai.operation.name`                    | `string`   | `chat`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `gen_ai.request.model`                     | `string`   | 요청의 [`model`](https://platform.claude.com/docs/ko/api/messages/create#create.model)입니다.                                                                                                                                                                                                                                                                                                                                                                                                               |
| `gen_ai.response.id`                       | `string`   | 응답의 [`id`](https://platform.claude.com/docs/ko/api/messages/create#message)입니다.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `gen_ai.response.model`                    | `string`   | 요청을 처리한 모델입니다. 요청이 모델 별칭을 사용하거나 [폴백 모델](https://platform.claude.com/docs/ko/build-with-claude/refusals-and-fallback)이 요청을 처리한 경우 요청된 모델과 다릅니다.                                                                                                                                                                                                                                                                                                                                                        |
| `anthropic.message.stop_reason`            | `string`   | 응답의 [`stop_reason`](https://platform.claude.com/docs/ko/api/messages#stop_reason)입니다. 예: `end_turn`.                                                                                                                                                                                                                                                                                                                                                                                                  |
| `anthropic.response.service_tier`          | `string`   | 요청을 처리한 서비스 티어로, 응답의 [`usage.service_tier`](https://platform.claude.com/docs/ko/api/messages#usage)입니다. [요청에 티어가 할당되는 방식](https://platform.claude.com/docs/ko/api/service-tiers#how-requests-get-assigned-tiers)을 참조하세요.                                                                                                                                                                                                                                                                              |
| `error.type`                               | `string`   | 실패한 요청의 [오류 타입](https://platform.claude.com/docs/ko/api/errors#http-errors)입니다. 예: `rate_limit_error`.<br />**SDK:** [요청에 대한 SDK 스팬](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-resources-method)에 있는 다른 값도 포함합니다.<br />**API:** API가 오류 응답 없이 요청을 종료하면 `api_error`입니다.                                                                                                                                                                                                    |
| `gen_ai.response.time_to_first_chunk`      | `double`   | 스트리밍 응답의 SDK 스팬에만 있습니다. SDK가 요청을 처음 보낸 시점부터 스트림의 첫 번째 `content_block_delta` 이벤트(있는 경우)까지의 초 단위 시간입니다.                                                                                                                                                                                                                                                                                                                                                                                                 |
| `gen_ai.usage.reasoning.output_tokens`     | `int`      | 응답의 사고 토큰입니다. 출력 토큰의 일부입니다. 응답의 사용량에 출력 토큰에 대한 세부 정보가 없으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `anthropic.usage.compaction.input_tokens`  | `int`      | 캐시 읽기 및 쓰기를 포함한 요청의 [압축](https://platform.claude.com/docs/ko/build-with-claude/compaction) 입력 토큰입니다. `gen_ai.usage.input_tokens`에 포함되지 않습니다. 응답에 압축이 없으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                   |
| `anthropic.usage.compaction.output_tokens` | `int`      | 요청의 압축 출력 토큰입니다. `gen_ai.usage.output_tokens`에 포함되지 않습니다. 응답에 압축이 없으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `gen_ai.request.max_tokens`                | `int`      | 요청의 [`max_tokens`](https://platform.claude.com/docs/ko/api/messages/create#create.max_tokens)입니다.                                                                                                                                                                                                                                                                                                                                                                                                     |
| `gen_ai.request.temperature`               | `double`   | 요청의 [`temperature`](https://platform.claude.com/docs/ko/api/messages/create#create.temperature)입니다. 요청에서 설정하지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                          |
| `gen_ai.request.top_p`                     | `double`   | 요청의 [`top_p`](https://platform.claude.com/docs/ko/api/messages/create#create.top_p)입니다. 요청에서 설정하지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                      |
| `gen_ai.request.top_k`                     | `int`      | 요청의 [`top_k`](https://platform.claude.com/docs/ko/api/messages/create#create.top_k)입니다. 요청에서 설정하지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                      |
| `gen_ai.request.stream`                    | `boolean`  | 요청이 [`stream: true`](https://platform.claude.com/docs/ko/api/messages/create#create.stream)를 설정하면 `true`입니다. 그렇지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                       |
| `gen_ai.request.reasoning.level`           | `string`   | 요청의 [`output_config`](https://platform.claude.com/docs/ko/api/messages/create#create.output_config)에 있는 [`effort`](https://platform.claude.com/docs/ko/api/messages/create#create.output_config.effort)입니다. 요청에서 설정하지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                                  |
| `gen_ai.output.type`                       | `string`   | 요청이 출력 형식을 JSON으로 설정하면 `json`입니다. 그렇지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `anthropic.request.service_tier`           | `string`   | 요청의 [`service_tier`](https://platform.claude.com/docs/ko/api/messages/create#create.service_tier)입니다. 요청에서 설정하지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                        |
| `anthropic.thinking.type`                  | `string`   | 요청의 [`thinking.type`](https://platform.claude.com/docs/ko/api/messages/create#create.thinking)입니다. 요청에서 설정하지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                           |
| `anthropic.thinking.budget_tokens`         | `int`      | 요청의 [`thinking`](https://platform.claude.com/docs/ko/api/messages/create#create.thinking) 객체에 있는 [`budget_tokens`](https://platform.claude.com/docs/ko/api/messages#thinking_config_enabled.budget_tokens)입니다. 요청에서 설정하지 않으면 존재하지 않습니다.                                                                                                                                                                                                                                                               |
| `anthropic.beta`                           | `string[]` | SDK 스팬에만 있습니다. 요청의 [`anthropic-beta`](https://platform.claude.com/docs/ko/api/beta/messages/create#create.betas) 헤더에 있는 베타 이름입니다.                                                                                                                                                                                                                                                                                                                                                                     |
| `gen_ai.system_instructions`               | `string`   | <Badge>Content</Badge> OpenTelemetry [`SystemInstructions`](https://github.com/open-telemetry/semantic-conventions-genai/blob/e57c543b4889619eb2a05702471937db5119165d/model/gen-ai/gen-ai-system-instructions.json) 스키마를 따르는 JSON 문자열입니다. 요청의 [`system`](https://platform.claude.com/docs/ko/api/messages/create#create.system) 프롬프트입니다.                                                                                                                                                             |
| `gen_ai.input.messages`                    | `string`   | <Badge>Content</Badge> OpenTelemetry [`InputMessages`](https://github.com/open-telemetry/semantic-conventions-genai/blob/e57c543b4889619eb2a05702471937db5119165d/model/gen-ai/gen-ai-input-messages.json) 스키마를 따르는 JSON 문자열입니다. 요청의 [`messages`](https://platform.claude.com/docs/ko/api/messages/create#create.messages)입니다.                                                                                                                                                                        |
| `gen_ai.output.messages`                   | `string`   | <Badge>Content</Badge> OpenTelemetry [`OutputMessages`](https://github.com/open-telemetry/semantic-conventions-genai/blob/e57c543b4889619eb2a05702471937db5119165d/model/gen-ai/gen-ai-output-messages.json) 스키마를 따르는 JSON 문자열입니다. 하나의 `assistant` 메시지로 표현된 응답의 [`content`](https://platform.claude.com/docs/ko/api/messages/create#message)입니다.<br />**SDK:** 스트림에서는 애플리케이션이 [스트림 추적](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/sdk#trace-a-stream)에 설명된 대로 스트림을 읽는 경우에만 있습니다. |
| `gen_ai.request.stop_sequences`            | `string[]` | <Badge>Content</Badge> 요청의 [`stop_sequences`](https://platform.claude.com/docs/ko/api/messages/create#create.stop_sequences)입니다.                                                                                                                                                                                                                                                                                                                                                                      |

요청에 대한 스팬에는 `web_search_requests`와 같은 응답의 서버 도구 사용 횟수가 없습니다. 대신 API는 서버 도구의 각 사용에 대해 [도구 스팬](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-tool-use-anthropic-mcp-tool-use-and-anthropic-custom-tool-use)을 내보냅니다.

### `anthropic.messages.count_tokens`

* **출처:** SDK. API는 [`POST /v1/messages/count_tokens`](https://platform.claude.com/docs/ko/api/messages/count_tokens)에 대한 스팬을 내보내지 않습니다.
* **종류:** `CLIENT`.
* **부모:** 애플리케이션이 메서드를 호출할 때 현재 활성화된 스팬이며, 현재 스팬이 없으면 없습니다.
* **자식:** 없음.

| 속성                                            | 타입       | 설명                                                      |
| --------------------------------------------- | -------- | ------------------------------------------------------- |
| `gen_ai.request.model`                        | `string` | 요청의 모델입니다.                                              |
| `anthropic.message.count_tokens.input_tokens` | `int`    | 응답에 있는 토큰 수입니다. 이 수는 사용량이 아닙니다. 토큰 사용량을 합산할 때 포함하지 마세요. |

### `anthropic.sessions.create`

다음 자식과 속성을 제외하면 [`anthropic.sessions.<method>`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-method)와 같습니다:

* **SDK 스팬의 자식:** 해당 요청에 대한 API의 스팬.
* **API 스팬의 자식:** 요청에 비어 있지 않은 [`initial_events`](https://platform.claude.com/docs/ko/api/beta/sessions/create#create.initial_events)가 있는 경우, 첫 번째 턴의 [`anthropic.session.turn`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-turn) 스팬.

| 속성                                 | 타입       | 설명                                                             |
| ---------------------------------- | -------- | -------------------------------------------------------------- |
| `gen_ai.agent.id`                  | `string` | 세션이 생성된 에이전트의 ID입니다.                                           |
| `gen_ai.agent.name`                | `string` | 해당 에이전트의 이름입니다.<br />**SDK:** 요청이 실패하면 존재하지 않습니다.              |
| `gen_ai.request.model`             | `string` | 기본 스레드를 실행하는 해당 에이전트의 모델입니다.<br />**SDK:** 요청이 실패하면 존재하지 않습니다. |
| `anthropic.session.environment.id` | `string` | 세션 환경의 ID입니다.                                                  |

### `anthropic.sessions.events.send`

API 스팬의 자식을 제외하면 [`anthropic.sessions.<method>`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-method)와 같습니다.

* **SDK 스팬의 자식:** 해당 요청에 대한 API의 스팬.
* **API 스팬의 자식:** 요청의 이벤트로 인해 시작되는 각 턴의 [`anthropic.session.turn`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-turn) 스팬.

### `anthropic.sessions.update`

API 스팬의 자식을 제외하면 [`anthropic.sessions.<method>`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-method)와 같습니다.

* **SDK 스팬의 자식:** 해당 요청에 대한 API의 스팬.
* **API 스팬의 자식:** 요청이 [세션 예산](https://platform.claude.com/docs/ko/managed-agents/budgets#resume-a-session-at-its-budget)을 늘리거나 제거하여 재개되는 각 턴의 [`anthropic.session.turn`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-turn) 스팬.

### `anthropic.session.turn`

* **출처:** Managed Agents 세션에 대한 API.

* **종류:** `INTERNAL`.

* **부모:** 턴이 시작된 이유에 따라 다릅니다:

  * 비어 있지 않은 [`initial_events`](https://platform.claude.com/docs/ko/api/beta/sessions/create#create.initial_events)로 생성된 세션의 첫 번째 턴인 경우, [`anthropic.sessions.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-create) 스팬.
  * [`user.message`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_user_message_event) 이벤트와 같은 이벤트로 인해 시작된 턴인 경우, 해당 이벤트가 전송된 요청에 대한 [`anthropic.sessions.events.send`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-events-send) 스팬.
  * 요청을 통해 세션 예산이 늘어나거나 제거되어 재개되는 턴인 경우, [`anthropic.sessions.update`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-sessions-update) 스팬.
  * 다른 스레드의 턴인 경우, [세션이 실행하는 에이전트](https://platform.claude.com/docs/ko/managed-agents/multiagent-orchestration)가 이 턴을 시작한 해당 에이전트의 턴의 `anthropic.session.turn` 스팬.
  * 기본 에이전트가 호출한 에이전트처럼 다른 스레드의 에이전트가 응답하거나 턴을 마쳐서 시작되는 턴인 경우, 없음.

* **자식:**

  * 턴 내 각 모델 요청에 대한 [`anthropic.model_request`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-model-request) 스팬.
  * [도구 스팬 섹션에 나열된 경우](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-tool-use-anthropic-mcp-tool-use-and-anthropic-custom-tool-use)를 제외하고, API가 턴에서 도구를 실행할 때마다 생성되는 도구 스팬.
  * 이 턴 동안 세션이 실행하는 에이전트가 다른 스레드에서 시작한 각 턴에 대한 `anthropic.session.turn` 스팬.
  * 이 턴이 시작하는 결과 평가의 각 반복에 대한 [`anthropic.session.outcome_evaluation`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-outcome-evaluation) 스팬.

턴은 해당 스레드가 `running` 상태에 들어갈 때 시작되고 스레드가 그 상태를 벗어날 때 끝납니다.

| 속성                                   | 타입       | 설명                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gen_ai.operation.name`              | `string` | `invoke_agent`                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `gen_ai.agent.id`                    | `string` | 턴의 스레드를 실행하는 에이전트의 ID입니다. [어드바이저](https://platform.claude.com/docs/ko/managed-agents/multiagent-orchestration#advisor-threads) 스레드에는 존재하지 않습니다.                                                                                                                                                                                                                                                                                           |
| `gen_ai.agent.name`                  | `string` | 해당 에이전트의 이름입니다. 어드바이저 스레드에서는 `anthropic.advisor`입니다.                                                                                                                                                                                                                                                                                                                                                                                      |
| `gen_ai.request.model`               | `string` | 해당 에이전트의 모델입니다. 어드바이저 스레드에서는 어드바이저의 모델입니다.                                                                                                                                                                                                                                                                                                                                                                                                |
| `anthropic.session.turn.stop_reason` | `string` | 턴이 끝난 이유로, [`session.thread_status_idle`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_session_thread_status_idle_event) 이벤트의 [`stop_reason.type`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_session_thread_status_idle_event)입니다. 예: `requires_action`. 스레드가 유휴 상태가 되지 않았으면 존재하지 않습니다.                                                                        |
| `error.type`                         | `string` | 턴이 실패한 경우, 턴을 종료한 [`session.error`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_session_error_event) 이벤트의 [`error.type`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_session_error_event)입니다.                                                                                                                                                                   |
| `gen_ai.agent.description`           | `string` | 해당 에이전트의 설명입니다. 어드바이저 스레드이거나 에이전트에 설명이 없으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                     |
| `gen_ai.system_instructions`         | `string` | <Badge>Content</Badge> OpenTelemetry [`SystemInstructions`](https://github.com/open-telemetry/semantic-conventions-genai/blob/e57c543b4889619eb2a05702471937db5119165d/model/gen-ai/gen-ai-system-instructions.json) 스키마를 따르는 JSON 문자열입니다. 턴에 적용되는 시스템 프롬프트입니다. 스레드의 첫 번째 턴에만 있습니다. 어드바이저 스레드에는 존재하지 않습니다.                                                                                                                                |
| `gen_ai.input.messages`              | `string` | <Badge>Content</Badge> OpenTelemetry [`InputMessages`](https://github.com/open-telemetry/semantic-conventions-genai/blob/e57c543b4889619eb2a05702471937db5119165d/model/gen-ai/gen-ai-input-messages.json) 스키마를 따르는 JSON 문자열입니다. 턴의 입력 이벤트로, 사용자 메시지와 도구 결과, [`system.message`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_system_message_event_params) 이벤트, 다른 스레드의 메시지입니다. 어드바이저 스레드에는 존재하지 않습니다. |
| `gen_ai.output.messages`             | `string` | <Badge>Content</Badge> OpenTelemetry [`OutputMessages`](https://github.com/open-telemetry/semantic-conventions-genai/blob/e57c543b4889619eb2a05702471937db5119165d/model/gen-ai/gen-ai-output-messages.json) 스키마를 따르는 JSON 문자열입니다. 턴의 출력 이벤트로, 에이전트의 메시지, 도구 사용, 도구 결과입니다.                                                                                                                                                                |

### `anthropic.model_request`

* **출처:** Messages API 요청 및 Managed Agents 세션에 대한 API.

* **종류:** `INTERNAL`.

* **부모:**

  * **Messages API:** 요청에 대한 [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create) 스팬.
  * **Managed Agents:** 요청을 수행하는 턴의 [`anthropic.session.turn`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-turn) 스팬.

* **자식:** 없음.

Messages API에서 각 스팬은 API 요청 내의 하나의 모델 요청입니다.

이 스팬에는 [토큰 사용량 속성](https://platform.claude.com/docs/ko/api/opentelemetry/spans#token-usage)이 있습니다.

| 속성                      | 타입       | 설명                                                                                                                                                                                                                                                                                                                                                           |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `gen_ai.operation.name` | `string` | Managed Agents 세션의 스팬에만 있으며, 값은 `chat`입니다. Messages API에서는 요청에 대한 [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create) 스팬이 `chat` 작업입니다.                                                                                                                                                     |
| `gen_ai.request.model`  | `string` | 요청의 모델입니다.                                                                                                                                                                                                                                                                                                                                                   |
| `gen_ai.response.model` | `string` | Messages API 요청의 스팬에만 있습니다. 모델 요청을 실행한 모델입니다.                                                                                                                                                                                                                                                                                                                |
| `error.type`            | `string` | **Messages API:** 이 모델 요청 중에 요청이 실패한 경우, [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create) 스팬의 `error.type`입니다.<br />**Managed Agents:** 모델 요청이 실패한 경우 그 [오류 타입](https://platform.claude.com/docs/ko/api/errors#http-errors)입니다. 예: `rate_limit_error`. 모델 요청이 응답 없이 실패하면 `api_error`입니다. |

### `anthropic.tool_use`, `anthropic.mcp_tool_use`, `anthropic.custom_tool_use`

* **출처:** SDK와 API.

* **이름:** `anthropic.tool_use <tool>`, `anthropic.mcp_tool_use <tool>` 또는 `anthropic.custom_tool_use <tool>`이며, 여기서 `<tool>`은 도구의 이름입니다.

* **종류:** `INTERNAL`.

* **SDK 스팬의 부모:** 도구가 시작될 때 애플리케이션에서 현재 활성화된 스팬으로, Messages 도구 러너에서는 [`anthropic.messages.tool_runner`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-tool-runner) 스팬입니다. 현재 스팬이 없으면 부모가 없습니다.

* **API 스팬의 부모:**

  * **Messages API:** API가 도구를 실행하는 요청의 [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create) 스팬.
  * **Managed Agents:** 도구가 실행되는 턴의 [`anthropic.session.turn`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-turn) 스팬. [`user.tool_confirmation`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_user_tool_confirmation_event) 이벤트를 기다리는 도구 사용의 경우, 확인으로 인해 시작되는 턴입니다.
  * 다른 도구가 실행하는 코드에서의 도구 사용의 경우, 해당 도구의 도구 스팬. Messages API에서 그 도구는 [코드 실행 도구](https://platform.claude.com/docs/ko/agents-and-tools/tool-use/code-execution-tool)입니다.

* **SDK 스팬의 자식:** 도구의 코드가 시작하는 스팬.

* **API 스팬의 자식:** 이 도구가 실행하는 코드에서의 각 도구 사용에 대한 도구 스팬. 예를 들어, 코드 실행 도구가 실행하는 코드는 `web_search`를 사용할 수 있습니다.

스팬 이름의 접두사는 도구 유형에 따라 다릅니다:

* `anthropic.tool_use <tool>`은 Messages API에서 [서버 도구](https://platform.claude.com/docs/ko/agents-and-tools/tool-use/server-tools)의 각 사용 또는 Managed Agents의 에이전트 도구 세트에 있는 도구의 각 사용에 대한 스팬입니다. API가 에이전트 도구 세트 도구를 실행하지만, [자체 호스팅 샌드박스](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/sdk#trace-a-self-hosted-sandbox)에서는 환경 워커가 실행합니다.
* `anthropic.mcp_tool_use <tool>`은 SDK, Messages API 및 Managed Agents에서 MCP 도구를 사용할 때마다 생성되는 스팬입니다. SDK에서는 [Messages 도구 러너](https://platform.claude.com/docs/ko/agents-and-tools/tool-use/tool-runner) 또는 [세션 도구 러너](https://platform.claude.com/docs/ko/managed-agents/self-hosted-sandboxes-reference#session-tool-runner)가 실행하는 MCP 헬퍼의 도구입니다. Messages API에서는 도구가 [MCP 커넥터](https://platform.claude.com/docs/ko/agents-and-tools/mcp-connector)에서 제공됩니다. Managed Agents에서 [MCP 서버 연결이 실패](https://platform.claude.com/docs/ko/managed-agents/mcp-connector#handle-connection-and-authentication-failures)하면 스팬 이름에 도구 이름이 포함되지 않습니다.
* `anthropic.custom_tool_use <tool>`은 애플리케이션이 정의하고 도구 러너가 실행하는 도구를 사용할 때마다 생성되는 스팬입니다. 이 스팬은 SDK만 내보냅니다.

API는 다음 경우에 도구 스팬을 내보내지 않습니다:

* 모델이 [사용자 정의 도구](https://platform.claude.com/docs/ko/managed-agents/tools)와 같이 애플리케이션이 실행하는 도구의 사용을 요청하는 경우. SDK의 도구 러너가 도구를 실행하면 도구 러너가 해당 스팬을 내보냅니다.
* **Managed Agents:** 에이전트가 자체 호스팅 샌드박스에서 실행되는 도구를 사용하는 경우. 도구를 실행하는 SDK의 워커가 해당 스팬을 내보냅니다. [자체 호스팅 샌드박스를 트레이스하는 방법](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/sdk#trace-a-self-hosted-sandbox)을 참조하세요.
* **Managed Agents:** 에이전트가 [멀티에이전트](https://platform.claude.com/docs/ko/managed-agents/multiagent-orchestration) 도구 또는 [어드바이저 도구](https://platform.claude.com/docs/ko/managed-agents/multiagent-orchestration#give-the-session-an-advisor)를 사용하는 경우.
* **Managed Agents:** 에이전트가 도구 사용을 요청했지만, 서버가 [`auto` 권한 정책](https://platform.claude.com/docs/ko/managed-agents/permission-policies#let-the-server-evaluate-each-call-with-auto)에 따라 사용을 거부하거나 애플리케이션이 [`user.tool_confirmation`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_user_tool_confirmation_event) 이벤트에서 거부하는 경우.

| 속성                                    | 타입       | 설명                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gen_ai.operation.name`               | `string` | `execute_tool`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `gen_ai.tool.name`                    | `string` | 도구의 이름입니다. 예: `bash`. API 스팬에서 MCP 도구의 이름에는 서버 이름이 포함되지 않습니다. Managed Agents에서 MCP 서버 연결이 실패한 경우, 모델이 생성한 이름이며 콘텐츠 모드의 스팬에만 있습니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `gen_ai.tool.call.id`                 | `string` | **Messages API:** 모델이 도구 사용을 요청한 블록의 `id`로, [`tool_use`](https://platform.claude.com/docs/ko/api/messages#tool_use_block), [`server_tool_use`](https://platform.claude.com/docs/ko/api/messages#server_tool_use_block) 또는 [`mcp_tool_use`](https://platform.claude.com/docs/ko/api/beta/messages#beta_mcp_tool_use_block) 블록입니다.<br />**Managed Agents:** 에이전트가 도구 사용을 요청한 이벤트의 ID로, [`agent.tool_use`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_agent_tool_use_event), [`agent.mcp_tool_use`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_agent_mcp_tool_use_event) 또는 [`agent.custom_tool_use`](https://platform.claude.com/docs/ko/api/beta/sessions/events#beta_managed_agents_agent_custom_tool_use_event) 이벤트입니다. |
| `anthropic.mcp.server.name`           | `string` | MCP 도구의 API 스팬에만 있습니다. 도구의 MCP 서버 이름입니다. Messages API에서는 [`mcp_tool_use`](https://platform.claude.com/docs/ko/api/beta/messages#beta_mcp_tool_use_block) 블록의 [`server_name`](https://platform.claude.com/docs/ko/api/beta/messages#beta_mcp_tool_use_block.server_name)입니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `gen_ai.conversation.id`              | `string` | [세션 속성](https://platform.claude.com/docs/ko/api/opentelemetry/spans#session-attributes)에 설명된 세션 스레드 ID입니다. Messages 도구 러너에서는 [`conversation_id` (typescript, java, php: `conversationId`; csharp: `ConversationId`; go: `option.WithOpenTelemetryConversationID()`) 옵션](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/sdk#configure-the-sdk)으로 전달된 대화 ID이며, 전달되지 않으면 존재하지 않습니다. Messages API 요청에 대한 API 스팬에는 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                            |
| `anthropic.session.id`                | `string` | 세션의 ID입니다. Messages API나 Messages 도구 러너처럼 Managed Agents 세션 외부의 도구 사용에는 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `anthropic.session.thread.id`         | `string` | 세션 도구 러너의 SDK 스팬에만 있습니다. 세션 스레드의 ID입니다. 기본 스레드에서의 도구 사용에는 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `anthropic.tool.evaluated_permission` | `string` | API가 Managed Agents 세션에서 내보내는 스팬에만 있습니다. 도구 사용에 대한 [권한 정책](https://platform.claude.com/docs/ko/managed-agents/permission-policies)을 평가한 결과로, `allow` 또는 `ask`입니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `error.type`                          | `string` | 도구 사용이 실패한 경우의 오류 타입입니다. 도구의 코드가 오류를 발생시키거나 도구가 오류 결과를 반환하면 `tool_error`입니다.<br />**API:** Messages API에서 서버 도구의 오류 결과는 대신 해당 [`error_code`](https://platform.claude.com/docs/ko/api/messages#web_search_tool_result_error.error_code)를 가집니다. 예: `max_uses_exceeded`. Managed Agents에서 MCP 서버 연결이 실패한 경우, 인증이 실패했으면 `mcp_authentication_failed_error`, 그렇지 않으면 `mcp_connection_failed_error`입니다. 도구 사용 중에 요청이 실패한 경우, 요청의 [오류 타입](https://platform.claude.com/docs/ko/api/errors#http-errors)입니다.                                                                                                                                                                                                                                                                                                    |
| `gen_ai.tool.description`             | `string` | SDK 스팬에만 있습니다. 도구 정의의 설명입니다. 설명이 비어 있으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `gen_ai.tool.type`                    | `string` | SDK 스팬에만 있습니다. `function`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `gen_ai.tool.call.arguments`          | `string` | <Badge>Content</Badge> OpenTelemetry [`ToolCallArguments`](https://github.com/open-telemetry/semantic-conventions-genai/blob/e57c543b4889619eb2a05702471937db5119165d/model/gen-ai/gen-ai-tool-call-arguments.json) 스키마를 따르는 JSON 문자열입니다. 도구 사용의 [`input`](https://platform.claude.com/docs/ko/api/messages#tool_use_block)입니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `anthropic.tool_result.content`       | `string` | <Badge>Content</Badge> 콘텐츠 블록 배열 또는 하나의 객체를 담은 JSON 문자열입니다. 모델로 돌아가는 도구 결과의 `content`입니다. 오류 결과에도 있지만, Managed Agents에서 MCP 서버 연결이 실패한 경우는 예외입니다.<br />**API:** Messages API에서는 문자열 `content`가 하나의 [`text`](https://platform.claude.com/docs/ko/api/messages#text_block) 블록을 가진 배열이 됩니다.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### `anthropic.compaction`

* **소스:** Messages API 요청의 경우 API.
* **종류:** `INTERNAL`.
* **부모:** 요청에 대한 [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create) span.
* **자식:** 없음.

이 span에는 compaction의 [토큰 사용량 속성](https://platform.claude.com/docs/ko/api/opentelemetry/spans#token-usage)이 있습니다. [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create)에서는 compaction의 사용량이 `gen_ai.usage.*` 합계 대신 `anthropic.usage.compaction.*` 속성에 있습니다.

| 속성           | 타입       | 설명                                                                                                    |
| ------------ | -------- | ----------------------------------------------------------------------------------------------------- |
| `error.type` | `string` | compaction 중에 요청이 실패한 경우, 요청의 [오류 타입](https://platform.claude.com/docs/ko/api/errors#http-errors)입니다. |

### `anthropic.session.outcome_evaluation`

* **소스:** Managed Agents 세션의 경우 API.
* **종류:** `INTERNAL`.
* **부모:** 반복(iteration)을 시작한 턴의 [`anthropic.session.turn`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-session-turn) span이며, 해당 턴이 반복보다 먼저 끝나는 경우에도 마찬가지입니다.
* **자식:** 없음.

결과가 `interrupted`이면 상태는 설정되지 않으며, 그 외의 결과에서는 `OK`입니다.

이 span에는 [토큰 사용량 속성](https://platform.claude.com/docs/ko/api/opentelemetry/spans#token-usage) 중 두 가지, 즉 `gen_ai.usage.input_tokens`와 `gen_ai.usage.output_tokens`가 있습니다.

| 속성                                                 | 타입       | 설명                                                                                          |
| -------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- |
| `anthropic.session.outcome.id`                     | `string` | 반복이 평가하는 outcome의 ID입니다.                                                                    |
| `anthropic.session.outcome_evaluation.result`      | `string` | 반복의 결과: `satisfied`, `needs_revision`, `max_iterations_reached`, `failed` 또는 `interrupted`. |
| `anthropic.session.outcome_evaluation.iteration`   | `int`    | 반복의 번호입니다.                                                                                  |
| `anthropic.session.outcome_evaluation.explanation` | `string` | <Badge>Content</Badge> 채점기(grader)가 제공한 결과에 대한 설명으로, 일반 텍스트입니다.                             |

### `anthropic.messages.tool_runner`

* **소스:** SDK.
* **종류:** `INTERNAL`.
* **부모:** 루프가 시작될 때 애플리케이션에서 현재 활성화된 span이며, 현재 span이 없으면 없음.
* **자식:** 루프 내 각 요청의 [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create) span과 runner가 실행하는 각 도구 사용의 [도구 span](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-tool-use-anthropic-mcp-tool-use-and-anthropic-custom-tool-use).

이 span은 루프와 함께 종료됩니다. 애플리케이션이 runner를 중지하면 상태는 설정되지 않습니다. 도구의 코드에서 오류가 발생하면 해당 도구 span의 상태는 `ERROR`가 되고 루프는 계속됩니다. 이 span에는 사용량 속성이 없으므로, 사용량은 자식인 [`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create) span에서 읽으세요.

| 속성                       | 타입       | 설명                                                                                                                                                                                                                                                                   |
| ------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gen_ai.operation.name`  | `string` | `invoke_agent`                                                                                                                                                                                                                                                       |
| `gen_ai.request.model`   | `string` | 루프에서 첫 번째 요청의 모델입니다.                                                                                                                                                                                                                                                 |
| `gen_ai.conversation.id` | `string` | [`conversation_id` (typescript, java, php: `conversationId`; csharp: `ConversationId`; go: `option.WithOpenTelemetryConversationID()`) 옵션](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/sdk#configure-the-sdk)으로 전달된 대화 ID입니다. 옵션이 없으면 존재하지 않습니다. |
| `error.type`             | `string` | 루프가 실패한 경우, 루프를 종료시킨 요청의 [오류 타입](https://platform.claude.com/docs/ko/api/errors#http-errors)입니다. runner 자체가 실패한 경우 `client_error`입니다.                                                                                                                                |
| `gen_ai.output.type`     | `string` | 요청이 출력 형식을 JSON으로 설정한 경우 `json`입니다. 그 외에는 존재하지 않습니다.                                                                                                                                                                                                                 |

### `anthropic.messages.batches.<method>`

* **소스:** 모든 Message Batches 메서드의 경우 SDK.
* **종류:** `CLIENT`.
* **부모:** 애플리케이션이 메서드를 호출할 때 현재 활성화된 span이며, 현재 span이 없으면 없음.
* **자식:** 없음.

이 span에는 모든 [요청에 대한 SDK span](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-resources-method)의 속성도 있습니다.

| 속성                                      | 타입       | 설명                                                                                                                             |
| --------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `anthropic.message.batch.id`            | `string` | 메서드가 작동하는 배치의 ID이며, `create`의 경우 새 배치의 ID입니다. `list`와 실패한 `create`에서는 존재하지 않습니다.                                               |
| `anthropic.message.batch.request_count` | `int`    | `create`에만 있습니다. [`requests`](https://platform.claude.com/docs/ko/api/messages/batches/create#create.requests) 배열에 있는 항목 수입니다. |

### `anthropic.sessions.<method>`

* **소스:** SDK와 API.
* **종류:** SDK에서는 `CLIENT`, API에서는 `SERVER`.
* **SDK span의 부모:** 애플리케이션이 메서드를 호출할 때 현재 활성화된 span이며, 현재 span이 없으면 없음.
* **API span의 부모:** 요청의 [`traceparent` 헤더](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/api#connect-api-spans-to-your-own-traces)에 있는 span으로, 요청이 SDK에서 온 경우 SDK span이며, 헤더가 없으면 없음.
* **SDK span의 자식:** 동일한 요청에 대한 API의 span.
* **API span의 자식:** 없음.

API는 [Sessions API](https://platform.claude.com/docs/ko/managed-agents/sessions)의 엔드포인트에 대한 인증된 각 요청마다 `anthropic.sessions.<method>` span을 내보냅니다. Claude Console에서 보낸 메시지나 [예약된 배포](https://platform.claude.com/docs/ko/managed-agents/scheduled-deployments)가 시작하는 세션처럼 플랫폼이 사용자를 대신하여 보내는 요청에도 span이 있으며, 각각 새 trace에 속합니다.

<Accordion title="Span 이름과 엔드포인트">
  | 스팬                                         | 엔드포인트                                                                                                                                     |
  | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
  | `anthropic.sessions.create`                | [`POST /v1/sessions`](https://platform.claude.com/docs/ko/api/beta/sessions/create)                                                       |
  | `anthropic.sessions.list`                  | [`GET /v1/sessions`](https://platform.claude.com/docs/ko/api/beta/sessions/list)                                                          |
  | `anthropic.sessions.retrieve`              | [`GET /v1/sessions/{session_id}`](https://platform.claude.com/docs/ko/api/beta/sessions/retrieve)                                         |
  | `anthropic.sessions.update`                | [`POST /v1/sessions/{session_id}`](https://platform.claude.com/docs/ko/api/beta/sessions/update)                                          |
  | `anthropic.sessions.delete`                | [`DELETE /v1/sessions/{session_id}`](https://platform.claude.com/docs/ko/api/beta/sessions/delete)                                        |
  | `anthropic.sessions.archive`               | [`POST /v1/sessions/{session_id}/archive`](https://platform.claude.com/docs/ko/api/beta/sessions/archive)                                 |
  | `anthropic.sessions.events.send`           | [`POST /v1/sessions/{session_id}/events`](https://platform.claude.com/docs/ko/api/beta/sessions/events/send)                              |
  | `anthropic.sessions.events.list`           | [`GET /v1/sessions/{session_id}/events`](https://platform.claude.com/docs/ko/api/beta/sessions/events/list)                               |
  | `anthropic.sessions.events.stream`         | [`GET /v1/sessions/{session_id}/events/stream`](https://platform.claude.com/docs/ko/api/beta/sessions/events/stream)                      |
  | `anthropic.sessions.resources.add`         | [`POST /v1/sessions/{session_id}/resources`](https://platform.claude.com/docs/ko/api/beta/sessions/resources/add)                         |
  | `anthropic.sessions.resources.list`        | [`GET /v1/sessions/{session_id}/resources`](https://platform.claude.com/docs/ko/api/beta/sessions/resources/list)                         |
  | `anthropic.sessions.resources.retrieve`    | [`GET /v1/sessions/{session_id}/resources/{resource_id}`](https://platform.claude.com/docs/ko/api/beta/sessions/resources/retrieve)       |
  | `anthropic.sessions.resources.update`      | [`POST /v1/sessions/{session_id}/resources/{resource_id}`](https://platform.claude.com/docs/ko/api/beta/sessions/resources/update)        |
  | `anthropic.sessions.resources.delete`      | [`DELETE /v1/sessions/{session_id}/resources/{resource_id}`](https://platform.claude.com/docs/ko/api/beta/sessions/resources/delete)      |
  | `anthropic.sessions.threads.list`          | [`GET /v1/sessions/{session_id}/threads`](https://platform.claude.com/docs/ko/api/beta/sessions/threads/list)                             |
  | `anthropic.sessions.threads.retrieve`      | [`GET /v1/sessions/{session_id}/threads/{thread_id}`](https://platform.claude.com/docs/ko/api/beta/sessions/threads/retrieve)             |
  | `anthropic.sessions.threads.archive`       | [`POST /v1/sessions/{session_id}/threads/{thread_id}/archive`](https://platform.claude.com/docs/ko/api/beta/sessions/threads/archive)     |
  | `anthropic.sessions.threads.events.list`   | [`GET /v1/sessions/{session_id}/threads/{thread_id}/events`](https://platform.claude.com/docs/ko/api/beta/sessions/threads/events/list)   |
  | `anthropic.sessions.threads.events.stream` | [`GET /v1/sessions/{session_id}/threads/{thread_id}/stream`](https://platform.claude.com/docs/ko/api/beta/sessions/threads/events/stream) |
</Accordion>

이 span에는 [세션 속성](https://platform.claude.com/docs/ko/api/opentelemetry/spans#session-attributes)이 있습니다. SDK span에는 모든 [요청에 대한 SDK span](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-resources-method)의 속성도 있습니다.

| 속성           | 타입       | 설명                                                                                                                                                                                                                                                                                                                                      |
| ------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `error.type` | `string` | 실패한 요청의 [오류 타입](https://platform.claude.com/docs/ko/api/errors#http-errors)으로, 예를 들어 `rate_limit_error`입니다.<br />**SDK:** [요청에 대한 SDK span](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-resources-method)에 있는 다른 값들도 포함됩니다.<br />**API:** API가 오류 응답 없이 연결을 닫은 경우, 또는 API의 실패로 인해 스트림이 종료된 경우 `api_error`입니다. |

### `anthropic.environment.work`

* **소스:** CLI와 Python, TypeScript, Go의 SDK.
* **종류:** `INTERNAL`.
* **부모:** environment worker 또는 work poller가 작업 항목을 가져올 때 애플리케이션에서 현재 활성화된 span이며, 현재 span이 없으면 없음. `ant beta:worker poll`에서는 이 span이 루트 span입니다.
* **자식:** environment worker가 작업 항목을 처리하는 동안 보내는 요청에 대한 span과, 작업 항목을 위해 실행하는 각 도구의 [도구 span](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-tool-use-anthropic-mcp-tool-use-and-anthropic-custom-tool-use).

environment worker와 work poller는 self-hosted sandbox에서 작업 항목을 가져가는 [SDK 헬퍼](https://platform.claude.com/docs/ko/managed-agents/self-hosted-sandboxes#sdk-helpers)입니다. 이들은 각 작업 항목마다 하나의 `anthropic.environment.work` span을 내보내며, 이 span은 poll이 작업 항목을 반환한 시점부터 해당 항목의 처리가 끝날 때까지를 포함합니다.

| 속성                              | 타입       | 설명                                                                              |
| ------------------------------- | -------- | ------------------------------------------------------------------------------- |
| `anthropic.environment.id`      | `string` | environment의 ID입니다.                                                             |
| `anthropic.environment.work.id` | `string` | 작업 항목의 ID입니다.                                                                   |
| `anthropic.session.id`          | `string` | 작업 항목이 속한 세션의 ID입니다.                                                            |
| `error.type`                    | `string` | 요청이 처리를 종료시킨 경우, 실패한 요청에 대한 span의 `error.type`입니다. 그 외의 실패에는 `client_error`입니다. |

### `anthropic.<resources>.<method>`

* **소스:** SDK.
* **종류:** `CLIENT`.
* **부모:** 애플리케이션이 메서드를 호출할 때 현재 활성화된 span이며, 현재 span이 없으면 없음.
* **자식:** 없음.

요청을 보내면서 이 페이지에 별도 섹션이 없는 각 SDK 메서드는 `anthropic.<resources>.<method>` span을 내보냅니다. 예를 들어 `anthropic.models.list` 또는 `anthropic.files.upload`입니다. 목록의 이후 각 페이지에 대한 요청은 자체 span을 가집니다.

span은 재시도를 포함하여 요청 전체를 포괄하며, SDK가 값을 가지고 있는 경우 동일한 이름의 API span의 각 속성을 가집니다. SDK는 span을 시작할 때 `http.request.method`와 `http.route`를 설정하므로, sampler가 이를 사용할 수 있습니다.

[`anthropic.messages.create`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-create), [`anthropic.messages.count_tokens`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-count-tokens), [`anthropic.messages.batches.<method>`](https://platform.claude.com/docs/ko/api/opentelemetry/spans#anthropic-messages-batches-method)를 포함한 모든 요청에 대한 SDK span에는 다음 속성이 있습니다:

| 속성                          | 타입       | 설명                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `gen_ai.conversation.id`    | `string` | [`conversation_id` (typescript, java, php: `conversationId`; csharp: `ConversationId`; go: `option.WithOpenTelemetryConversationID()`) 옵션](https://platform.claude.com/docs/ko/manage-claude/opentelemetry/sdk#configure-the-sdk)으로 전달된 대화 ID입니다. 옵션이 없으면 [세션 속성](https://platform.claude.com/docs/ko/api/opentelemetry/spans#session-attributes)에 나열된 Managed Agents 요청에서는 세션 스레드 ID이며, 다른 요청에서는 존재하지 않습니다. |
| `anthropic.<resource>.id`   | `string` | 요청 경로에 있는 각 ID마다 하나의 속성이 있고, 메서드가 생성하는 객체의 ID에 대해 하나의 속성이 있습니다. 이름은 경로에서 단수형으로 가져오며, 예를 들어 `anthropic.session.id` 또는 `anthropic.session.thread.id`입니다.                                                                                                                                                                                                                                                       |
| `gen_ai.agent.id`           | `string` | agent 메서드에서의 agent ID입니다.                                                                                                                                                                                                                                                                                                                                                                                    |
| `gen_ai.memory.store.id`    | `string` | memory store 메서드에서의 memory store ID입니다.                                                                                                                                                                                                                                                                                                                                                                      |
| `gen_ai.memory.record.id`   | `string` | memory 메서드에서의 memory ID입니다.                                                                                                                                                                                                                                                                                                                                                                                  |
| `http.request.resend_count` | `int`    | 재시도 등 어떤 이유로든 SDK가 요청을 다시 보낸 횟수입니다. SDK가 다시 보내지 않은 경우 존재하지 않습니다.                                                                                                                                                                                                                                                                                                                                             |
| `error.type`                | `string` | 실패한 호출의 [오류 타입](https://platform.claude.com/docs/ko/api/errors#http-errors)으로, 예를 들어 `rate_limit_error`입니다. 오류 응답에 오류 타입이 없는 경우 HTTP 상태 코드(예: `502`)입니다. SDK에서 호출이 실패한 경우 `connection_error`, `client_timeout_error` 또는 `client_error`입니다. 서버가 스트림을 조기에 종료한 경우 `api_error`입니다.                                                                                                                               |
| `server.address`            | `string` | 클라이언트 base URL의 호스트로, 기본값은 `api.anthropic.com`입니다. 클라우드 플랫폼의 클라이언트에서는 해당 플랫폼의 호스트입니다.                                                                                                                                                                                                                                                                                                                        |
| `url.query`                 | `string` | 엔드포인트가 정의하는 쿼리 매개변수만 포함한 URL의 쿼리 문자열입니다. 해당 매개변수가 없으면 존재하지 않습니다. metadata-only 모드에서는 쿼리에 `email`과 같은 민감한 매개변수가 있으면 존재하지 않습니다.                                                                                                                                                                                                                                                                                |
| `url.full`                  | `string` | `url.scheme`, `server.address`, base URL에 포트가 있는 경우 포트, `url.path`, `url.query`로 구성된 URL입니다. metadata-only 모드에서는 해당 모드가 `url.query`를 제외할 때마다 존재하지 않습니다.                                                                                                                                                                                                                                                      |
