|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
8 #include "detail/hex.h"
9 #include "detail/string.h"
10 #include "opentelemetry/context/propagation/text_map_propagator.h"
11 #include "opentelemetry/nostd/function_ref.h"
12 #include "opentelemetry/nostd/shared_ptr.h"
13 #include "opentelemetry/nostd/span.h"
14 #include "opentelemetry/nostd/string_view.h"
15 #include "opentelemetry/trace/context.h"
16 #include "opentelemetry/trace/default_span.h"
17 #include "opentelemetry/version.h"
49 InjectImpl(carrier, span_context);
89 static constexpr uint8_t kInvalidVersion = 0xFF;
90 static constexpr uint8_t kDefaultAssumedVersion = 0x00;
96 trace_parent[0] =
'0';
97 trace_parent[1] =
'0';
98 trace_parent[2] =
'-';
110 if (!trace_state.empty())
119 std::array<nostd::string_view, 4> fields{};
143 uint8_t version_binary;
145 if (version_binary == kInvalidVersion)
152 if (version_binary > kDefaultAssumedVersion)
172 if (!trace_id.IsValid() || !span_id.IsValid())
186 if (trace_parent ==
"")
191 return ExtractContextFromTraceHeaders(trace_parent, trace_state);
context::Context SetSpan(context::Context &context, const nostd::shared_ptr< Span > &span) noexcept
static TraceFlags TraceFlagsFromHex(nostd::string_view trace_flags)
const trace::TraceId & trace_id() const noexcept
void Inject(context::propagation::TextMapCarrier &carrier, const context::Context &context) noexcept override
void ToLowerBase16(nostd::span< char, 2 *kSize > buffer) const noexcept
static const size_t kTraceIdSize
DefaultSpan provides a non-operational Span that propagates the tracer context by wrapping it inside ...
Provide a type-erased version of std::shared_ptr that has ABI stability.
static SpanId SpanIdFromHex(nostd::string_view span_id)
#define OPENTELEMETRY_BEGIN_NAMESPACE
static const size_t kSpanIdSize
size_t SplitString(nostd::string_view s, char separator, nostd::string_view *results, size_t count)
Splits a string by separator, up to given buffer count words.
static const size_t kTraceFlagsSize
context::Context Extract(const context::propagation::TextMapCarrier &carrier, context::Context &context) noexcept override
static const nostd::string_view kTraceState
const nostd::shared_ptr< trace::TraceState > & trace_state() const noexcept
virtual void Set(nostd::string_view key, nostd::string_view value) noexcept=0
nostd::shared_ptr< Span > GetSpan(const context::Context &context) noexcept
#define OPENTELEMETRY_END_NAMESPACE
size_type size() const noexcept
const trace::TraceFlags & trace_flags() const noexcept
static TraceId TraceIdFromHex(nostd::string_view trace_id)
bool IsValidHex(nostd::string_view s)
void ToLowerBase16(nostd::span< char, 2 > buffer) const noexcept
static nostd::shared_ptr< TraceState > FromHeader(nostd::string_view header) noexcept
Returns shared_ptr to a newly created TraceState parsed from the header provided.
void ToLowerBase16(nostd::span< char, 2 *kSize > buffer) const noexcept
static const nostd::string_view kTraceParent
bool IsValid() const noexcept
std::string ToHeader() const noexcept
Creates a w3c tracestate header from TraceState object.
static nostd::string_view Trim(nostd::string_view str, size_t left, size_t right) noexcept
static const size_t kVersionSize
const trace::SpanId & span_id() const noexcept
virtual nostd::string_view Get(nostd::string_view key) const noexcept=0
bool HexToBinary(nostd::string_view hex, uint8_t *buffer, size_t buffer_size)
Converts a hexadecimal to binary format if the hex string will fit the buffer.
static const size_t kTraceParentSize
static SpanContext GetInvalid() noexcept
Back port of std::string_view to work with pre-cpp-17 compilers.