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