Mountain/Binary/Build/PostHogPlugin/Constants.rs
1
2//! Build-time PostHog credentials baked from `.env.Land.PostHog` via
3//! `cargo:rustc-env`. `env!` always resolves at compile time so even a
4//! clean checkout builds without a populated `.env`.
5
6/// PostHog project token (`Authorize` in `.env.Land.PostHog`).
7pub const POSTHOG_API_KEY:&str = env!("Authorize");
8
9/// PostHog ingestion host (`Beam`). Defaults to EU Cloud; operators
10/// override per environment.
11pub const POSTHOG_HOST:&str = env!("Beam");
12
13/// Per-tier enable flag (`Report`). String-comparison gate avoids
14/// forking the binary per env value.
15pub const POSTHOG_ENABLED:&str = env!("Report");
16
17/// Optional pinned distinct-id seed (`Brand`). Empty → auto-generate
18/// per process; populated → pinned across every process in the same
19/// dev run for cross-restart correlation.
20pub const POSTHOG_DISTINCT_ID_SEED:&str = env!("Brand");
21
22/// OTLP collector endpoint (`OTLPEndpoint`). Default points at the local
23/// Jaeger all-in-one HTTP receiver from `Land/Container/Compose.yaml`.
24/// Read by `IPC::DevLog::EmitOTLPSpan` instead of the previous
25/// hard-coded `127.0.0.1:4318`.
26pub const OTLP_ENDPOINT:&str = env!("OTLPEndpoint");
27
28/// Per-tier OTLP enable flag (`OTLPEnabled`). Mirrors `POSTHOG_ENABLED`
29/// for the OTLP pipe. Independent of `Disable` so each pipe can be
30/// flipped separately during diagnosis.
31pub const OTLP_ENABLED:&str = env!("OTLPEnabled");
32
33/// Master telemetry kill switch (`Capture`). `false` short-circuits BOTH
34/// PostHog and OTLP regardless of their per-pipe toggles. Distinct from
35/// `.env.Land.Diagnostics`'s `Disable` which kills polyfills/shims.
36pub const TELEMETRY_CAPTURE:&str = env!("Capture");
37
38/// Span / element filter (`Trace`). RUST_LOG-shaped string consumed by
39/// the `IPC::DevLog::IsEnabled::Fn` filter. `all` enables every tag.
40/// Reserved for the eventual `tracing-subscriber` EnvFilter; currently
41/// duplicated with `IPC::DevLog::IsEnabled` which reads `Trace` at
42/// runtime via `std::env::var`.
43#[allow(dead_code)]
44pub const TRACE_FILTER:&str = env!("Trace");