Class MultiSpanProcessor

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class MultiSpanProcessor : public opentelemetry::sdk::trace::SpanProcessor

Span processor allow hooks for span start and end method invocations.

Built-in span processors are responsible for batching and conversion of spans to exportable representation and passing batches to exporters.

Public Functions

inline MultiSpanProcessor(std::vector<std::unique_ptr<SpanProcessor>> &&processors)
inline void AddProcessor(std::unique_ptr<SpanProcessor> &&processor)
inline virtual std::unique_ptr<Recordable> MakeRecordable() noexcept override

Create a span recordable. This requests a new span recordable from the associated exporter.

Note: This method must be callable from multiple threads.

Returns:

a newly initialized recordable

inline virtual void OnStart(Recordable &span, const opentelemetry::trace::SpanContext &parent_context) noexcept override

OnStart is called when a span is started.

Parameters:
  • span – a recordable for a span that was just started

  • parent_context – The parent context of the span that just started

inline virtual void OnEnd(std::unique_ptr<Recordable> &&span) noexcept override

OnEnd is called when a span is ended.

Parameters:

span – a recordable for a span that was ended

inline virtual bool ForceFlush(std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override

Export all ended spans that have not yet been exported.

Parameters:

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

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

Shut down the processor and do any cleanup required. Ended spans are exported before shutdown. After the call to Shutdown, subsequent calls to OnStart, OnEnd, ForceFlush or Shutdown will return immediately without doing anything.

Parameters:

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

inline ~MultiSpanProcessor() override