Class SpanExporter

Class Documentation

class SpanExporter

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

Public Functions

SpanExporter()
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.

Returns

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.

Parameters

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.

Parameters

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

Returns

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.

Parameters

timeout – an optional timeout.

Returns

return the status of the operation.