> ## Documentation Index
> Fetch the complete documentation index at: https://agent-observability-docs.splunk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# attribute_mapping

## Module

Canonical Splunk AO field and OTLP wire-attribute mapping.

## build\_span\_attributes

```python theme={null}
def build_span_attributes(span: BaseStep,
                          session_id: str | None=None) -> dict[str, AttributeValue]
```

Build preliminary attributes for one proprietary Splunk AO span.

## normalize\_attributes\_for\_export

```python theme={null}
def normalize_attributes_for_export(attrs: Mapping[str, AttributeValue],
                                    *,
                                    enabled: bool=True) -> dict[str, AttributeValue]
```

Return final wire attributes without mutating the source mapping.

## set\_agent\_attributes

```python theme={null}
def set_agent_attributes(attrs: MutableMapping[str, AttributeValue],
                         span: AgentSpan) -> None
```

Map agent fields.

## set\_common\_attributes

```python theme={null}
def set_common_attributes(attrs: MutableMapping[str, AttributeValue],
                          span: BaseStep,
                          session_id: str | None=None) -> None
```

Map fields shared by every proprietary span type.

## set\_control\_attributes

```python theme={null}
def set_control_attributes(attrs: MutableMapping[str, AttributeValue],
                           span: ControlSpan) -> None
```

Map control identity, context, result, and content fields.

## set\_dataset\_attributes

```python theme={null}
def set_dataset_attributes(attrs: MutableMapping[str, AttributeValue],
                           span: BaseStep) -> None
```

Map optional dataset context fields.

## set\_llm\_attributes

```python theme={null}
def set_llm_attributes(attrs: MutableMapping[str, AttributeValue],
                       span: LlmSpan) -> None
```

Map LLM request, response, content, and metric fields.

## set\_retriever\_attributes

```python theme={null}
def set_retriever_attributes(attrs: MutableMapping[str, AttributeValue],
                             span: RetrieverSpan) -> None
```

Map retrieval query and document fields.

## set\_tool\_attributes

```python theme={null}
def set_tool_attributes(attrs: MutableMapping[str, AttributeValue],
                        span: ToolSpan) -> None
```

Map tool execution fields.

## set\_workflow\_attributes

```python theme={null}
def set_workflow_attributes(attrs: MutableMapping[str, AttributeValue],
                            span: WorkflowSpan) -> None
```

Map workflow fields.
