telemetry-safe
telemetry-safe is the main facade crate for defining which values are allowed
to flow into telemetry.
It re-exports:
ToTelemetrytelemetry(&value)telemetry_debug(&value)#[derive(ToTelemetry)]
Use this crate when you want compile-time enforcement that only explicitly approved representations can be emitted through logging, tracing, metrics, or other observability paths.
Why this crate exists
Plain tracing, logging, or metrics code makes it easy to accidentally send
PII through Debug, Display, or default instrumentation behavior.
telemetry-safe takes an opt-in, type-driven approach instead:
- values must implement
ToTelemetrybefore they can be emitted - raw
String/&strare not blanket-approved - unsafe paths fail at compile time rather than depending on review discipline
Basic example
use ;
use ;
;
;
let attempt = LoginAttempt ;
assert_eq!;
Related crates
telemetry-safe-core- the minimal backend-agnostic core
telemetry-safe-tracingtracingintegration, including#[safe_instrument]
For the full project overview and workspace-level documentation, see the repository README at https://github.com/milabo/telemetry-safe-rs.