Class CompositePropagator

Inheritance Relationships

Base Type

  • public opentelemetry::context::propagation::TextMapPropagator

Class Documentation

class CompositePropagator : public opentelemetry::context::propagation::TextMapPropagator

Public Functions

inline CompositePropagator(std::vector<std::unique_ptr<TextMapPropagator>> propagators)
inline void Inject(TextMapCarrier &carrier, const context::Context &context) noexcept override

Run each of the configured propagators with the given context and carrier. Propagators are run in the order they are configured, so if multiple propagators write the same carrier key, the propagator later in the list will “win”.

Parameters:
  • carrier – Carrier into which context will be injected

  • context – Context to inject

inline context::Context Extract(const TextMapCarrier &carrier, context::Context &context) noexcept override

Run each of the configured propagators with the given context and carrier. Propagators are run in the order they are configured, so if multiple propagators write the same context key, the propagator later in the list will “win”.

Parameters:
  • carrier – Carrier from which to extract context

  • context – Context to add values to

inline bool Fields(nostd::function_ref<bool(nostd::string_view)> callback) const noexcept override

Invoke callback with fields set to carrier by inject method for all the configured propagators Returns true if all invocation return true