MCPcopy Index your code
hub / github.com/Effect-TS/effect / xb3

Function xb3

packages/platform/src/HttpTraceContext.ts:67–76  ·  view source on GitHub ↗
(headers)

Source from the content-addressed store, hash-verified

65 * @category decoding
66 */
67export const xb3: FromHeaders = (headers) => {
68 if (!(headers["x-b3-traceid"]) || !(headers["x-b3-spanid"])) {
69 return Option.none()
70 }
71 return Option.some(Tracer.externalSpan({
72 traceId: headers["x-b3-traceid"],
73 spanId: headers["x-b3-spanid"],
74 sampled: headers["x-b3-sampled"] ? headers["x-b3-sampled"] === "1" : true
75 }))
76}
77
78const w3cTraceId = /^[0-9a-f]{32}$/i
79const w3cSpanId = /^[0-9a-f]{16}$/i

Callers 1

fromHeadersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected