Skip to main content

persistant_core/
telemetry.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! The one set of `tracing` field names every kind's traced wrapper uses (`docs/DESIGN-KINDS.md` ยง5).
3//!
4//! A span named [`SPAN`] carries [`KIND`], [`BACKEND`], [`OP`], [`CAPABILITY`] and, once the call has
5//! returned, [`OUTCOME`]. **No key and no value content, and no error text**, is ever a field: keys
6//! can be secrets, and an error message can quote one. Counters are the consumer's subscriber's job.
7
8/// The span's name.
9pub const SPAN: &str = "persist";
10/// Field: the kind (`kv`, `blob`, `rel`).
11pub const KIND: &str = "persist.kind";
12/// Field: the backend's name, as `backend()` reports it.
13pub const BACKEND: &str = "persist.backend";
14/// Field: the operation (`get`, `put`, `batch`, ...).
15pub const OP: &str = "persist.op";
16/// Field: the capability id the operation exercises (`kv.get`, ...).
17pub const CAPABILITY: &str = "persist.capability";
18/// Field, recorded when the call returns: `ok`, or the error's kind (`backend`, `unsupported`,
19/// `corrupt`, `timed_out`).
20pub const OUTCOME: &str = "persist.outcome";