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

Represents a single operation within a trace. More...

#include <span.hpp>

Collaboration diagram for span:
Collaboration graph

Public Member Functions

bool is_session () const
 Checks if this span represents a session (has session.id attribute).
 
bool is_root () const
 Checks if this is a root span (no parent).
 
std::optional< std::chrono::nanoseconds > duration () const
 Calculates the duration of the span if it has ended.
 

Public Attributes

span_context context
 The span's identity (trace_id + span_id + flags).
 
std::optional< span_idparent_span_id
 The parent span's ID, if this is not a root span.
 
std::vector< span_linklinks
 Links to other spans forming hypergraph relationships.
 
std::string name
 A human-readable name describing the operation.
 
span_kind kind = span_kind::internal
 The kind of span (internal, server, client, producer, consumer).
 
std::chrono::system_clock::time_point start_time
 When the span started.
 
std::optional< std::chrono::system_clock::time_point > end_time
 When the span ended. Empty if the span is still in progress.
 
span_status_code status_code = span_status_code::unset
 The status code of the operation.
 
std::string status_message
 A message describing the status, typically set when status is error.
 
attributes attrs
 Key-value pairs providing additional context about the operation.
 

Detailed Description

Represents a single operation within a trace.

A span is the primary building block of a distributed trace. It represents a single operation and contains timing information, a name, attributes, and relationships to other spans. Spans form a tree structure through parent-child relationships, and can also form a hypergraph through links.

This structure is designed to be compatible with OpenTelemetry's span model.

Member Data Documentation

◆ name

std::string name

A human-readable name describing the operation.

Examples: "HTTP GET /users", "database.query", "calculate_pv01"

◆ attrs

attributes attrs

Key-value pairs providing additional context about the operation.

OpenTelemetry semantic conventions define standard attribute names.