Couchbase C++ SDK 1.4.0 (rev. 59aa900)
Loading...
Searching...
No Matches
request_span Class Referenceabstract

#include <couchbase/tracing/request_span.hxx>

Inheritance diagram for request_span:
Inheritance graph

Public Member Functions

 request_span ()=default
 request_span (const request_span &other)=default
 request_span (request_span &&other)=default
auto operator= (const request_span &other) -> request_span &=default
auto operator= (request_span &&other) -> request_span &=default
virtual ~request_span ()=default
 request_span (std::string name)
 request_span (std::string name, std::shared_ptr< request_span > parent)
virtual void add_tag (const std::string &name, std::uint64_t value)=0
virtual void add_tag (const std::string &name, const std::string &value)=0
virtual void end ()=0
auto name () const -> const std::string &
virtual auto parent () const -> std::shared_ptr< request_span >
virtual auto uses_tags () const -> bool
virtual auto try_set_dispatch_operation_id (std::uint32_t) -> bool
 Efficiently record the dispatch operation identifier (the request opaque) without formatting it to a string on the hot path.
virtual auto try_set_dispatch_local_id (const std::string &) -> bool
 Efficiently record the local connection identifier of a dispatch span without materializing a tag-name string on the hot path.
virtual auto try_set_dispatch_result (std::uint64_t, const std::string &, std::uint16_t) -> bool
 Efficiently record the result metadata of a dispatch span (server processing time and the peer socket) in a single call, without materializing tag-name strings on the hot path.

Constructor & Destructor Documentation

◆ request_span() [1/5]

request_span ( )
default

◆ request_span() [2/5]

request_span ( const request_span & other)
default

◆ request_span() [3/5]

request_span ( request_span && other)
default

◆ ~request_span()

virtual ~request_span ( )
virtualdefault

◆ request_span() [4/5]

request_span ( std::string name)
inlineexplicit

◆ request_span() [5/5]

request_span ( std::string name,
std::shared_ptr< request_span > parent )
inline

Member Function Documentation

◆ add_tag() [1/2]

virtual void add_tag ( const std::string & name,
const std::string & value )
pure virtual

Implemented in otel_request_span.

◆ add_tag() [2/2]

virtual void add_tag ( const std::string & name,
std::uint64_t value )
pure virtual

◆ end()

virtual void end ( )
pure virtual

Implemented in otel_request_span.

◆ name()

auto name ( ) const -> const std::string &
inlinenodiscard

◆ operator=() [1/2]

auto operator= ( const request_span & other) -> request_span &=default
default

◆ operator=() [2/2]

auto operator= ( request_span && other) -> request_span &=default
default

◆ parent()

virtual auto parent ( ) const -> std::shared_ptr< request_span >
inlinenodiscardvirtual

◆ try_set_dispatch_local_id()

virtual auto try_set_dispatch_local_id ( const std::string & ) -> bool
inlinenodiscardvirtual

Efficiently record the local connection identifier of a dispatch span without materializing a tag-name string on the hot path.

Like try_set_dispatch_operation_id(), the default returns false so the SDK records the value as a regular string tag and external tracer implementations are unaffected.

Returns
true if the span captured the identifier; false to request the string-tag fallback.

◆ try_set_dispatch_operation_id()

virtual auto try_set_dispatch_operation_id ( std::uint32_t ) -> bool
inlinenodiscardvirtual

Efficiently record the dispatch operation identifier (the request opaque) without formatting it to a string on the hot path.

The default implementation returns false, which tells the SDK to record the identifier as a regular string tag via add_tag() instead — so external tracer implementations are unaffected. Built-in spans may override this to capture the raw value and defer the (rarely needed) formatting until the span is actually reported.

Returns
true if the span captured the identifier; false to request the string-tag fallback.

◆ try_set_dispatch_result()

virtual auto try_set_dispatch_result ( std::uint64_t ,
const std::string & ,
std::uint16_t  ) -> bool
inlinenodiscardvirtual

Efficiently record the result metadata of a dispatch span (server processing time and the peer socket) in a single call, without materializing tag-name strings on the hot path.

The default returns false so the SDK records the values as regular string tags and external tracer implementations are unaffected.

Returns
true if the span captured the metadata; false to request the string-tag fallback.

◆ uses_tags()

virtual auto uses_tags ( ) const -> bool
inlinenodiscardvirtual

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