|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Enhanced thread context data for comprehensive request and trace tracking. More...
#include <thread_context.h>

Public Member Functions | |
| thread_context_data () | |
| Default constructor. Records the current time as start_time. | |
| thread_context_data (std::string req_id) | |
| Construct with a request ID. Records the current time as start_time. | |
| void | add_tag (const std::string &key, const std::string &value) |
| Add or update a custom tag. | |
| std::string | get_tag (const std::string &key) const |
| Retrieve a tag value by key. | |
Public Attributes | |
| std::string | request_id |
| Unique identifier for the current request. | |
| std::string | correlation_id |
| Correlation ID for cross-service tracing. | |
| std::string | user_id |
| User identifier associated with the request. | |
| std::string | span_id |
| Current span ID for distributed tracing. | |
| std::string | trace_id |
| Trace ID linking all spans in a trace. | |
| std::chrono::steady_clock::time_point | start_time |
| Context creation timestamp. | |
| std::optional< std::string > | parent_span_id |
| Parent span ID (if nested) | |
| std::unordered_map< std::string, std::string > | tags |
| Arbitrary key-value tags. | |
Enhanced thread context data for comprehensive request and trace tracking.
Extends basic context metadata with distributed tracing fields (span_id, trace_id, parent_span_id) and timing information. Each instance records its creation time for elapsed duration calculations.
Definition at line 107 of file thread_context.h.
|
inline |
Default constructor. Records the current time as start_time.
Definition at line 120 of file thread_context.h.
|
inlineexplicit |
Construct with a request ID. Records the current time as start_time.
| req_id | Request identifier |
Definition at line 126 of file thread_context.h.
|
inline |
Add or update a custom tag.
| key | Tag name |
| value | Tag value |
Definition at line 135 of file thread_context.h.
References tags.
Referenced by TEST_F(), TEST_F(), and TEST_F().

|
inline |
| std::string kcenon::monitoring::thread_context_data::correlation_id |
Correlation ID for cross-service tracing.
Definition at line 109 of file thread_context.h.
| std::optional<std::string> kcenon::monitoring::thread_context_data::parent_span_id |
| std::string kcenon::monitoring::thread_context_data::request_id |
Unique identifier for the current request.
Definition at line 108 of file thread_context.h.
Referenced by TEST().
| std::string kcenon::monitoring::thread_context_data::span_id |
Current span ID for distributed tracing.
Definition at line 111 of file thread_context.h.
Referenced by TEST().
| std::chrono::steady_clock::time_point kcenon::monitoring::thread_context_data::start_time |
Context creation timestamp.
Definition at line 113 of file thread_context.h.
| std::unordered_map<std::string, std::string> kcenon::monitoring::thread_context_data::tags |
Arbitrary key-value tags.
Definition at line 115 of file thread_context.h.
| std::string kcenon::monitoring::thread_context_data::trace_id |
Trace ID linking all spans in a trace.
Definition at line 112 of file thread_context.h.
Referenced by TEST().
| std::string kcenon::monitoring::thread_context_data::user_id |