Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Observability layer — OpenTelemetry tracing, structured logging, Prometheus metrics.

All components are feature-gated for zero overhead when disabled:

  • tracing-subscriber: console logging — installs a fmt/EnvFilter subscriber via TelemetryConfig::init (the tracing facade itself is always available)
  • metrics: Prometheus metric definitions and export
  • otel-otlp: OTLP trace and metric export to any OTel collector
  • otel-gcp: Google Cloud export: spans to Cloud Trace, metrics to Cloud Monitoring over OTLP (the Telemetry API)

Re-exports§

pub use metrics_exporter_prometheus as metrics_exporter;

Modules§

logging
Structured logging helpers.
metrics
Prometheus metric definitions — counters, histograms, gauges.
spans
OpenTelemetry span definitions for session operations.

Structs§

Exporters
The exporters a TelemetryConfig asks for, built but not yet attached to a subscriber: for an application that builds its own subscriber (to add layers of its own) and attaches Exporters::layer to it when the otel-base feature is enabled.
TelemetryConfig
Telemetry configuration.
TelemetryGuard
Guard that keeps telemetry systems alive while held. Drop this to flush and shutdown OTel exporters.

Enums§

GcpExportError
Why Google Cloud metric export could not be set up.