Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(browser): Trace continuation from server-timing headers #18673

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

Open
timfish wants to merge 1 commit into develop
base: develop
Choose a base branch
Loading
from timfish/feat/browser-server-timing

Conversation

@timfish
Copy link
Collaborator

@timfish timfish commented Jan 2, 2026
edited by github-actions bot
Loading

Currently the only way to propagate trace context from server to browser is via meta tags. In some cases modifying the page HTML can be difficult or have a performance impact.

This PR adds support to the browser SDK to fetch sentry-trace and baggage from the Server Timing header.

Closes #18678 (added automatically)

cursor[bot] reacted with thumbs up emoji sentry[bot] reacted with hooray emoji
Copy link
Contributor

github-actions bot commented Jan 2, 2026
edited
Loading

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.84 kB - -
@sentry/browser - with treeshaking flags 23.34 kB - -
@sentry/browser (incl. Tracing) 41.66 kB +0.11% +42 B 🔺
@sentry/browser (incl. Tracing, Profiling) 46.25 kB +0.09% +39 B 🔺
@sentry/browser (incl. Tracing, Replay) 80.24 kB +0.07% +50 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.98 kB +0.07% +46 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 84.92 kB +0.07% +53 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 97.17 kB +0.05% +41 B 🔺
@sentry/browser (incl. Feedback) 41.57 kB - -
@sentry/browser (incl. sendFeedback) 29.53 kB - -
@sentry/browser (incl. FeedbackAsync) 34.53 kB - -
@sentry/browser (incl. Metrics) 25.85 kB - -
@sentry/browser (incl. Logs) 26.07 kB - -
@sentry/browser (incl. Metrics & Logs) 26.82 kB - -
@sentry/react 26.58 kB - -
@sentry/react (incl. Tracing) 43.9 kB +0.12% +52 B 🔺
@sentry/vue 29.3 kB - -
@sentry/vue (incl. Tracing) 43.48 kB +0.11% +47 B 🔺
@sentry/svelte 24.86 kB - -
CDN Bundle 27.26 kB - -
CDN Bundle (incl. Tracing) 42.3 kB +0.09% +36 B 🔺
CDN Bundle (incl. Tracing, Replay) 79.02 kB +0.06% +45 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 84.48 kB +0.05% +39 B 🔺
CDN Bundle - uncompressed 80.02 kB - -
CDN Bundle (incl. Tracing) - uncompressed 125.63 kB +0.14% +171 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 242.16 kB +0.08% +171 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 254.95 kB +0.07% +171 B 🔺
@sentry/nextjs (client) 46.26 kB +0.12% +54 B 🔺
@sentry/sveltekit (client) 42.04 kB +0.12% +49 B 🔺
@sentry/node-core 51.69 kB - -
@sentry/node 161.61 kB - -
@sentry/node - without tracing 93.13 kB - -
@sentry/aws-serverless 108.64 kB - -

View base workflow run

This comment was marked as outdated.

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Thanks for adding this functionality, Tim!

If you don't mind, please also add an integration test with regular tracing. I think we have some meta-tags integration tests in our suites that we can take inspiration from.

timfish reacted with thumbs up emoji
Copy link
Contributor

github-actions bot commented Jan 3, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,270 - 9,202 +1%
GET With Sentry 1,774 19% 1,734 +2%
GET With Sentry (error only) 6,259 68% 6,088 +3%
POST Baseline 1,213 - 1,185 +2%
POST With Sentry 608 50% 574 +6%
POST With Sentry (error only) 1,079 89% 1,059 +2%
MYSQL Baseline 3,378 - 3,294 +3%
MYSQL With Sentry 473 14% 448 +6%
MYSQL With Sentry (error only) 2,745 81% 2,689 +2%

View base workflow run

@timfish timfish force-pushed the timfish/feat/browser-server-timing branch from d3377e1 to 3590824 Compare January 3, 2026 15:06
@timfish timfish force-pushed the timfish/feat/browser-server-timing branch from 3590824 to f8ce616 Compare January 3, 2026 15:26
@timfish timfish requested a review from Lms24 January 3, 2026 15:27
span_id: expect.stringMatching(/^[\da-f]{16}$/),
});
// navigation span is head of trace, so there's no parent span:
expect(navigationTraceContext?.trace_id).not.toHaveProperty('parent_span_id');
Copy link
Collaborator Author

@timfish timfish Jan 3, 2026

Choose a reason for hiding this comment

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

Cursor pointed out that the type/logic was wrong in this expection...

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

Reviewers

@cursor cursor[bot] cursor[bot] left review comments

@Lms24 Lms24 Awaiting requested review from Lms24

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

feat(browser): Trace continuation from server-timing headers

3 participants

AltStyle によって変換されたページ (->オリジナル) /