> ## 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.

# otel

## SplunkAOOTLPExporter

OpenTelemetry OTLP span exporter preconfigured for Splunk AO.

This exporter wraps the standard OTLPSpanExporter with deployment-aware
configuration, authentication, and immutable routing. For most applications, use
SplunkAOSpanProcessor instead, which provides a complete tracing solution.

Routing is captured when the exporter is constructed and remains fixed for its
lifetime. Applications that export to multiple destinations must use a separate
exporter and span processor for each destination.

### export

```python theme={null}
def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult
```

Export through the shared immutable normalization pipeline.

### export\_health

```python theme={null}
def export_health(self) -> ExportHealth
```

Return the current receiver-acknowledgement health snapshot.

### force\_flush

```python theme={null}
def force_flush(self, timeout_millis: int=30000) -> bool
```

Flush the delegate exporter.

### shutdown

```python theme={null}
def shutdown(self) -> None
```

Shut down the delegate exporter.

## SplunkAOSpanProcessor

Complete OpenTelemetry span processor with integrated Splunk AO export functionality.

This processor combines span processing and export capabilities into a single
component that can be directly attached to any OpenTelemetry TracerProvider.
It handles the complete lifecycle of spans from creation to export to Splunk AO.
Project, agent-stream, and experiment routing is fixed when the processor's exporter
is constructed. Use separate processors and exporters for separate destinations.

**Examples**

```python theme={null}
from opentelemetry.sdk.trace import TracerProvider
tracer_provider = TracerProvider()
processor = add_splunk_ao_span_processor(tracer_provider, project="my-project")
```

### export\_health

```python theme={null}
def export_health(self) -> ExportHealth
```

Return the current receiver-acknowledgement health snapshot.

### exporter

```python theme={null}
def exporter(self) -> SpanExporter
```

Access to the underlying Splunk AO OTLP exporter instance.

### force\_flush

```python theme={null}
def force_flush(self, timeout_millis: int=40000) -> bool
```

Force immediate export of all pending spans with specified timeout.

### on\_end

```python theme={null}
def on_end(self, span: ReadableSpan) -> None
```

Handle span completion events by delegating to the underlying processor.

### on\_start

```python theme={null}
def on_start(self, span: Span, parent_context: context.Context | None=None) -> None
```

Handle span start events by delegating to the underlying processor.

### processor

```python theme={null}
def processor(self) -> SpanProcessor
```

Access to the underlying OpenTelemetry span processor instance.

### shutdown

```python theme={null}
def shutdown(self) -> None
```

Gracefully shutdown the processor and flush any remaining spans.

## add\_splunk\_ao\_span\_processor

```python theme={null}
def add_splunk_ao_span_processor(tracer_provider: TracerProvider,
                                 processor: SplunkAOSpanProcessor | None=None,
                                 **processor_kwargs: Any) -> SplunkAOSpanProcessor
```

Construct or accept, register, and return a Splunk AO span processor.
