

# Span fields

Each span is named after its operation, for example `AgenticRetrieve`. Spans record only counts, flags, and known values. They never record the content that you send or receive, such as message text, queries, filters, results, or error messages.

## Fields on every span
<a name="fields-on-every-span"></a>

The following table lists the fields on every span.


| Field | Description | 
| --- | --- | 
|  `aws.operation.name`  | The operation that was called, for example `SearchAgentContext`. | 
|  `aws.request.id`  | The request ID that AWS Context returned to the caller. | 
|  `aws.account.id`  | The account that made the call. | 
|  `aws.resource.arn`  | The ARN of the Agent Context. | 
|  `aws.resource.type`  |  `AWS::Context::AgentContext`. | 
|  `aws.xray.origin`  |  `AWS::Context::AgentContext`. | 
|  `http.method`  | The HTTP method of the operation. | 
|  `http.response.status_code`  | The HTTP status code that the caller received. | 
|  `latency_ms`  | The time in milliseconds from the start of the call to its end. For `AgenticRetrieveStream`, this covers the whole stream. | 
|  `error.type`  | Present only when the call fails. Contains the name of the error. The span status is `ERROR` for a server error (HTTP 5xx), and is not set for a client error (HTTP 4xx). | 

Each span also has these resource fields:


| Field | Description | 
| --- | --- | 
|  `service.name`  | The ID of the Agent Context. | 
|  `cloud.resource_id`  | The ARN of the Agent Context. | 
|  `cloud.region`  | The Region of the call. | 

## AgenticRetrieve fields
<a name="agenticretrieve-fields"></a>


| Field | Description | 
| --- | --- | 
|  `aws.context.agentic_retrieve.message_count`  | The number of messages in the request. | 
|  `aws.context.agentic_retrieve.retrieved_context_count`  | The number of items in `retrievedContext` in the response. | 

## AgenticRetrieveStream fields
<a name="agenticretrievestream-fields"></a>


| Field | Description | 
| --- | --- | 
|  `aws.context.agentic_retrieve_stream.message_count`  | The number of messages in the request. | 
|  `aws.context.agentic_retrieve_stream.planning_step_count`  | The number of planning steps that finished. | 
|  `aws.context.agentic_retrieve_stream.warning_count`  | The number of finished steps with at least one warning. This counts steps, not warnings. | 
|  `aws.context.agentic_retrieve_stream.failure_count`  | The number of steps that ended with the status `FAILED`. | 
|  `aws.context.agentic_retrieve_stream.retrieved_context_count`  | The number of items in the final result event. This field is absent if the stream ended before the final event. | 

## SearchAgentContext fields
<a name="searchagentcontext-fields"></a>


| Field | Description | 
| --- | --- | 
|  `aws.context.search_agent_context.search_type`  | The search type in the request. For the values, see `SearchAgentContext` in the * AWS Context API Reference*. | 
|  `aws.context.search_agent_context.max_results`  | The page size that the caller asked for. | 
|  `aws.context.search_agent_context.filter_count`  | The number of comparisons in the filter: 0 with no filter, 1 for a single comparison, otherwise the number of comparisons in `andAll`. | 
|  `aws.context.search_agent_context.result_count`  | The number of items returned. | 

## TraverseAgentContext fields
<a name="traverseagentcontext-fields"></a>


| Field | Description | 
| --- | --- | 
|  `aws.context.traverse_agent_context.max_depth`  | The maximum depth in `traversalStrategy`. | 
|  `aws.context.traverse_agent_context.direction`  | The direction in `traversalStrategy`. For the values, see `TraverseAgentContext` in the * AWS Context API Reference*. | 
|  `aws.context.traverse_agent_context.edge_type_count`  | The number of edge types in the strategy. | 
|  `aws.context.traverse_agent_context.max_results`  | The page size that the caller asked for. | 
|  `aws.context.traverse_agent_context.result_count`  | The number of items returned. | 

## Example span
<a name="traces-example-span"></a>

The following example shows a successful `AgenticRetrieve` span.

```json
{
    "name": "AgenticRetrieve",
    "kind": "SERVER",
    "traceId": "6b05b39169087566e2e348d8b3a6a51c",
    "spanId": "3c6a721a5681ee00",
    "parentSpanId": "b32ae34fe3bc92ee",
    "flags": 0,
    "startTimeUnixNano": 1795535762924000000,
    "endTimeUnixNano": 1795535772054000000,
    "durationNano": 9130000000,
    "status": { "code": "UNSET" },
    "attributes": {
        "aws.operation.name": "AgenticRetrieve",
        "aws.request.id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "aws.account.id": "111122223333",
        "aws.resource.arn": "arn:aws:context:us-east-1:111122223333:agent-context/ac-1234567890abcdef",
        "aws.resource.type": "AWS::Context::AgentContext",
        "aws.xray.origin": "AWS::Context::AgentContext",
        "http.method": "POST",
        "http.response.status_code": 200,
        "http.status_code": 200,
        "latency_ms": 9129,
        "aws.context.agentic_retrieve.message_count": 1,
        "aws.context.agentic_retrieve.retrieved_context_count": 49,
        "aws.local.service": "ac-1234567890abcdef",
        "aws.local.operation": "AgenticRetrieve",
        "aws.span.kind": "SERVER",
        "telemetry.extended": "true"
    },
    "resource": {
        "attributes": {
            "service.name": "ac-1234567890abcdef",
            "cloud.resource_id": "arn:aws:context:us-east-1:111122223333:agent-context/ac-1234567890abcdef",
            "cloud.region": "us-east-1"
        }
    }
}
```

Spans can also include other fields that aren’t described on this page.