Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass client trace metadata to client in pages router #69620

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

lforst
Copy link
Contributor

@lforst lforst commented Sep 3, 2024

What?

Building on #64256, this PR forwards client trace metadata from OpenTelemetry to the client, but this time for the Pages router.

Why?

To reduce Telemetry libraries need to do expensive and complicated build-time instrumentation to pass these values to the client.

How?

We are using the ambient OpenTelemetry tracer to collect the data and pass it through the Document.

Resolves getsentry/sentry-javascript#13645

@ijjk ijjk added the type: next label Sep 3, 2024
@ijjk
Copy link
Member

ijjk commented Sep 3, 2024

Allow CI Workflow Run

  • approve CI run for commit: a636d73

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@@ -11,14 +11,6 @@ import { RedirectStatusCode } from '../../client/components/redirect-status-code
import { addPathPrefix } from '../../shared/lib/router/utils/add-path-prefix'
import type { ClientTraceDataEntry } from '../lib/trace/tracer'

export function getTracedMetadata(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this to the trace utils as a generic place because here it was in the app router code and we also want to use it in the pages router.

@lforst lforst changed the title Pass client trace metadata to pages router clients Pass client trace metadata to client in pages router Sep 4, 2024
@ijjk ijjk added the tests label Sep 4, 2024
@lforst lforst marked this pull request as ready for review September 4, 2024 08:57
@huozhi huozhi added the CI approved Approve running CI for fork label Sep 4, 2024
@ijjk
Copy link
Member

ijjk commented Sep 4, 2024

Tests Passed

@huozhi huozhi merged commit 47072bf into vercel:canary Sep 10, 2024
106 of 107 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Next.js] Contribute clientTraceMetadata for Pages Router upstream
3 participants