Module collector

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 build 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§

Builder
Builder for initializing the telemetry collector.
Collector
The global telemetry collector.
ConsoleJsonExporter
An exporter that outputs telemetry messages as JSON to stdout.
ConsolePrettyExporter
Exporter that pretty prints telemetry messages to stderr.
ProcessId
A globally-unique id identifying a process.
TestExporter
An exporter for testing that stores all telemetry messages in memory.

Traits§

Export
Trait for exporting telemetry data to external systems.

Functions§

build
Creates a new collector builder.
get_collector
Returns a reference to the collector.