Class DefaultSpan

Inheritance Relationships

Base Type

Class Documentation

class DefaultSpan : public opentelemetry::trace::Span

DefaultSpan provides a non-operational Span that propagates the tracer context by wrapping it inside the Span object.

Public Functions

inline virtual trace::SpanContext GetContext() const noexcept
inline virtual bool IsRecording() const noexcept
inline virtual void SetAttribute(nostd::string_view, const common::AttributeValue&) noexcept
inline virtual void AddEvent(nostd::string_view) noexcept
inline virtual void AddEvent(nostd::string_view, common::SystemTimestamp) noexcept
inline virtual void AddEvent(nostd::string_view, common::SystemTimestamp, const common::KeyValueIterable&) noexcept
inline virtual void AddEvent(nostd::string_view name, const common::KeyValueIterable &attributes) noexcept
inline virtual void SetStatus(StatusCode, nostd::string_view) noexcept
inline virtual void UpdateName(nostd::string_view) noexcept
inline virtual void End(const EndSpanOptions& = {}) noexcept

Mark the end of the Span. Only the timing of the first End call for a given Span will be recorded, and implementations are free to ignore all further calls.


options – can be used to manually define span properties like the end timestamp

inline nostd::string_view ToString() const noexcept
inline DefaultSpan(SpanContext span_context) noexcept
inline DefaultSpan(DefaultSpan &&spn) noexcept
inline DefaultSpan(const DefaultSpan &spn) noexcept

Public Static Functions

static inline DefaultSpan GetInvalid()