Parse traceparent and tracestate HTTP headers from OpenTelemetry, Jaeger, Zipkin, AWS X-Ray, and any service that follows the W3C Trace Context spec. See the version, 128-bit trace-id, 64-bit parent (span) id, and the sampled flag — or generate a spec-valid header to inject into a request.
traceparenttracestate · vendor-specific payload, comma-separatedCreates a new random trace-id + parent-id using crypto.getRandomValues. Useful when you need to inject a header into a curl request or a smoke test.
The Trace Context spec (W3C Recommendation, Feb 2020) standardises two HTTP headers so traces survive across heterogeneous systems — an OpenTelemetry-instrumented Go service can hand the trace to a Java service using Jaeger which then hands it to a Rust service using Datadog, and they all stitch into one span tree. traceparent carries the four primary fields in a fixed-length compact format. tracestate carries vendor-specific extension data without forcing every implementation to understand it. The version field is reserved for future fields; today only 00 exists. The only trace-flag bit defined in v0 is the low bit, sampled — if the upstream caller drops the trace, downstream services usually drop it too.