Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::otel_span_data Struct Reference

OpenTelemetry span data representation. More...

#include <opentelemetry_adapter.h>

Collaboration diagram for kcenon::monitoring::otel_span_data:
Collaboration graph

Public Member Functions

void add_attribute (const std::string &key, const std::string &value)
 
void add_event (const std::string &event)
 
bool is_ended () const
 
std::chrono::microseconds duration () const
 

Public Attributes

otel_span_context context
 
otel_span_context parent_context
 
std::string name
 
otel_span_kind kind {otel_span_kind::internal}
 
otel_status_code status_code {otel_status_code::unset}
 
std::string status_message
 
std::chrono::system_clock::time_point start_time
 
std::chrono::system_clock::time_point end_time
 
std::vector< otel_attributeattributes
 
std::vector< std::string > events
 
otel_resource resource
 

Detailed Description

OpenTelemetry span data representation.

Definition at line 130 of file opentelemetry_adapter.h.

Member Function Documentation

◆ add_attribute()

void kcenon::monitoring::otel_span_data::add_attribute ( const std::string & key,
const std::string & value )
inline

Definition at line 143 of file opentelemetry_adapter.h.

143 {
144 attributes.emplace_back(key, value);
145 }
std::vector< otel_attribute > attributes

References attributes.

Referenced by kcenon::monitoring::opentelemetry_tracer_adapter::convert_span(), and TEST_F().

Here is the caller graph for this function:

◆ add_event()

void kcenon::monitoring::otel_span_data::add_event ( const std::string & event)
inline

Definition at line 147 of file opentelemetry_adapter.h.

147 {
148 events.push_back(event);
149 }

References events.

Referenced by TEST_F().

Here is the caller graph for this function:

◆ duration()

std::chrono::microseconds kcenon::monitoring::otel_span_data::duration ( ) const
inline

Definition at line 155 of file opentelemetry_adapter.h.

155 {
156 if (!is_ended()) {
157 return std::chrono::microseconds{0};
158 }
159 return std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time);
160 }
std::chrono::system_clock::time_point start_time
std::chrono::system_clock::time_point end_time

References end_time, is_ended(), and start_time.

Referenced by TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_ended()

bool kcenon::monitoring::otel_span_data::is_ended ( ) const
inline

Definition at line 151 of file opentelemetry_adapter.h.

151 {
152 return end_time != std::chrono::system_clock::time_point{};
153 }

References end_time.

Referenced by duration(), and TEST_F().

Here is the caller graph for this function:

Member Data Documentation

◆ attributes

std::vector<otel_attribute> kcenon::monitoring::otel_span_data::attributes

Definition at line 139 of file opentelemetry_adapter.h.

Referenced by add_attribute(), and TEST_F().

◆ context

otel_span_context kcenon::monitoring::otel_span_data::context

◆ end_time

std::chrono::system_clock::time_point kcenon::monitoring::otel_span_data::end_time

◆ events

std::vector<std::string> kcenon::monitoring::otel_span_data::events

Definition at line 140 of file opentelemetry_adapter.h.

Referenced by add_event(), and TEST_F().

◆ kind

◆ name

std::string kcenon::monitoring::otel_span_data::name

◆ parent_context

otel_span_context kcenon::monitoring::otel_span_data::parent_context

◆ resource

otel_resource kcenon::monitoring::otel_span_data::resource

◆ start_time

std::chrono::system_clock::time_point kcenon::monitoring::otel_span_data::start_time

◆ status_code

◆ status_message

std::string kcenon::monitoring::otel_span_data::status_message

The documentation for this struct was generated from the following file: