Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
distributed_tracer.h File Reference

Distributed tracing implementation for monitoring system. More...

#include <string>
#include <memory>
#include <chrono>
#include <vector>
#include <unordered_map>
#include <mutex>
#include <atomic>
#include <optional>
#include <kcenon/monitoring/core/result_types.h>
#include <kcenon/monitoring/core/error_codes.h>
#include <kcenon/monitoring/context/thread_context.h>
Include dependency graph for distributed_tracer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kcenon::monitoring::trace_export_settings
 Configuration settings for trace export behavior. More...
 
struct  kcenon::monitoring::trace_span
 Trace span representing a unit of work in distributed tracing. More...
 
struct  kcenon::monitoring::trace_context
 Trace context for propagation across service boundaries. More...
 
class  kcenon::monitoring::span_builder
 Span builder for creating new spans. More...
 
class  kcenon::monitoring::distributed_tracer
 Distributed tracer for managing spans and traces. More...
 
class  kcenon::monitoring::scoped_span
 Scoped span for RAII-style span management. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::monitoring
 

Macros

#define TRACE_SPAN(operation_name)
 Helper macro for creating a scoped span.
 
#define TRACE_CHILD_SPAN(parent, operation_name)
 

Functions

distributed_tracerkcenon::monitoring::global_tracer ()
 Global tracer instance.
 

Detailed Description

Distributed tracing implementation for monitoring system.

Date
2025

Provides distributed tracing capabilities for tracking requests across multiple services and components.

Definition in file distributed_tracer.h.

Macro Definition Documentation

◆ TRACE_CHILD_SPAN

#define TRACE_CHILD_SPAN ( parent,
operation_name )
Value:
auto _child_span_result = kcenon::monitoring::global_tracer().start_child_span(parent, operation_name); \
kcenon::monitoring::scoped_span _child_scoped_span( \
_child_span_result.is_ok() ? _child_span_result.value() : nullptr, \
)
common::Result< std::shared_ptr< trace_span > > start_child_span(const trace_span &parent, const std::string &operation_name)
Start a child span.
Scoped span for RAII-style span management.
distributed_tracer & global_tracer()
Global tracer instance.

Definition at line 417 of file distributed_tracer.h.

417#define TRACE_CHILD_SPAN(parent, operation_name) \
418 auto _child_span_result = kcenon::monitoring::global_tracer().start_child_span(parent, operation_name); \
419 kcenon::monitoring::scoped_span _child_scoped_span( \
420 _child_span_result.is_ok() ? _child_span_result.value() : nullptr, \
421 &kcenon::monitoring::global_tracer() \
422 )

Referenced by TEST_F().

◆ TRACE_SPAN

#define TRACE_SPAN ( operation_name)
Value:
auto _span_result = kcenon::monitoring::global_tracer().start_span(operation_name); \
_span_result.is_ok() ? _span_result.value() : nullptr, \
)
common::Result< std::shared_ptr< trace_span > > start_span(const std::string &operation_name, const std::string &service_name="monitoring_system")
Start a new root span.

Helper macro for creating a scoped span.

Definition at line 410 of file distributed_tracer.h.

410#define TRACE_SPAN(operation_name) \
411 auto _span_result = kcenon::monitoring::global_tracer().start_span(operation_name); \
412 kcenon::monitoring::scoped_span _scoped_span( \
413 _span_result.is_ok() ? _span_result.value() : nullptr, \
414 &kcenon::monitoring::global_tracer() \
415 )

Referenced by TEST_F().