TraceState carries tracing-system specific context in a list of key-value pairs.
TraceState allows different vendors to propagate additional information and inter-operate with their legacy id formats.
For more information, see the W3C Trace Context specification: https://www.w3.org/TR/trace-context
Definition at line 34 of file includes/opentelemetry/trace/trace_state.h.
Public Member Functions | |
| std::string | ToHeader () const noexcept |
| Creates a w3c tracestate header from TraceState object. More... | |
| bool | Get (nostd::string_view key, std::string &value) const noexcept |
Returns value associated with key passed as argument Returns empty string if key is invalid or not found. More... | |
| nostd::shared_ptr< TraceState > | Set (const nostd::string_view &key, const nostd::string_view &value) noexcept |
Returns shared_ptr of new TraceState object with following mutations applied to the existing instance: Update Key value: The updated value must be moved to beginning of List Add : The new key-value pair SHOULD be added to beginning of List. More... | |
| nostd::shared_ptr< TraceState > | Delete (const nostd::string_view &key) noexcept |
Returns shared_ptr to a new TraceState object after removing the attribute with given key ( if present ) More... | |
| bool | Empty () const noexcept |
| bool | GetAllEntries (nostd::function_ref< bool(nostd::string_view, nostd::string_view)> callback) const noexcept |
| std::string | ToHeader () const noexcept |
| Creates a w3c tracestate header from TraceState object. More... | |
| bool | Get (nostd::string_view key, std::string &value) const noexcept |
Returns value associated with key passed as argument Returns empty string if key is invalid or not found. More... | |
| nostd::shared_ptr< TraceState > | Set (const nostd::string_view &key, const nostd::string_view &value) noexcept |
Returns shared_ptr of new TraceState object with following mutations applied to the existing instance: Update Key value: The updated value must be moved to beginning of List Add : The new key-value pair SHOULD be added to beginning of List. More... | |
| nostd::shared_ptr< TraceState > | Delete (const nostd::string_view &key) noexcept |
Returns shared_ptr to a new TraceState object after removing the attribute with given key ( if present ) More... | |
| bool | Empty () const noexcept |
| bool | GetAllEntries (nostd::function_ref< bool(nostd::string_view, nostd::string_view)> callback) const noexcept |
Static Public Member Functions | |
| static OPENTELEMETRY_API_SINGLETON nostd::shared_ptr< TraceState > | GetDefault () |
| static nostd::shared_ptr< TraceState > | FromHeader (nostd::string_view header) noexcept |
| Returns shared_ptr to a newly created TraceState parsed from the header provided. More... | |
| static bool | IsValidKey (nostd::string_view key) |
| Returns whether key is a valid key. More... | |
| static bool | IsValidValue (nostd::string_view value) |
| Returns whether value is a valid value. More... | |
| static OPENTELEMETRY_API_SINGLETON nostd::shared_ptr< TraceState > | GetDefault () |
| static nostd::shared_ptr< TraceState > | FromHeader (nostd::string_view header) noexcept |
| Returns shared_ptr to a newly created TraceState parsed from the header provided. More... | |
| static bool | IsValidKey (nostd::string_view key) |
| Returns whether key is a valid key. More... | |
| static bool | IsValidValue (nostd::string_view value) |
| Returns whether value is a valid value. More... | |
Static Public Attributes | |
| static constexpr int | kKeyMaxSize = 256 |
| static constexpr int | kValueMaxSize = 256 |
| static constexpr int | kMaxKeyValuePairs = 32 |
| static constexpr auto | kKeyValueSeparator = '=' |
| static constexpr auto | kMembersSeparator = ',' |
|
inlinenoexcept |
Returns shared_ptr to a new TraceState object after removing the attribute with given key ( if present )
Definition at line 172 of file includes/opentelemetry/trace/trace_state.h.
References GetDefault().
|
inlinenoexcept |
Returns shared_ptr to a new TraceState object after removing the attribute with given key ( if present )
Definition at line 172 of file 9.2/includes/opentelemetry/trace/trace_state.h.
References GetDefault().
|
inlinenoexcept |
Definition at line 196 of file 9.2/includes/opentelemetry/trace/trace_state.h.
|
inlinenoexcept |
Definition at line 196 of file includes/opentelemetry/trace/trace_state.h.
|
inlinestaticnoexcept |
Returns shared_ptr to a newly created TraceState parsed from the header provided.
| header | Encoding of the tracestate header defined by the W3C Trace Context specification https://www.w3.org/TR/trace-context/ |
Definition at line 55 of file 9.2/includes/opentelemetry/trace/trace_state.h.
References common::KeyValueStringTokenizer::next(), and common::KeyValueStringTokenizer::NumTokens().
|
inlinestaticnoexcept |
Returns shared_ptr to a newly created TraceState parsed from the header provided.
| header | Encoding of the tracestate header defined by the W3C Trace Context specification https://www.w3.org/TR/trace-context/ |
Definition at line 55 of file includes/opentelemetry/trace/trace_state.h.
References common::KeyValueStringTokenizer::next(), and common::KeyValueStringTokenizer::NumTokens().
|
inlinenoexcept |
Returns value associated with key passed as argument Returns empty string if key is invalid or not found.
Definition at line 118 of file includes/opentelemetry/trace/trace_state.h.
|
inlinenoexcept |
Returns value associated with key passed as argument Returns empty string if key is invalid or not found.
Definition at line 118 of file 9.2/includes/opentelemetry/trace/trace_state.h.
|
inlinenoexcept |
Definition at line 200 of file includes/opentelemetry/trace/trace_state.h.
|
inlinenoexcept |
Definition at line 200 of file 9.2/includes/opentelemetry/trace/trace_state.h.
|
inlinestatic |
Definition at line 43 of file includes/opentelemetry/trace/trace_state.h.
|
inlinestatic |
Definition at line 43 of file 9.2/includes/opentelemetry/trace/trace_state.h.
|
inlinestatic |
Returns whether key is a valid key.
See https://www.w3.org/TR/trace-context/#key Identifiers MUST begin with a lowercase letter or a digit, and can only contain lowercase letters (a-z), digits (0-9), underscores (_), dashes (-), asterisks (*), and forward slashes (/). For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the vendor name.
Definition at line 212 of file includes/opentelemetry/trace/trace_state.h.
|
inlinestatic |
Returns whether key is a valid key.
See https://www.w3.org/TR/trace-context/#key Identifiers MUST begin with a lowercase letter or a digit, and can only contain lowercase letters (a-z), digits (0-9), underscores (_), dashes (-), asterisks (*), and forward slashes (/). For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the vendor name.
Definition at line 212 of file 9.2/includes/opentelemetry/trace/trace_state.h.
|
inlinestatic |
Returns whether value is a valid value.
See https://www.w3.org/TR/trace-context/#value The value is an opaque string containing up to 256 printable ASCII (RFC0020) characters ((i.e., the range 0x20 to 0x7E) except comma , and equal =)
Definition at line 225 of file 9.2/includes/opentelemetry/trace/trace_state.h.
|
inlinestatic |
Returns whether value is a valid value.
See https://www.w3.org/TR/trace-context/#value The value is an opaque string containing up to 256 printable ASCII (RFC0020) characters ((i.e., the range 0x20 to 0x7E) except comma , and equal =)
Definition at line 225 of file includes/opentelemetry/trace/trace_state.h.
|
inlinenoexcept |
Returns shared_ptr of new TraceState object with following mutations applied to the existing instance: Update Key value: The updated value must be moved to beginning of List Add : The new key-value pair SHOULD be added to beginning of List.
If the provided key-value pair is invalid, or results in transtate that violates the tracecontext specification, empty TraceState instance will be returned.
If the existing object has maximum list members, it's copy is returned.
Definition at line 138 of file 9.2/includes/opentelemetry/trace/trace_state.h.
References GetDefault().
|
inlinenoexcept |
Returns shared_ptr of new TraceState object with following mutations applied to the existing instance: Update Key value: The updated value must be moved to beginning of List Add : The new key-value pair SHOULD be added to beginning of List.
If the provided key-value pair is invalid, or results in transtate that violates the tracecontext specification, empty TraceState instance will be returned.
If the existing object has maximum list members, it's copy is returned.
Definition at line 138 of file includes/opentelemetry/trace/trace_state.h.
References GetDefault().
|
inlinenoexcept |
Creates a w3c tracestate header from TraceState object.
Definition at line 92 of file 9.2/includes/opentelemetry/trace/trace_state.h.
References nostd::string_view::data(), and nostd::string_view::size().
|
inlinenoexcept |
Creates a w3c tracestate header from TraceState object.
Definition at line 92 of file includes/opentelemetry/trace/trace_state.h.
References nostd::string_view::data(), and nostd::string_view::size().
|
staticconstexpr |
Definition at line 37 of file includes/opentelemetry/trace/trace_state.h.
|
staticconstexpr |
Definition at line 40 of file includes/opentelemetry/trace/trace_state.h.
|
staticconstexpr |
Definition at line 39 of file includes/opentelemetry/trace/trace_state.h.
|
staticconstexpr |
Definition at line 41 of file includes/opentelemetry/trace/trace_state.h.
|
staticconstexpr |
Definition at line 38 of file includes/opentelemetry/trace/trace_state.h.