NVIDIA DeepStream SDK API Reference

9.2 Release
trace::Span Class Referenceabstract

Detailed Description

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:

  • at span creation time, using Tracer::StartSpan(),
  • during the span lifetime, using Span::AddLink() or Span::AddLinks().

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.

Inheritance diagram for trace::Span:

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
 

Constructor & Destructor Documentation

◆ Span() [1/6]

trace::Span::Span ( )
default

◆ ~Span() [1/2]

virtual trace::Span::~Span ( )
virtualdefault

◆ Span() [2/6]

trace::Span::Span ( const Span &  )
delete

◆ Span() [3/6]

trace::Span::Span ( Span &&  )
delete

◆ Span() [4/6]

trace::Span::Span ( )
default

◆ ~Span() [2/2]

virtual trace::Span::~Span ( )
virtualdefault

◆ Span() [5/6]

trace::Span::Span ( const Span &  )
delete

◆ Span() [6/6]

trace::Span::Span ( Span &&  )
delete

Member Function Documentation

◆ AddEvent() [1/16]

virtual void trace::Span::AddEvent ( nostd::string_view  name)
pure virtualnoexcept

◆ AddEvent() [2/16]

virtual void trace::Span::AddEvent ( nostd::string_view  name)
pure virtualnoexcept

◆ AddEvent() [3/16]

virtual void trace::Span::AddEvent ( nostd::string_view  name,
common::SystemTimestamp  timestamp 
)
pure virtualnoexcept

◆ AddEvent() [4/16]

virtual void trace::Span::AddEvent ( nostd::string_view  name,
common::SystemTimestamp  timestamp 
)
pure virtualnoexcept

◆ AddEvent() [5/16]

virtual void trace::Span::AddEvent ( nostd::string_view  name,
common::SystemTimestamp  timestamp,
const common::KeyValueIterable &  attributes 
)
pure virtualnoexcept

◆ AddEvent() [6/16]

virtual void trace::Span::AddEvent ( nostd::string_view  name,
common::SystemTimestamp  timestamp,
const common::KeyValueIterable &  attributes 
)
pure virtualnoexcept

◆ AddEvent() [7/16]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
void trace::Span::AddEvent ( nostd::string_view  name,
common::SystemTimestamp  timestamp,
const T &  attributes 
)
inlinenoexcept

Definition at line 100 of file includes/opentelemetry/trace/span.h.

References AddEvent().

◆ AddEvent() [8/16]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
void trace::Span::AddEvent ( nostd::string_view  name,
common::SystemTimestamp  timestamp,
const T &  attributes 
)
inlinenoexcept

Definition at line 100 of file 9.2/includes/opentelemetry/trace/span.h.

References AddEvent().

◆ AddEvent() [9/16]

void trace::Span::AddEvent ( nostd::string_view  name,
common::SystemTimestamp  timestamp,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes 
)
inlinenoexcept

Definition at line 114 of file includes/opentelemetry/trace/span.h.

References AddEvent().

◆ AddEvent() [10/16]

void trace::Span::AddEvent ( nostd::string_view  name,
common::SystemTimestamp  timestamp,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes 
)
inlinenoexcept

◆ AddEvent() [11/16]

virtual void trace::Span::AddEvent ( nostd::string_view  name,
const common::KeyValueIterable &  attributes 
)
inlinevirtualnoexcept

◆ AddEvent() [12/16]

virtual void trace::Span::AddEvent ( nostd::string_view  name,
const common::KeyValueIterable &  attributes 
)
inlinevirtualnoexcept

◆ AddEvent() [13/16]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
void trace::Span::AddEvent ( nostd::string_view  name,
const T &  attributes 
)
inlinenoexcept

Definition at line 109 of file includes/opentelemetry/trace/span.h.

References AddEvent().

◆ AddEvent() [14/16]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
void trace::Span::AddEvent ( nostd::string_view  name,
const T &  attributes 
)
inlinenoexcept

Definition at line 109 of file 9.2/includes/opentelemetry/trace/span.h.

References AddEvent().

◆ AddEvent() [15/16]

void trace::Span::AddEvent ( nostd::string_view  name,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes 
)
inlinenoexcept

Definition at line 124 of file includes/opentelemetry/trace/span.h.

References AddEvent().

◆ AddEvent() [16/16]

void trace::Span::AddEvent ( nostd::string_view  name,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes 
)
inlinenoexcept

◆ End() [1/2]

virtual void trace::Span::End ( const trace::EndSpanOptions &  options = {})
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.

Parameters
optionscan 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.

◆ End() [2/2]

virtual void trace::Span::End ( const trace::EndSpanOptions &  options = {})
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.

Parameters
optionscan 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.

◆ GetContext() [1/2]

virtual trace::SpanContext trace::Span::GetContext ( ) const
pure virtualnoexcept

◆ GetContext() [2/2]

virtual trace::SpanContext trace::Span::GetContext ( ) const
pure virtualnoexcept

◆ IsRecording() [1/2]

virtual bool trace::Span::IsRecording ( ) const
pure virtualnoexcept

◆ IsRecording() [2/2]

virtual bool trace::Span::IsRecording ( ) const
pure virtualnoexcept

◆ operator=() [1/4]

Span& trace::Span::operator= ( const Span &  )
delete

◆ operator=() [2/4]

Span& trace::Span::operator= ( const Span &  )
delete

◆ operator=() [3/4]

Span& trace::Span::operator= ( Span &&  )
delete

◆ operator=() [4/4]

Span& trace::Span::operator= ( Span &&  )
delete

◆ SetAttribute() [1/2]

virtual void trace::Span::SetAttribute ( nostd::string_view  key,
const common::AttributeValue &  value 
)
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.

◆ SetAttribute() [2/2]

virtual void trace::Span::SetAttribute ( nostd::string_view  key,
const common::AttributeValue &  value 
)
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().

◆ SetStatus() [1/2]

virtual void trace::Span::SetStatus ( StatusCode  code,
nostd::string_view  description = "" 
)
pure virtualnoexcept

◆ SetStatus() [2/2]

virtual void trace::Span::SetStatus ( StatusCode  code,
nostd::string_view  description = "" 
)
pure virtualnoexcept

◆ UpdateName() [1/2]

virtual void trace::Span::UpdateName ( nostd::string_view  name)
pure virtualnoexcept

◆ UpdateName() [2/2]

virtual void trace::Span::UpdateName ( nostd::string_view  name)
pure virtualnoexcept

The documentation for this class was generated from the following file: