3#ifndef A11_OBS_TRACE_CONTEXT_H_
4#define A11_OBS_TRACE_CONTEXT_H_
12#include <absl/status/status.h>
13#include <absl/status/statusor.h>
absl::flat_hash_map< std::string, Bytes > ByteMap
String-keyed map of byte values (headers, attributes, etc.).
Definition types.h:42
Definition provider.cc:47
constexpr std::string_view kTracestateHeader
Reserved action header carrying the W3C tracestate value.
Definition trace_context.h:22
constexpr std::string_view kBaggageHeader
Reserved action header carrying request-scoped W3C baggage.
Definition trace_context.h:24
absl::Status InjectTraceContext(const TraceContext &context, data::ByteMap &headers)
Serialize context into reserved headers, replacing existing values.
Definition trace_context.cc:221
constexpr std::string_view kTraceparentHeader
Reserved action header carrying the W3C traceparent value.
Definition trace_context.h:20
absl::StatusOr< std::optional< TraceContext > > ExtractTraceContext(const data::ByteMap &headers)
Extract a remote parent; nullopt means no tracing headers were supplied.
Definition trace_context.cc:184
Future< T > SubmitWithCancellationHook(absl::AnyInvocable< absl::StatusOr< T >() && > work, std::function< void()> cancellation_hook, thread::TreeOptions tree_options)
Run work on A11's fiber pool with application-specific cancellation.
Definition executor.h:30
One decoded W3C baggage member propagated through nested and remote actions.
Definition trace_context.h:27
std::string properties
Trailing semicolon-separated properties.
Definition trace_context.h:30
std::string value
Percent-decoded member value.
Definition trace_context.h:29
std::string key
Trimmed member key; percent escapes stay encoded.
Definition trace_context.h:28
friend bool operator==(const BaggageEntry &, const BaggageEntry &)=default
SDK-independent W3C parent context recovered from reserved action headers.
Definition trace_context.h:36
std::string span_id
16 lowercase hex characters.
Definition trace_context.h:38
std::vector< BaggageEntry > baggage
Request-scoped propagated values.
Definition trace_context.h:41
bool sampled() const
Whether the W3C sampled flag is set.
Definition trace_context.h:44
std::string trace_id
32 lowercase hex characters.
Definition trace_context.h:37
std::uint8_t trace_flags
W3C trace flags byte.
Definition trace_context.h:39
friend bool operator==(const TraceContext &, const TraceContext &)=default
std::string tracestate
Raw tracestate header; may be empty.
Definition trace_context.h:40
A11's core wire value types: chunks, node fragments and messages.