Skip to content

OpenTelemetry middleware TSDoc says extensions["x.otel"] but code uses the full vendor namespace #84

Closed

Description

@nficano

packages/middleware/otel/src/index.ts:9-13 and the withTracing TSDoc at packages/middleware/otel/src/index.ts:53 all describe trace context as living under extensions["x.otel"]. The actual key, defined at line 49 and used at lines 224 and 233, is "x-vendor.opentelemetry.tracecontext" — the spec-conformant x-vendor.<vendor>.<name> namespace, which the same comment block correctly explains on lines 46-48. The contradiction is internal: lines 46-49 explain why the long key is necessary, then lines 9-13 and 53 give the wrong short key to readers writing examples or integrating a non-SDK peer.

Fix prompt: replace every TSDoc reference to extensions["x.otel"] with extensions["x-vendor.opentelemetry.tracecontext"] in packages/middleware/otel/src/index.ts:9, packages/middleware/otel/src/index.ts:12, and packages/middleware/otel/src/index.ts:53. Where the wrapping prose gets cluttered, abbreviate as extensions[OTEL_EXTENSION_NAME] and add a one-line @see to the constant. Check that no other doc under docs/ cites the wrong key; update docs/packages/middleware-otel.md (if present) and any README example to match.

Activity

  1. narutamaaurum commented on May 23, 2026

    @narutamaaurum
    Contributor

    Opened PR #88 to replace the stale extensions["x.otel"] references with the actual x-vendor.opentelemetry.tracecontext key in the middleware TSDoc and tracing example docs. This aligns the docs/examples with the runtime constant and resolves the contradictory guidance called out in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationseverity:mediumMedium severity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions