CommonLibrary/Telemetry/mod.rs
1//! # Telemetry - shared dual-pipe (PostHog + OTLP) for every Rust Element
2//!
3//! Single source of truth for the sidecar telemetry surface. Mountain
4//! keeps its own compile-time-baked `Binary/Build/PostHogPlugin/*`
5//! (the build.rs `cargo:rustc-env` route guarantees release builds drop
6//! every byte). All other Rust elements (Air, Echo, Rest, Grove, Mist,
7//! SideCar) read configuration at runtime through this module:
8//!
9//! ```ignore
10//! use CommonLibrary::Telemetry::{Initialize, Tier};
11//! Initialize::Fn(Tier::Air); // call once during boot
12//! ```
13//!
14//! All capture functions are no-ops in release builds
15//! (`cfg!(debug_assertions)`) and short-circuit on `Capture=false` / per-pipe
16//! toggles at runtime.
17//!
18//! ## Layout (one export per file)
19//!
20//! - `Tier::Tier` - enum identifying the calling sidecar
21//! - `Configuration::Fn` - runtime env read
22//! - `IsAllowed::PostHog`, `IsAllowed::OTLP` - gates
23//! - `Client::CLIENT` - `OnceLock<posthog_rs::Client>`
24//! - `DistinctId::Fn` - stable per-machine identity
25//! - `CaptureEvent::Fn`, `CaptureError::Fn`, `CaptureSession::Fn` - PostHog
26//! - `EmitOTLPSpan::Fn` - raw HTTP OTLP exporter
27//! - `Initialize::Fn` - `Tier`-tagged boot
28
29pub mod CaptureError;
30
31pub mod CaptureEvent;
32
33pub mod CaptureSession;
34
35pub mod Client;
36
37pub mod Configuration;
38
39pub mod DistinctId;
40
41pub mod EmitOTLPSpan;
42
43pub mod Initialize;
44
45pub mod IsAllowed;
46
47pub mod Tier;
48
49pub mod Traceparent;