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

Jaeger-specific span representation. More...

#include <trace_exporters.h>

Collaboration diagram for kcenon::monitoring::jaeger_span_data:
Collaboration graph

Public Member Functions

std::string to_thrift_json () const
 Convert to Jaeger Thrift format (JSON representation)
 
std::vector< uint8_t > to_protobuf () const
 Convert to Jaeger protobuf format (stub)
 

Public Attributes

std::string trace_id
 
std::string span_id
 
std::string parent_span_id
 
std::string operation_name
 
std::string service_name
 
std::chrono::microseconds start_time
 
std::chrono::microseconds duration
 
std::vector< std::pair< std::string, std::string > > tags
 
std::vector< std::pair< std::string, std::string > > process_tags
 

Detailed Description

Jaeger-specific span representation.

Definition at line 104 of file trace_exporters.h.

Member Function Documentation

◆ to_protobuf()

std::vector< uint8_t > kcenon::monitoring::jaeger_span_data::to_protobuf ( ) const
inline

Convert to Jaeger protobuf format (stub)

Definition at line 156 of file trace_exporters.h.

156 {
157 // Protobuf serialization requires generated code
158 // Return empty for now - full implementation would use protobuf library
159 return {};
160 }

◆ to_thrift_json()

std::string kcenon::monitoring::jaeger_span_data::to_thrift_json ( ) const
inline

Convert to Jaeger Thrift format (JSON representation)

Definition at line 118 of file trace_exporters.h.

118 {
119 std::ostringstream json;
120 json << "{";
121 json << "\"traceIdHigh\":0,";
122 json << "\"traceIdLow\":" << std::hash<std::string>{}(trace_id) << ",";
123 json << "\"spanId\":" << std::hash<std::string>{}(span_id) << ",";
124 json << "\"parentSpanId\":" << (parent_span_id.empty() ? "0" : std::to_string(std::hash<std::string>{}(parent_span_id))) << ",";
125 json << "\"operationName\":\"" << operation_name << "\",";
126 json << "\"startTime\":" << start_time.count() << ",";
127 json << "\"duration\":" << duration.count() << ",";
128
129 // Tags
130 json << "\"tags\":[";
131 bool first = true;
132 for (const auto& [key, value] : tags) {
133 if (!first) json << ",";
134 json << "{\"key\":\"" << key << "\",\"vType\":\"STRING\",\"vStr\":\"" << value << "\"}";
135 first = false;
136 }
137 json << "],";
138
139 // Process
140 json << "\"process\":{\"serviceName\":\"" << service_name << "\",\"tags\":[";
141 first = true;
142 for (const auto& [key, value] : process_tags) {
143 if (!first) json << ",";
144 json << "{\"key\":\"" << key << "\",\"vType\":\"STRING\",\"vStr\":\"" << value << "\"}";
145 first = false;
146 }
147 json << "]}";
148
149 json << "}";
150 return json.str();
151 }
std::vector< std::pair< std::string, std::string > > process_tags
std::vector< std::pair< std::string, std::string > > tags
std::chrono::microseconds duration
std::chrono::microseconds start_time

References duration, operation_name, parent_span_id, process_tags, service_name, span_id, start_time, tags, and trace_id.

Member Data Documentation

◆ duration

std::chrono::microseconds kcenon::monitoring::jaeger_span_data::duration

◆ operation_name

std::string kcenon::monitoring::jaeger_span_data::operation_name

◆ parent_span_id

std::string kcenon::monitoring::jaeger_span_data::parent_span_id

◆ process_tags

std::vector<std::pair<std::string, std::string> > kcenon::monitoring::jaeger_span_data::process_tags

◆ service_name

std::string kcenon::monitoring::jaeger_span_data::service_name

◆ span_id

std::string kcenon::monitoring::jaeger_span_data::span_id

◆ start_time

std::chrono::microseconds kcenon::monitoring::jaeger_span_data::start_time

◆ tags

std::vector<std::pair<std::string, std::string> > kcenon::monitoring::jaeger_span_data::tags

◆ trace_id

std::string kcenon::monitoring::jaeger_span_data::trace_id

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