Skip to main content

Crate error_label

Crate error_label 

Source
Expand description

Low-cardinality label for errors, useful for metrics and logging.

ErrorLabel holds a low-cardinality string value intended for use as a metric tag or structured log field. Values should always be chosen from a small, bounded set.

§Quick Start

use error_label::ErrorLabel;

// From a static string
let label: ErrorLabel = "timeout".into();
assert_eq!(label, "timeout");

// Dotted chain from parts
let label = ErrorLabel::from_parts(["http", "client", "timeout"]);
assert_eq!(label, "http.client.timeout");

Structs§

ErrorLabel
A low-cardinality label for an error, useful for metrics and logging.