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//!
24//! # Features
25//!
26//! - `dogstatsd` (default) — DogStatsD UDP exporter
27//! - `otlp` (default) — OTLP HTTP/protobuf metrics and span exporters
28//! - `clickhouse` — ClickHouse native-protocol metrics exporter, including
29//!   first-party rows and OTel-standard table support (via [`klickhouse`])
30//! - `monoio` — monoio-native exporter loops for monoio applications
31
32#[cfg(feature = "clickhouse")]
33pub mod clickhouse;
34
35#[cfg(feature = "dogstatsd")]
36pub mod dogstatsd;
37
38#[cfg(feature = "otlp")]
39pub mod otlp;
40
41#[cfg(feature = "otlp")]
42pub mod spans;
43
44pub mod sweeper;