Skip to main content

CommonLibrary/Telemetry/
Client.rs

1//! Process-wide PostHog client singleton. Populated once by
2//! `Initialize::Fn`; every `Capture*::Fn` reads through this static.
3//! Sidecars share one client per process, like Mountain's
4//! `Binary/Build/PostHogPlugin/Client`.
5
6use std::sync::OnceLock;
7
8pub static CLIENT:OnceLock<posthog_rs::Client> = OnceLock::new();
9
10/// The Tier that called `Initialize`, captured for default `$component`
11/// + `$tier` enrichment on every event.
12pub static TIER:OnceLock<crate::Telemetry::Tier::Tier> = OnceLock::new();