addSpanExporter

abstract fun addSpanExporter(exporter: SpanExporter)(source)

Registers exporter wrapped in a batchSpanProcessor - the OTel-recommended default for production deployments. Spans are buffered and flushed on a worker so the agent never blocks on network I/O at the span end.

For full control over the processor (custom batching parameters, custom processor implementations) use addSpanProcessor instead.

For Java SDK exporters, wrap with toOtelKotlinSpanExporter() from the compat package first.

Parameters

exporter

The Kotlin OTel SDK SpanExporter to register.