NVIDIA DeepStream SDK API Reference

9.2 Release
trace::Tracer Class Referenceabstract

Detailed Description

Handles span creation and in-process context propagation.

This class provides methods for manipulating the context, creating spans, and controlling spans' lifecycles.

Definition at line 27 of file includes/opentelemetry/trace/tracer.h.

Inheritance diagram for trace::Tracer:

Public Member Functions

virtual ~Tracer ()=default
 
virtual nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const common::KeyValueIterable &attributes, const SpanContextKeyValueIterable &links, const StartSpanOptions &options={}) noexcept=0
 Starts a span. More...
 
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const StartSpanOptions &options={}) noexcept
 
template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const T &attributes, const StartSpanOptions &options={}) noexcept
 
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const common::KeyValueIterable &attributes, const StartSpanOptions &options={}) noexcept
 
template<class T , class U , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr, nostd::enable_if_t< detail::is_span_context_kv_iterable< U >::value > * = nullptr>
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const T &attributes, const U &links, const StartSpanOptions &options={}) noexcept
 
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >> attributes, const StartSpanOptions &options={}) noexcept
 
template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const T &attributes, std::initializer_list< std::pair< SpanContext, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>>> links, const StartSpanOptions &options={}) noexcept
 
template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >> attributes, const T &links, const StartSpanOptions &options={}) noexcept
 
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >> attributes, std::initializer_list< std::pair< SpanContext, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>>> links, const StartSpanOptions &options={}) noexcept
 
virtual ~Tracer ()=default
 
virtual nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const common::KeyValueIterable &attributes, const SpanContextKeyValueIterable &links, const StartSpanOptions &options={}) noexcept=0
 Starts a span. More...
 
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const StartSpanOptions &options={}) noexcept
 
template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const T &attributes, const StartSpanOptions &options={}) noexcept
 
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const common::KeyValueIterable &attributes, const StartSpanOptions &options={}) noexcept
 
template<class T , class U , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr, nostd::enable_if_t< detail::is_span_context_kv_iterable< U >::value > * = nullptr>
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const T &attributes, const U &links, const StartSpanOptions &options={}) noexcept
 
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >> attributes, const StartSpanOptions &options={}) noexcept
 
template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, const T &attributes, std::initializer_list< std::pair< SpanContext, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>>> links, const StartSpanOptions &options={}) noexcept
 
template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >> attributes, const T &links, const StartSpanOptions &options={}) noexcept
 
nostd::shared_ptr< Span > StartSpan (nostd::string_view name, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >> attributes, std::initializer_list< std::pair< SpanContext, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>>> links, const StartSpanOptions &options={}) noexcept
 

Static Public Member Functions

static Scope WithActiveSpan (nostd::shared_ptr< Span > &span) noexcept
 Set the active span. More...
 
static nostd::shared_ptr< Span > GetCurrentSpan () noexcept
 Get the currently active span. More...
 
static Scope WithActiveSpan (nostd::shared_ptr< Span > &span) noexcept
 Set the active span. More...
 
static nostd::shared_ptr< Span > GetCurrentSpan () noexcept
 Get the currently active span. More...
 

Constructor & Destructor Documentation

◆ ~Tracer() [1/2]

virtual trace::Tracer::~Tracer ( )
virtualdefault

◆ ~Tracer() [2/2]

virtual trace::Tracer::~Tracer ( )
virtualdefault

Member Function Documentation

◆ GetCurrentSpan() [1/2]

static nostd::shared_ptr<Span> trace::Tracer::GetCurrentSpan ( )
inlinestaticnoexcept

Get the currently active span.

Returns
the currently active span, or an invalid default span if no span is active.

Definition at line 153 of file includes/opentelemetry/trace/tracer.h.

References trace::SpanContext::GetInvalid(), context::RuntimeContext::GetValue(), nostd::holds_alternative(), and trace::kSpanKey.

◆ GetCurrentSpan() [2/2]

static nostd::shared_ptr<Span> trace::Tracer::GetCurrentSpan ( )
inlinestaticnoexcept

Get the currently active span.

Returns
the currently active span, or an invalid default span if no span is active.

