HttpTraceContext
HTTP propagation helpers for Effect tracing context.
This module converts Effect Tracer.Span values into outbound trace headers and decodes inbound propagation headers into Tracer.ExternalSpan parents. HTTP clients use it to continue the current span across outgoing requests, and server middleware uses it to parent request spans from upstream services.
Decoding
Signature
declare const b3: FromHeaders;fromHeaders
Decodes an external span safely from HTTP trace propagation headers.
Details
W3C traceparent is tried first, followed by compact B3 (b3) and then multi-header B3 (x-b3-*).
Signature
declare function fromHeaders(headers: Headers): Option<ExternalSpan>;Decodes an external span safely from the W3C traceparent header.
Details
Only version 00 headers with valid trace and span identifiers are accepted.
Signature
declare const w3c: FromHeaders;Decodes an external span safely from multi-header B3 propagation headers.
Details
The decoder reads x-b3-traceid, x-b3-spanid, and optional x-b3-sampled headers.
Signature
declare const xb3: FromHeaders;Encoding
Models
FromHeaders interface
Function type for decoding tracing headers into an external span.
Details
Returns Option.none when the headers do not contain a supported or valid trace context.
Signature
interface FromHeaders {
(headers: Headers): Option<ExternalSpan>;
}
Decodes an external span safely from the compact B3
b3header.Details
Returns
Option.nonewhen the header is missing or does not contain trace and span identifiers.