A Span represents a single operation within a Trace.
Span attributes can be provided:
Please note that head samplers, in the SDK (opentelemetry::sdk::trace::Sampler), can only make sampling decisions based on data known at span creation time.
When attributes are known early, adding attributes with opentelemetry::trace::Tracer::StartSpan() is preferable.
Attributes added or changed with Span::SetAttribute() can not change a sampler decision.
Likewise, links can be provided:
When links are known early, adding links with opentelemetry::trace::Tracer::StartSpan() is preferable.
Links added with Span::AddLink() or Span::AddLinks() can not change a sampler decision.
Definition at line 54 of file includes/opentelemetry/trace/span.h.

Public Member 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 |
| Sets an attribute on the Span (ABI). More... | |
| 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 |
| 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> | |
| 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> | |
| void | AddEvent (nostd::string_view name, const T &attributes) noexcept |
| void | AddEvent (nostd::string_view name, common::SystemTimestamp timestamp, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >> attributes) noexcept |
| 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. More... | |
| virtual trace::SpanContext | GetContext () const noexcept=0 |
| virtual bool | IsRecording () const noexcept=0 |
| 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 |
| Sets an attribute on the Span (ABI). More... | |
| 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 |
| 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> | |
| 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> | |
| void | AddEvent (nostd::string_view name, const T &attributes) noexcept |
| void | AddEvent (nostd::string_view name, common::SystemTimestamp timestamp, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >> attributes) noexcept |
| 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. More... | |
| virtual trace::SpanContext | GetContext () const noexcept=0 |
| virtual bool | IsRecording () const noexcept=0 |
|
default |
|
virtualdefault |
|
delete |
|
delete |
|
default |
|
virtualdefault |
|
delete |
|
delete |
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
Referenced by plugin::Span::AddEvent(), and AddEvent().
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
|
inlinenoexcept |
Definition at line 100 of file includes/opentelemetry/trace/span.h.
References AddEvent().
|
inlinenoexcept |
Definition at line 100 of file 9.2/includes/opentelemetry/trace/span.h.
References AddEvent().
|
inlinenoexcept |
Definition at line 114 of file includes/opentelemetry/trace/span.h.
References AddEvent().
|
inlinenoexcept |
Definition at line 114 of file 9.2/includes/opentelemetry/trace/span.h.
References AddEvent(), and nostd::span< T, Extent >::begin().
|
inlinevirtualnoexcept |
Reimplemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
Definition at line 92 of file 9.2/includes/opentelemetry/trace/span.h.
References AddEvent().
|
inlinevirtualnoexcept |
Reimplemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
Definition at line 92 of file includes/opentelemetry/trace/span.h.
References AddEvent().
|
inlinenoexcept |
Definition at line 109 of file includes/opentelemetry/trace/span.h.
References AddEvent().
|
inlinenoexcept |
Definition at line 109 of file 9.2/includes/opentelemetry/trace/span.h.
References AddEvent().
|
inlinenoexcept |
Definition at line 124 of file includes/opentelemetry/trace/span.h.
References AddEvent().
|
inlinenoexcept |
Definition at line 124 of file 9.2/includes/opentelemetry/trace/span.h.
References AddEvent(), and nostd::span< T, Extent >::begin().
|
pure virtualnoexcept |
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 |
Implemented in plugin::Span, plugin::Span, trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, and trace::DefaultSpan.
|
pure virtualnoexcept |
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 |
Implemented in plugin::Span, plugin::Span, trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, and trace::DefaultSpan.
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, plugin::Span, plugin::Span, trace::DefaultSpan, and trace::DefaultSpan.
Referenced by plugin::Span::GetContext().
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, plugin::Span, plugin::Span, trace::DefaultSpan, and trace::DefaultSpan.
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, plugin::Span, plugin::Span, trace::DefaultSpan, and trace::DefaultSpan.
Referenced by plugin::Span::IsRecording().
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, plugin::Span, plugin::Span, trace::DefaultSpan, and trace::DefaultSpan.
|
pure virtualnoexcept |
Sets an attribute on the Span (ABI).
If the Span previously contained a mapping for the key, the old value is replaced.
See comments about sampling in opentelemetry::trace::Span
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
|
pure virtualnoexcept |
Sets an attribute on the Span (ABI).
If the Span previously contained a mapping for the key, the old value is replaced.
See comments about sampling in opentelemetry::trace::Span
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
Referenced by plugin::Span::SetAttribute().
|
pure virtualnoexcept |
Implemented in plugin::Span, plugin::Span, trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, and trace::DefaultSpan.
|
pure virtualnoexcept |
Implemented in plugin::Span, plugin::Span, trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, and trace::DefaultSpan.
Referenced by plugin::Span::SetStatus().
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
|
pure virtualnoexcept |
Implemented in trace::NoopSpan, trace::NoopSpan, trace::DefaultSpan, trace::DefaultSpan, plugin::Span, and plugin::Span.
Referenced by plugin::Span::UpdateName().