Definition at line 153 of file 9.2/includes/opentelemetry/trace/tracer.h.

References trace::SpanContext::GetInvalid(), context::RuntimeContext::GetValue(), nostd::holds_alternative(), and trace::kSpanKey.

◆ StartSpan() [1/18]

virtual nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const common::KeyValueIterable &  attributes,
const SpanContextKeyValueIterable &  links,
const StartSpanOptions &  options = {} 
)
pure virtualnoexcept

Starts a span.

Optionally sets attributes at Span creation from the given key/value pairs.

Attributes will be processed in order, previous attributes with the same key will be overwritten.

Implemented in trace::NoopTracer, trace::NoopTracer, plugin::Tracer, and plugin::Tracer.

◆ StartSpan() [2/18]

virtual nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const common::KeyValueIterable &  attributes,
const SpanContextKeyValueIterable &  links,
const StartSpanOptions &  options = {} 
)
pure virtualnoexcept

Starts a span.

Optionally sets attributes at Span creation from the given key/value pairs.

Attributes will be processed in order, previous attributes with the same key will be overwritten.

Implemented in trace::NoopTracer, trace::NoopTracer, plugin::Tracer, and plugin::Tracer.

◆ StartSpan() [3/18]

nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const common::KeyValueIterable &  attributes,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 59 of file includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [4/18]

nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const common::KeyValueIterable &  attributes,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 59 of file 9.2/includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [5/18]

nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 44 of file includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [6/18]

nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 44 of file 9.2/includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [7/18]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const T &  attributes,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 52 of file includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [8/18]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const T &  attributes,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 52 of file 9.2/includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [9/18]

template<class T , class U , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr, nostd::enable_if_t< detail::is_span_context_kv_iterable< U >::value > * = nullptr>
nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const T &  attributes,
const U &  links,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 70 of file 9.2/includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [10/18]

template<class T , class U , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr, nostd::enable_if_t< detail::is_span_context_kv_iterable< U >::value > * = nullptr>
nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const T &  attributes,
const U &  links,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 70 of file includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [11/18]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const T &  attributes,
std::initializer_list< std::pair< SpanContext, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>>>  links,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 90 of file 9.2/includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [12/18]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
const T &  attributes,
std::initializer_list< std::pair< SpanContext, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>>>  links,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 90 of file includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [13/18]

nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 79 of file 9.2/includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [14/18]

nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 79 of file includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [15/18]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes,
const T &  links,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

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

◆ StartSpan() [16/18]

template<class T , nostd::enable_if_t< common::detail::is_key_value_iterable< T >::value > * = nullptr>
nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes,
const T &  links,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

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

◆ StartSpan() [17/18]

nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes,
std::initializer_list< std::pair< SpanContext, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>>>  links,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 121 of file includes/opentelemetry/trace/tracer.h.

◆ StartSpan() [18/18]

nostd::shared_ptr<Span> trace::Tracer::StartSpan ( nostd::string_view  name,
std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>  attributes,
std::initializer_list< std::pair< SpanContext, std::initializer_list< std::pair< nostd::string_view, common::AttributeValue >>>>  links,
const StartSpanOptions &  options = {} 
)
inlinenoexcept

Definition at line 121 of file 9.2/includes/opentelemetry/trace/tracer.h.

◆ WithActiveSpan() [1/2]

static Scope trace::Tracer::WithActiveSpan ( nostd::shared_ptr< Span > &  span)
inlinestaticnoexcept

Set the active span.

The span will remain active until the returned Scope object is destroyed.

Parameters
spanthe span that should be set as the new active span.
Returns
a Scope that controls how long the span will be active.

Definition at line 146 of file includes/opentelemetry/trace/tracer.h.

◆ WithActiveSpan() [2/2]

static Scope trace::Tracer::WithActiveSpan ( nostd::shared_ptr< Span > &  span)
inlinestaticnoexcept

Set the active span.

The span will remain active until the returned Scope object is destroyed.

Parameters
spanthe span that should be set as the new active span.
Returns
a Scope that controls how long the span will be active.

Definition at line 146 of file 9.2/includes/opentelemetry/trace/tracer.h.


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