Skip to main content

Module ids

Module ids 

Source
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§

OtelIdError
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.