Class SpanExporter

Class Documentation

class opentelemetry::sdk::trace::SpanExporter

SpanExporter defines the interface that protocol-specific span exporters must implement.

Public Functions

virtual ~SpanExporter() = default
virtual std::unique_ptr<Recordable> MakeRecordable() noexcept = 0

Create a span recordable. This object will be used to record span data and will subsequently be passed to SpanExporter::Export. Vendors can implement custom recordables or use the default SpanData

recordable provided by the SDK.

Note: This method must be callable from multiple threads.


a newly initialized Recordable object

virtual sdk::common::ExportResult Export(const nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>> &spans) noexcept = 0

Exports a batch of span recordables. This method must not be called concurrently for the same exporter instance.


spans – a span of unique pointers to span recordables

virtual bool Shutdown(std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept = 0

Shut down the exporter.


timeout – an optional timeout.


return the status of the operation.