Module collector

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

Structs§

Collector
The global telemetry collector.
ConsoleJsonExporter
An exporter that outputs telemetry messages as JSON to stdout.
SetExporterError
The type returned by set_exporter if set_exporter has already been called.
TestExporter
An exporter for testing that stores all telemetry messages in memory.

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 ExecutionId.