ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
span_id Struct Referencefinal

A 64-bit span identifier, compatible with OpenTelemetry. More...

#include <span_id.hpp>

Collaboration diagram for span_id:
Collaboration graph

Public Member Functions

bool is_valid () const
 Checks if the span_id is valid (not all zeros).
 
std::string to_hex () const
 Converts the span_id to a 16-character lowercase hex string.
 
auto operator<=> (const span_id &) const =default
 Default comparison operator.
 

Static Public Member Functions

static span_id from_hex (std::string_view hex)
 Creates a span_id from a 16-character hex string.
 

Public Attributes

std::array< std::byte, 8 > bytes {}
 The raw 64-bit identifier.
 

Detailed Description

A 64-bit span identifier, compatible with OpenTelemetry.

The span_id uniquely identifies a single operation within a trace. Each span has its own span_id and may reference a parent span_id to form the trace tree structure. The 64-bit size matches the OpenTelemetry and W3C Trace Context specifications.

The internal structure embeds a timestamp for time-sortability:

Member Function Documentation

◆ from_hex()

span_id from_hex ( std::string_view  hex)
static

Creates a span_id from a 16-character hex string.

Parameters
hexThe hex string representation.
Returns
The parsed span_id, or an invalid span_id if parsing fails.
Here is the caller graph for this function: