Available on crate features
metrics or otel-metrics only.Expand description
Bounded label values for Prometheus / OTel metrics.
Each enum represents a label whose value set is fixed at compile time. Wrapping label arguments in these types stops free-form strings from sliding into metric labels and blowing up TSDB cardinality.
Variant choice aligns with industry conventions:
TransportKind– one variant pertransport-*cargo feature; label values match OTelmessaging.system.FlushTrigger– standard buffer-flush triggers seen across Kafka producers and batch processors.AuthFailureReason– RFC 6749 OAuth 2.0 + JWT-specific failure codes; label values are the RFC strings.ValidationFailureReason– JSON Schema 2020-12 validator error categories.
No Other catch-all: every code path that names a failure must
pick a variant. Add new variants here when a real new failure
mode appears; never widen at the call site.
Enums§
- Auth
Failure Reason - Authentication failure reason. RFC 6749 / OAuth 2.0 error codes plus the JWT-specific failure modes most apps observe.
- Flush
Trigger - Buffer-flush trigger. Bounded set covering the patterns in every batch processor I’ve seen.
- Transport
Kind - Transport backend kind. One variant per
transport-*cargo feature plusrouted. Aligns with OTelmessaging.systemattribute values where they overlap (kafka, redis, http). - Validation
Failure Reason - Payload validation failure reason. Categories mirror the JSON Schema 2020-12 validator error taxonomy (Ajv, python-jsonschema, et al.).