Expand description
OTEL ID validation utilities
Validates trace_id (32 hex chars) and span_id (16 hex chars) according to OpenTelemetry specification.
§Validation Pattern
CRITICAL: When validating “lowercase hex digits”, we must allow:
- Digits: 0-9 (these are NOT lowercase, so
is_ascii_lowercase()returns false) - Lowercase hex letters: a-f
WRONG: c.is_ascii_lowercase() && c.is_ascii_hexdigit() — fails for digits!
CORRECT: c.is_ascii_hexdigit() && !c.is_ascii_uppercase() — allows digits + lowercase, rejects uppercase.
This pattern must be used consistently across all hex validation code.
Enums§
- Otel
IdError - Error returned when an OTEL ID format is invalid
Functions§
- validate_
span_ id - Validates a span_id according to OTEL specification.
- validate_
trace_ id - Validates a trace_id according to OTEL specification.