|
ORE Studio 0.0.4
|
Extends the base lifecycle_manager with telemetry sink support. More...
#include <lifecycle_manager.hpp>


Public Member Functions | |
| lifecycle_manager (lifecycle_manager &&)=delete | |
| lifecycle_manager & | operator= (const lifecycle_manager &)=delete |
| lifecycle_manager (std::optional< logging_options > ocfg) | |
| Initialise logging for the entire application. | |
| ~lifecycle_manager () override | |
| Shutdown logging for the entire application. | |
| void | add_telemetry_sink (std::shared_ptr< domain::resource > resource, telemetry_sink_backend::log_record_handler handler) |
| Adds a telemetry sink for log record correlation. | |
Public Member Functions inherited from lifecycle_manager | |
| lifecycle_manager (lifecycle_manager &&)=delete | |
| lifecycle_manager & | operator= (const lifecycle_manager &)=delete |
| lifecycle_manager (std::optional< logging_options > ocfg) | |
| Initialise logging for the entire application. | |
Additional Inherited Members | |
Protected Types inherited from lifecycle_manager | |
| using | file_sink_type = boost::log::sinks::synchronous_sink< boost::log::sinks::text_file_backend > |
| using | console_sink_type = boost::log::sinks::synchronous_sink< boost::log::sinks::text_ostream_backend > |
Static Protected Member Functions inherited from lifecycle_manager | |
| static boost::shared_ptr< file_sink_type > | make_file_sink (std::filesystem::path path, boost_severity severity, std::string tag) |
| Creates a boost log file sink. | |
| static boost::shared_ptr< console_sink_type > | make_console_sink (boost_severity severity, std::string tag) |
| Creates a boost log console sink. | |
Protected Attributes inherited from lifecycle_manager | |
| boost::shared_ptr< file_sink_type > | file_sink_ |
| boost::shared_ptr< console_sink_type > | console_sink_ |
Extends the base lifecycle_manager with telemetry sink support.
This class inherits from ores::logging::lifecycle_manager and adds the ability to attach a telemetry sink for OpenTelemetry log correlation. The telemetry sink extracts trace_id and span_id from log attributes and creates domain::log_record instances for export.
Note: this class uses boost shared_ptr due to legacy reasons (boost log does not support std::shared_ptr).
|
explicit |
Initialise logging for the entire application.
If no configuration is supplied, logging is disabled. This constructor delegates to the base class for console and file sink setup, and initializes the telemetry sink member.
|
overridevirtual |
Shutdown logging for the entire application.
Stops and flushes the telemetry sink before base class cleanup.
Reimplemented from lifecycle_manager.
| void add_telemetry_sink | ( | std::shared_ptr< domain::resource > | resource, |
| telemetry_sink_backend::log_record_handler | handler | ||
| ) |
Adds a telemetry sink for log record correlation.
The telemetry sink extracts trace_id and span_id attributes from log records and creates domain::log_record instances for export. The sink is asynchronous to avoid blocking the logging thread.
| resource | The resource describing the entity producing logs. |
| handler | Function called for each converted log record. |
Example: