17#ifndef A11_OBS_SPAN_H_
18#define A11_OBS_SPAN_H_
28#include <absl/status/status.h>
59 Span& operator=(
Span&& other) noexcept;
71 [[nodiscard]] std::
string SpanIdHex() const;
88 std::string_view
name,
89 const std::vector<std::pair<std::
string, std::
string>>& attributes);
92 void SetStatus(const absl::Status& status);
116 static constexpr std::
size_t kStorageSize = 64;
117 static constexpr std::
size_t kStorageAlign = alignof(std::max_align_t);
121 [[nodiscard]]
Impl* impl() noexcept;
122 [[nodiscard]] const
Impl* impl() const noexcept;
125 Impl* Engage() noexcept;
126 void Reset() noexcept;
128 alignas(kStorageAlign)
unsigned char storage_[kStorageSize];
129 bool engaged_ = false;
Move-only RAII handle to one action, session, or transport span.
Definition span.h:51
std::string SpanIdHex() const
Return the 16-character span id, or empty when inactive.
Definition tracer.cc:327
std::string TraceIdHex() const
Return the 32-character trace id, or empty when inactive.
Definition tracer.cc:319
bool IsRecording() const noexcept
Whether this handle currently records attributes and events.
Definition tracer.cc:212
void UpdateName(std::string_view name)
Replace the name that will be exported when the span ends.
Definition tracer.cc:305
void SetStatus(const absl::Status &status)
Map an A11 operation status onto the span's OTel outcome.
Definition tracer.cc:276
absl::Status InjectContext(data::ByteMap &headers) const
Inject trace context and inherited baggage into reserved A11 headers.
Definition tracer.cc:335
void End() noexcept
Finish the span and release its implementation; safe to call repeatedly.
Definition tracer.cc:312
void SetAttribute(std::string_view key, std::string_view value)
Set or replace a string attribute on the live span.
Definition tracer.cc:216
void AddEvent(std::string_view name)
Record a named point-in-time event.
Definition tracer.cc:251
Factory that makes parentage explicit for A11's migrating fibers.
Definition tracer.h:35
std::string value
Definition discover.cc:114
std::string key
Definition discover.cc:782
Definition provider.cc:58
SpanStatus
OpenTelemetry outcome states, mirrored to keep OTel out of this API.
Definition span.h:38
SpanKind
OpenTelemetry span relationships, mirrored to keep OTel out of this API.
Definition span.h:35
A11's core wire value types: chunks, node fragments and messages.