(headers)
| 110 | * @since 4.0.0 |
| 111 | */ |
| 112 | export const xb3: FromHeaders = (headers) => { |
| 113 | if (!(headers["x-b3-traceid"]) || !(headers["x-b3-spanid"])) { |
| 114 | return Option.none() |
| 115 | } |
| 116 | return Option.some(Tracer.externalSpan({ |
| 117 | traceId: headers["x-b3-traceid"], |
| 118 | spanId: headers["x-b3-spanid"], |
| 119 | sampled: headers["x-b3-sampled"] ? headers["x-b3-sampled"] === "1" : true |
| 120 | })) |
| 121 | } |
| 122 | |
| 123 | const w3cTraceId = /^[0-9a-f]{32}$/i |
| 124 | const w3cSpanId = /^[0-9a-f]{16}$/i |