{"record":{"id":"2d99c0e5f4248cb5","repo":"denoland/deno","slug":"failed-to-extract-with-propagator-constructor-na","errorCode":null,"errorMessage":"Failed to extract with ${propagator.constructor.name}.","messagePattern":"Failed to extract with (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"ext/telemetry/telemetry.ts","lineNumber":1843,"sourceCode":"      try {\n        propagator.inject(context, carrier, setter);\n      } catch (err) {\n        // deno-lint-ignore no-console\n        console.warn(\n          `Failed to inject with ${propagator.constructor.name}.`,\n          err,\n        );\n      }\n    }\n  }\n\n  extract(context: Context, carrier: unknown, getter: TextMapGetter): Context {\n    return ArrayPrototypeReduce(this.#propagators, (ctx, propagator) => {\n      try {\n        return propagator.extract(ctx, carrier, getter);\n      } catch (err) {\n        // deno-lint-ignore no-console\n        console.warn(\n          `Failed to extract with ${propagator.constructor.name}.`,\n          err,\n        );\n      }\n      return ctx;\n    }, context);\n  }\n\n  fields(): string[] {\n    return ArrayPrototypeSlice(this.#fields);\n  }\n}\n\nlet builtinTracerCache: Tracer;\n\nfunction builtinTracer(): Tracer {\n  if (!builtinTracerCache) {\n    builtinTracerCache = new Tracer(OtelTracer.builtin());","sourceCodeStart":1825,"sourceCodeEnd":1861,"githubUrl":"https://github.com/denoland/deno/blob/a961cdec3b1948844414ebeecc697dcad76df2d1/ext/telemetry/telemetry.ts#L1825-L1861","documentation":"The extract twin of the inject warning in ext/telemetry/telemetry.ts: CompositePropagator.extract reduces over registered propagators, and any propagator that throws while parsing incoming headers is reduced to this warning; the reduce then returns the previous context (line 1825), so extraction silently degrades to no propagated trace. Requests continue, but spans will not be correlated with the upstream.","triggerScenarios":"An incoming carrier (typically request headers) carries a malformed traceparent, tracestate, or b3/b3-multi header that makes a propagator's extract throw; or a custom registered propagator throws on the getter/carrier combination. Note the W3C propagator usually ignores unparseable headers, so a throw typically implicates custom propagators or SDK bugs.","commonSituations":"Upstream services or load balancers generating non-compliant traceparent values (wrong lengths, non-hex chars, extra spaces); hand-set tracing headers in test fixtures; proxies that truncate or mangle distributed-tracing headers; mixing b3 and W3C formats across services.","solutions":["Log and inspect the exact incoming traceparent/b3 headers when the warning appears; wrong length or non-hex characters are the usual culprit","Validate/strip malformed tracing headers at your edge middleware before otel extraction sees them","If a custom propagator is registered, harden its extract to return the input context instead of throwing on bad input","Upgrade Deno if the headers are well-formed and the vendored propagator still throws"],"exampleFix":"// before: malformed header reaches extraction, warning logged, trace context lost\nconst ctx = propagator.extract(ROOT_CONTEXT, request.headers);\n\n// after: gate extraction on a format check\nconst tp = request.headers.get(\"traceparent\") ?? \"\";\nconst ctx = /^\\d{2}-[\\da-f]{32}-[\\da-f]{16}-[\\da-f]{2}$/.test(tp.toLowerCase())\n  ? propagator.extract(ROOT_CONTEXT, request.headers)\n  : ROOT_CONTEXT;","handlingStrategy":"validation","validationCode":"// drop malformed tracing headers before otel ever parses them\nconst TRACEPARENT = /^[\\da-f]{2}-[\\da-f]{32}-[\\da-f]{16}-[\\da-f]{2}$/;\nexport function extractContext(ctx: Context, headers: Headers): Context {\n  const tp = headers.get(\"traceparent\");\n  if (tp && !TRACEPARENT.test(tp.toLowerCase())) return ctx; // malformed -> start fresh trace\n  return propagator.extract(ctx, headers);\n}","typeGuard":"function isTraceparent(h: string | null): boolean {\n  return !!h && /^[\\da-f]{2}-[\\da-f]{32}-[\\da-f]{16}-[\\da-f]{2}$/.test(h.toLowerCase());\n}","tryCatchPattern":null,"preventionTips":["Reject or strip malformed traceparent/b3 headers in edge middleware before extraction","Never generate your own traceparent strings; use the SDK","Check for proxies/LBs that truncate or mangle distributed-tracing headers","Remember a warned extract returns the prior context: requests proceed but traces silently split"],"tags":["telemetry","opentelemetry","context-propagation","tracing","headers"],"backgroundTag":"context-propagation-failed","analyzedSha":"a961cdec3b1948844414ebeecc697dcad76df2d1","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}