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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): Ensure fastify spans have better data #12106

Merged
merged 1 commit into from
May 17, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented May 17, 2024

This ensures we have correct op, name & origin for all fastify middleware spans.

Sadly, we have no good hook in fastify to handle all spans it emits - only request_handler spans are passed to requestHook 馃槵 so I opted to add a spanStart hook to handle this. Since it would suck to always register this, even without fastify being used, I put this into the fastify error handler - kind of mixing concerns there but I'd say it's fine for this case (as it just enhances the data).

I had some issues running this locally, so I changed the playwright config to not be TS which is IMHO ok and simplifies the setup a bit...

@mydea mydea self-assigned this May 17, 2024
This ensures we have correct op, name & origin for all fastify middleware spans.
@mydea mydea force-pushed the fn/fastify-middleware-spans branch from 3487263 to bbaf2e3 Compare May 17, 2024 12:01
Copy link
Contributor

size-limit report 馃摝

Path Size
@sentry/browser 21.72 KB (0%)
@sentry/browser (incl. Tracing) 32.88 KB (0%)
@sentry/browser (incl. Tracing, Replay) 68.23 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.61 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.27 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.27 KB (0%)
@sentry/browser (incl. Feedback) 37.68 KB (0%)
@sentry/browser (incl. sendFeedback) 26.29 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.66 KB (0%)
@sentry/react 24.41 KB (0%)
@sentry/react (incl. Tracing) 35.87 KB (0%)
@sentry/vue 25.66 KB (0%)
@sentry/vue (incl. Tracing) 34.69 KB (0%)
@sentry/svelte 21.86 KB (0%)
CDN Bundle 24.26 KB (0%)
CDN Bundle (incl. Tracing) 34.31 KB (0%)
CDN Bundle (incl. Tracing, Replay) 68 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 72.97 KB (0%)
CDN Bundle - uncompressed 71.33 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 101.74 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 211.36 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 223.66 KB (0%)
@sentry/nextjs (client) 35.09 KB (0%)
@sentry/sveltekit (client) 33.46 KB (0%)
@sentry/node 141.45 KB (+0.08% 馃敽)
@sentry/aws-serverless 128.08 KB (-0.01% 馃斀)

@mydea mydea merged commit 5317793 into develop May 17, 2024
85 checks passed
@mydea mydea deleted the fn/fastify-middleware-spans branch May 17, 2024 12:24
@mydea
Copy link
Member Author

mydea commented May 17, 2024

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