The value to test
true for 32 lowercase hex characters that are not all zero
isTraceId('4bf92f3577b34da6a3ce929d0e0e4736'); // true
isTraceId('00000000000000000000000000000000'); // false
isTraceId('not-a-trace-id'); // false
export function isTraceId(value: unknown): value is string {
return typeof value === 'string' && TRACE_ID_PATTERN.test(value);
}
Whether a value is a well-formed trace id, so a malformed one is never sent as the
trace_id.