Skip to content

docs: match the otel kit example to the sdk - #31

Open
Philip Snyder (pjsny) wants to merge 1 commit into
mainfrom
docs/otel-kit-example
Open

Philip Snyder (pjsny) wants to merge 1 commit into
mainfrom
docs/otel-kit-example

Conversation

@pjsny

Copy link
Copy Markdown
Member

Description

The sdk/opentelemetry page shows how to compose buildInterfereOtelKit() with @vercel/otel. The example did not match the current @interfere/next source:

  • It did not pass kit.idGenerator.
  • It composed the propagators as ["auto", ...kit.propagators]. The kit TSDoc requires ["auto", kit.traceContextPropagator, ...kit.propagators], and the SDK's own register() uses that order.
  • The table did not list idGenerator or traceContextPropagator.

This change updates the example, the kit table and the propagator sentence. The descriptions come from InterfereOtelKit in src/packages/public/next/src/instrumentation.ts and the propagator classes under src/internal/server/tracing/ in the monorepo.

The same example also goes into the @interfere/next README and the @vercel/otel guide on interfere.com.

Verification

  • bun run format, bun run lint, bun run typecheck, bun run validate and bun run check:links pass.
  • In bun run dev, /sdk/opentelemetry shows the new example and the table with 9 rows.
  • In the monorepo, the same example passed tsc --noEmit against @vercel/otel@2.1.3 types.

The OpenTelemetry composition page left out `idGenerator` and
`traceContextPropagator`, and composed the propagators as
`["auto", ...kit.propagators]`. The current `@interfere/next` kit needs
`["auto", kit.traceContextPropagator, ...kit.propagators]`.

- Update the `instrumentation.ts` example to match the kit source.
- Add `idGenerator` and `traceContextPropagator` to the kit table.
- State that the kit returns `null` on the Edge runtime, and that the
  app configuration selects drain or direct export.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant