Skip to main content

Crate rolly_tokio

Crate rolly_tokio 

Source
Expand description

Tokio-based transport for the rolly observability crate.

Provides TokioExporter for batching and shipping OTLP telemetry over HTTP, plus convenience functions for one-liner telemetry setup.

Modules§

constants
metrics
trace_id

Structs§

Counter
A monotonic u64 counter. Clone is cheap (Arc).
ExporterConfig
Configuration for the exporter.
Gauge
A last-value f64 gauge. Clone is cheap (Arc).
Histogram
A histogram with client-side bucketing. Clone is cheap (Arc).
LayerConfig
Configuration for building telemetry layers.
MetricsExportConfig
Configuration for metrics export encoding.
NullSink
No-op sink that discards all telemetry data.
TelemetryConfig
Configuration for the telemetry stack.
TelemetryGuard
Guard that flushes pending telemetry on drop.
TokioExporter
Handle to the exporter background task.
UseMetricsState
Stateful baseline for USE metrics polling.

Enums§

BackpressureStrategy
Configures behavior when the telemetry channel is full.
ExportMessage
Message types sent to the exporter background task.
InitError
Errors returned by try_init_global.
StartError
Errors that can occur when starting the exporter.

Traits§

TelemetrySink
Sink for encoded OTLP protobuf payloads.

Functions§

build_layer
Build telemetry layers without installing a global subscriber.
collect_and_encode_metrics
Collect current metric snapshots and encode as OTLP protobuf.
collect_use_metrics
Poll USE metrics once.
counter
Get or create a named counter from the global registry.
gauge
Get or create a named gauge from the global registry.
histogram
Get or create a named histogram from the global registry.
increment_dropped_total
Increment the global telemetry drop counter.
init_global_once
Initialize the full telemetry stack and set the global subscriber.
spawn_metrics_loop
Start the metrics aggregation loop as a background tokio task.
telemetry_dropped_total
Return the total number of telemetry messages dropped due to a full channel.
try_init_global
Same as init_global_once, but returns an error instead of panicking.