Class Span

Inheritance Relationships

Derived Types

Class Documentation

class Span

A Span represents a single operation within a Trace.

Subclassed by opentelemetry::trace::DefaultSpan, opentelemetry::trace::NoopSpan

Public Functions

Span() = default
virtual ~Span() = default
Span(const Span&) = delete
Span(Span&&) = delete
Span &operator=(const Span&) = delete
Span &operator=(Span&&) = delete
virtual void SetAttribute(nostd::string_view key, const common::AttributeValue &value) noexcept = 0
virtual void AddEvent(nostd::string_view name) noexcept = 0
virtual void AddEvent(nostd::string_view name, common::SystemTimestamp timestamp) noexcept = 0
virtual void AddEvent(nostd::string_view name, common::SystemTimestamp timestamp, const common::KeyValueIterable &attributes) noexcept = 0
inline virtual void AddEvent(nostd::string_view name, const common::KeyValueIterable &attributes) noexcept
template<class T, nostd::enable_if_t<common::detail::is_key_value_iterable<T>::value>* = nullptr>
inline void AddEvent(nostd::string_view name, common::SystemTimestamp timestamp, const T &attributes) noexcept
template<class T, nostd::enable_if_t<common::detail::is_key_value_iterable<T>::value>* = nullptr>
inline void AddEvent(nostd::string_view name, const T &attributes) noexcept
inline void AddEvent(nostd::string_view name, common::SystemTimestamp timestamp, std::initializer_list<std::pair<nostd::string_view, common::AttributeValue>> attributes) noexcept
inline void AddEvent(nostd::string_view name, std::initializer_list<std::pair<nostd::string_view, common::AttributeValue>> attributes) noexcept
virtual void SetStatus(StatusCode code, nostd::string_view description = "") noexcept = 0
virtual void UpdateName(nostd::string_view name) noexcept = 0
virtual void End(const trace::EndSpanOptions &options = {}) noexcept = 0

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.

Parameters

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

virtual trace::SpanContext GetContext() const noexcept = 0
virtual bool IsRecording() const noexcept = 0