Skip to content

OpenTelemetry: clientTraceMetadata not injected into SSR head #1494

Description

@james-elicx

This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-22).

Problem

The clientTraceMetadata config from next.config.js should produce <meta> tags in the SSR head (e.g. <meta name="my-test-key-1" content="my-test-value-1">). vinext renders the page without these meta tags. Affects both App Router and Pages Router.

clientTraceMetadata keys configured but corresponding <meta> tags not present in SSR HTML

Estimated Impact

~5 test failures across the deploy suite.

Affected Test Suites

  • test/e2e/opentelemetry/client-trace-metadata/client-trace-metadata.test.ts (5 failures)

Recommendation

  1. Reproduce first in vinext's own test suite. Configure clientTraceMetadata: ['my-test-key-1'] and assert a <meta name="my-test-key-1"> is in the SSR head.

  2. Implement the renderer. On each SSR render, read clientTraceMetadata from the OTel active span's baggage and emit a <meta> for each configured key.

  3. Cover App Router and Pages Router renderers. Both routers need the injection.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions