Skip to main content

fast_telemetry_export/
lib.rs

1//! Export adapters for fast-telemetry metrics.
2//!
3//! This crate provides the I/O layer for getting fast-telemetry metrics out of your
4//! process: DogStatsD over UDP, OTLP over HTTP/protobuf, ClickHouse native TCP,
5//! span export, and stale-series sweeping.
6//!
7//! Exporters are generic — they accept closures for metric serialization so
8//! they work with any metrics struct, not just a specific `AllMetrics` type.
9//!
10//! # Configuration highlights
11//!
12//! - OTLP metrics and span exporters support custom `service.name`,
13//!   instrumentation scope names, additional resource attributes, per-request
14//!   headers, and request timeouts.
15//! - OTLP exporters gzip-compress larger protobuf payloads automatically and
16//!   use exponential backoff after transport failures.
17//! - The span exporter also exposes `max_batch_size` to bound work per cycle.
18//! - The stale-series sweeper expects the caller to invoke
19//!   `fast_telemetry::advance_cycle()` once per sweep and then call each dynamic
20//!   metric's `evict_stale(...)` method.
21//! - The `monoio` feature adds monoio-native DogStatsD, OTLP HTTP/protobuf, and
22//!   stale-series sweep loops, plus a per-worker span flusher.
23//! - The `compio` feature adds compio-native DogStatsD and stale-series sweep
24//!   loops, plus a per-worker span flusher when `otlp` is also enabled.
25//!
26//! # Features
27//!
28//! - `dogstatsd` (default) — DogStatsD UDP exporter
29//! - `otlp` (default) — OTLP HTTP/protobuf metrics and span exporters
30//! - `clickhouse` — ClickHouse native-protocol metrics exporter, including
31//!   first-party rows and OTel-standard table support (via `klickhouse`)
32//! - `monoio` — monoio-native exporter loops for monoio applications
33//! - `compio` — compio-native exporter loops for compio applications
34
35#[cfg(feature = "clickhouse")]
36pub mod clickhouse;
37
38#[cfg(any(feature = "dogstatsd", feature = "compio"))]
39pub mod dogstatsd;
40
41#[cfg(feature = "otlp")]
42pub mod otlp;
43
44#[cfg(feature = "otlp")]
45pub mod spans;
46
47pub mod sweeper;