Skip to main content

plumb_core/
telemetry.rs

1//! Opt-in telemetry stub.
2//!
3//! Shipped as a no-op in the walking skeleton so future telemetry work
4//! doesn't need a schema migration. The default is [`TelemetryMode::Off`]
5//! and [`emit`] is a no-op.
6
7use serde::{Deserialize, Serialize};
8
9/// Telemetry mode — controlled by the user via config and `PLUMB_TELEMETRY`.
10#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
11#[serde(rename_all = "snake_case")]
12pub enum TelemetryMode {
13    /// No telemetry sent.
14    #[default]
15    Off,
16    /// Anonymous counts only — no URLs, no violation content.
17    Anon,
18}
19
20/// Record a telemetry event. No-op in the walking skeleton.
21#[inline]
22pub fn emit(_event: &str) {
23    // Intentionally empty.
24}