Class Tracer
Defined in File tracer.h
Inheritance Relationships
Derived Types
public opentelemetry::sdk::trace::Tracer(Class Tracer)public opentelemetry::trace::NoopTracer(Class NoopTracer)
Class Documentation
-
class Tracer
Handles span creation and in-process context propagation.
This class provides methods for manipulating the context, creating spans, and controlling spans’ lifecycles.
Subclassed by opentelemetry::sdk::trace::Tracer, opentelemetry::trace::NoopTracer
Public Functions
-
Tracer() = default
-
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.
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.
Note: Adding attributes and links at span creation is preferred to adding them later, as samplers can only consider information already present during span creation.
-
inline nostd::shared_ptr<Span> StartSpan(nostd::string_view name, const StartSpanOptions &options = {}) noexcept
-
inline nostd::shared_ptr<Span> StartSpan(nostd::string_view name, const common::KeyValueIterable &attributes, const StartSpanOptions &options = {}) noexcept
-
inline nostd::shared_ptr<Span> StartSpan(nostd::string_view name, std::initializer_list<std::pair<nostd::string_view, common::AttributeValue>> attributes, const StartSpanOptions &options = {}) noexcept
-
inline 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
-
Tracer() = default