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

feat(sveltekit): Switch to Otel-based @sentry/node package #11075

Merged
merged 6 commits into from Mar 15, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Mar 13, 2024

This PR switches the underlying Node SDK from @sentry/node-experimental (aka the "legacy" v7 Node SDK) to the new OpenTelemetry-based @sentry/node package.

Had to make a couple of adjustments for tests but overall, the process was rather smooth.

Known Issues

  • Sever-side fetch calls are no longer auto-instrumented in dev mode. They're still instrumented in prod builds. This is because the SDK/Otel seems to initialize too late in dev mode so the instrumentation of node fetch (undici) doesn't work anymore (?)

@Lms24 Lms24 force-pushed the lms/feat-sveltekit-otel-node branch from 3bc9e3f to 762c5c5 Compare March 14, 2024 11:45
@Lms24 Lms24 changed the base branch from develop to fn/otel-sampling-propagation March 14, 2024 11:46
Base automatically changed from fn/otel-sampling-propagation to develop March 14, 2024 14:00
@Lms24 Lms24 force-pushed the lms/feat-sveltekit-otel-node branch from c29cb28 to 7ef5b51 Compare March 14, 2024 14:57
@Lms24 Lms24 self-assigned this Mar 14, 2024
@Lms24 Lms24 requested review from mydea and AbhiPrasad March 14, 2024 15:46
@Lms24 Lms24 marked this pull request as ready for review March 14, 2024 15:46
@@ -229,6 +229,7 @@ describe('handleSentry', () => {
expect(_span!.spanContext().traceId).toEqual('1234567890abcdef1234567890abcdef');
expect(spanToJSON(_span!).parent_span_id).toEqual('1234567890abcdef');
expect(spanIsSampled(_span!)).toEqual(true);
expect(_span!.metadata!.dynamicSamplingContext).toEqual({});
Copy link
Member

Choose a reason for hiding this comment

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

hmm, this actually works? 😅 I thought this should fail as this would not be set?

Can we do instead getDynamicSamplingContextForSpan(_span) here to test this, maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was as surprised as you that it works 😅 hmm I don't wanna use getDynamicSamplingContextForSpan here because I don't think this is necessarily all the logic that contributes to what we ultimately propagate/put into the envelope. Maybe I just refactor these tests similarly to the ones in load.test.ts to use the beforeEnvelope hook to check for the trace header.

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

niiiiiice

@Lms24 Lms24 force-pushed the lms/feat-sveltekit-otel-node branch from e212246 to 9cd0647 Compare March 15, 2024 12:32
Copy link
Contributor

github-actions bot commented Mar 15, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) 82.29 KB (added)
@sentry/browser (incl. Tracing, Replay) 73.62 KB (added)
@sentry/browser (incl. Tracing, Replay with Canvas) 77.43 KB (added)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.17 KB (added)
@sentry/browser (incl. Tracing) 38.25 KB (added)
@sentry/browser (incl. browserTracingIntegration) 38.25 KB (added)
@sentry/browser (incl. feedbackIntegration) 33.11 KB (added)
@sentry/browser (incl. feedbackModalIntegration) 33.2 KB (added)
@sentry/browser (incl. feedbackScreenshotIntegration) 33.21 KB (added)
@sentry/browser (incl. sendFeedback) 29.17 KB (added)
@sentry/browser 24.35 KB (added)
CDN Bundle (incl. Tracing, Replay, Feedback) 76.62 KB (added)
CDN Bundle (incl. Tracing, Replay) 71.48 KB (added)
CDN Bundle (incl. Tracing) 37.82 KB (added)
CDN Bundle 25.68 KB (added)
CDN Bundle (incl. Tracing, Replay) - uncompressed 224.12 KB (added)
CDN Bundle (incl. Tracing) - uncompressed 114.06 KB (added)
CDN Bundle - uncompressed 75.9 KB (added)
@sentry/react (incl. Tracing, Replay) 73.61 KB (added)
@sentry/react 24.37 KB (added)

@Lms24 Lms24 enabled auto-merge (squash) March 15, 2024 13:37
@Lms24 Lms24 merged commit b0e1db0 into develop Mar 15, 2024
58 checks passed
@Lms24 Lms24 deleted the lms/feat-sveltekit-otel-node branch March 15, 2024 13:47
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
…ry#11075)

This PR switches the underlying Node SDK from
`@sentry/node-experimental` (aka the "legacy" v7 Node SDK) to the new
OpenTelemetry-based `@sentry/node` package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants