Expand description
Telemetry data collection and export infrastructure.
This module provides the core infrastructure for collecting telemetry data and exporting it to various backends. It includes the global collector singleton, export trait, and various built-in exporters.
§Global Collector
The collector uses a global singleton pattern to ensure telemetry data is collected
consistently across the entire application.
The collector must be initialized once
using set_exporter before any telemetry data can be collected.
§Export Trait
The Export trait defines the interface for exporting telemetry data.
Custom exporters can be implemented by providing an implementation of this trait.
§Built-in Exporters
ConsoleJsonExporter- Exports telemetry data as JSON to stdout- [
TestExporter] - Collects telemetry data in memory for testing purposes
Re-exports§
pub use crate::protocol::ProcessId;
Structs§
- Collector
- The global telemetry collector.
- Console
Json Exporter - An exporter that outputs telemetry messages as JSON to stdout.
- SetExporter
Error - The type returned by
set_exporterifset_exporterhas already been called.
Traits§
- Export
- Trait for exporting telemetry data to external systems.
Functions§
- get_
collector - Returns a reference to the collector.
- set_
exporter - Initializes the collector with the given Exporter and
ProcessId.