Class SpanExporter

Class Documentation

class SpanExporter

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

Public Functions

virtual ~SpanExporter()
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<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 ForceFlush(std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept

Export all spans that have been exported.


timeout – an optional timeout, the default timeout of 0 means that no timeout is applied.


return true when all data are exported, and false when timeout

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.