|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Demonstrates distributed tracing across multiple services. More...
#include <iostream>#include <memory>#include <string>#include <chrono>#include <thread>#include <iomanip>#include "kcenon/monitoring/tracing/distributed_tracer.h"
Go to the source code of this file.
Classes | |
| class | ApiGatewayService |
| Simulated API Gateway service. More... | |
| class | AuthService |
| Simulated Authentication service. More... | |
| class | UserService |
| Simulated User service. More... | |
| class | CacheService |
| Simulated Cache service. More... | |
Functions | |
| void | display_span (const trace_span &span, int depth) |
| Display single span. | |
| void | display_children (const std::vector< trace_span > &spans, const std::string &parent_id, int depth) |
| Display children recursively. | |
| void | display_trace_tree (const std::vector< trace_span > &spans) |
| Display trace tree structure. | |
| void | simulate_multi_service_request () |
| Simulate complete multi-service request flow. | |
| int | main () |
Demonstrates distributed tracing across multiple services.
Definition in file multi_service_tracing_example.cpp.
| void display_children | ( | const std::vector< trace_span > & | spans, |
| const std::string & | parent_id, | ||
| int | depth ) |
Display children recursively.
Definition at line 350 of file multi_service_tracing_example.cpp.
References display_children(), and display_span().
Referenced by display_children(), and display_trace_tree().


| void display_span | ( | const trace_span & | span, |
| int | depth ) |
Display single span.
Definition at line 323 of file multi_service_tracing_example.cpp.
References kcenon::monitoring::trace_span::duration, kcenon::monitoring::trace_span::operation_name, kcenon::monitoring::trace_span::service_name, kcenon::monitoring::trace_span::span_id, and kcenon::monitoring::trace_span::tags.
Referenced by display_children(), and display_trace_tree().

| void display_trace_tree | ( | const std::vector< trace_span > & | spans | ) |
Display trace tree structure.
Definition at line 291 of file multi_service_tracing_example.cpp.
References display_children(), display_span(), kcenon::monitoring::trace_span::duration, kcenon::monitoring::trace_span::span_id, and kcenon::monitoring::trace_span::trace_id.
Referenced by simulate_multi_service_request().


| int main | ( | ) |
Definition at line 420 of file multi_service_tracing_example.cpp.
References simulate_multi_service_request().

| void simulate_multi_service_request | ( | ) |
Simulate complete multi-service request flow.
Definition at line 364 of file multi_service_tracing_example.cpp.
References kcenon::monitoring::trace_context::baggage, CacheService::cache_lookup(), ApiGatewayService::create_context(), display_trace_tree(), UserService::get_user_profile(), ApiGatewayService::handle_request(), kcenon::monitoring::trace_context::span_id, kcenon::monitoring::trace_context::trace_id, and AuthService::verify_token().
Referenced by main().

