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