A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
a11::obs Namespace Reference

Namespaces

namespace  internal
 

Classes

struct  BaggageEntry
 One decoded W3C baggage member propagated through nested and remote actions. More...
 
struct  ProviderOptions
 Configure how an A11 process records and exports agent traces. More...
 
struct  RecordedEvent
 Event captured on a span by the in-memory exporter. More...
 
struct  RecordedSpan
 Finished span snapshot returned by the in-memory exporter. More...
 
class  Span
 Move-only RAII handle to one action, session, or transport span. More...
 
struct  TraceContext
 SDK-independent W3C parent context recovered from reserved action headers. More...
 
class  Tracer
 Factory that makes parentage explicit for A11's migrating fibers. More...
 

Enumerations

enum class  ExporterKind { kNone , kInMemory , kOstream , kOtlpHttp }
 Destination used for spans produced by actions, sessions, and transports. More...
 
enum class  SpanKind {
  kInternal , kServer , kClient , kProducer ,
  kConsumer
}
 OpenTelemetry span relationships, mirrored to keep OTel out of this API. More...
 
enum class  SpanStatus { kUnset , kOk , kError }
 OpenTelemetry outcome states, mirrored to keep OTel out of this API. More...
 

Functions

absl::Status Configure (const ProviderOptions &options)
 Install or replace the process-wide tracer provider.
 
void Shutdown ()
 Flush pending spans and restore the process to its unconfigured state.
 
bool IsConfigured ()
 Whether a tracer provider is currently installed.
 
std::vector< RecordedSpanGetRecordedSpans ()
 Return in-memory spans oldest first; meaningful for kInMemory only.
 
void ClearRecordedSpans ()
 Clear spans retained by the in-memory exporter.
 
absl::StatusOr< std::optional< TraceContext > > ExtractTraceContext (const data::ByteMap &headers)
 Extract a remote parent; nullopt means no tracing headers were supplied.
 
absl::Status InjectTraceContext (const TraceContext &context, data::ByteMap &headers)
 Serialize context into reserved headers, replacing existing values.
 

Variables

constexpr std::string_view kTraceparentHeader = "x-otel-traceparent"
 Reserved action header carrying the W3C traceparent value.
 
constexpr std::string_view kTracestateHeader = "x-otel-tracestate"
 Reserved action header carrying the W3C tracestate value.
 
constexpr std::string_view kBaggageHeader = "x-otel-baggage"
 Reserved action header carrying request-scoped W3C baggage.
 

Enumeration Type Documentation

◆ ExporterKind

Destination used for spans produced by actions, sessions, and transports.

Enumerator
kNone 

Unconfigured sentinel; Configure() rejects this value.

kInMemory 

Retain finished spans for GetRecordedSpans(); useful in tests.

kOstream 

Human-readable output for local debugging.

kOtlpHttp 

Native OTLP/HTTP export; requires the A11_WITH_OTLP_HTTP build option.

◆ SpanKind

OpenTelemetry span relationships, mirrored to keep OTel out of this API.

Enumerator
kInternal 
kServer 
kClient 
kProducer 
kConsumer 

◆ SpanStatus

OpenTelemetry outcome states, mirrored to keep OTel out of this API.

Enumerator
kUnset 
kOk 
kError 

Function Documentation

◆ ClearRecordedSpans()

void a11::obs::ClearRecordedSpans ( )

Clear spans retained by the in-memory exporter.

◆ Configure()

absl::Status a11::obs::Configure ( const ProviderOptions options)

Install or replace the process-wide tracer provider.

Tracing remains inactive until this returns OK.

◆ ExtractTraceContext()

absl::StatusOr< std::optional< TraceContext > > a11::obs::ExtractTraceContext ( const data::ByteMap headers)

Extract a remote parent; nullopt means no tracing headers were supplied.

Malformed or inconsistent reserved headers return an error so an action cannot silently detach from the caller's requested trace.

◆ GetRecordedSpans()

std::vector< RecordedSpan > a11::obs::GetRecordedSpans ( )

Return in-memory spans oldest first; meaningful for kInMemory only.

◆ InjectTraceContext()

absl::Status a11::obs::InjectTraceContext ( const TraceContext context,
data::ByteMap headers 
)

Serialize context into reserved headers, replacing existing values.

◆ IsConfigured()

bool a11::obs::IsConfigured ( )

Whether a tracer provider is currently installed.

◆ Shutdown()

void a11::obs::Shutdown ( )

Flush pending spans and restore the process to its unconfigured state.

Variable Documentation

◆ kBaggageHeader

constexpr std::string_view a11::obs::kBaggageHeader = "x-otel-baggage"
inlineconstexpr

Reserved action header carrying request-scoped W3C baggage.

◆ kTraceparentHeader

constexpr std::string_view a11::obs::kTraceparentHeader = "x-otel-traceparent"
inlineconstexpr

Reserved action header carrying the W3C traceparent value.

◆ kTracestateHeader

constexpr std::string_view a11::obs::kTracestateHeader = "x-otel-tracestate"
inlineconstexpr

Reserved action header carrying the W3C tracestate value.