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

fix(node): Ensure fetch/http breadcrumbs are created correctly #12137

Merged
merged 2 commits into from
May 22, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented May 21, 2024

This PR ensures that (node) fetch and http requests generate breadcrumbs correctly, even if tracing is disabled.

It also adds tests for this, and ensures we pass the request/response to the hint correctly.

Fixes #12132

@mydea mydea requested review from Lms24, AbhiPrasad and andreiborza May 21, 2024 11:28
@mydea mydea self-assigned this May 21, 2024
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Can we add a test?

Copy link
Contributor

github-actions bot commented May 21, 2024

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.3 KB (0%)
@sentry/browser (incl. Feedback) 37.71 KB (0%)
@sentry/browser (incl. sendFeedback) 26.29 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.69 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) 73 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.72 KB (0%)
@sentry/nextjs (client) 35.09 KB (0%)
@sentry/sveltekit (client) 33.46 KB (0%)
@sentry/node 128.41 KB (-4.34% 🔽)
@sentry/aws-serverless 114.42 KB (-10.77% 🔽)

@TheHolyWaffle
Copy link

This should also be added to the httpIntegration?

@mydea mydea changed the title fix(node): Add request to hint for native node fetch breadcrumb fix(node): Ensure fetch/http breadcrumbs are created correctly May 21, 2024
@mydea
Copy link
Member Author

mydea commented May 21, 2024

Can we add a test?

Did that! And actually noticed this was fundamentally flawed, and tied to the http.client spans - so it was not working at all without performance 😬 so I adjusted all of this for fetch and http to ensure we always get breadcrumbs, and added tests for this.

@mydea mydea force-pushed the fn/node-fetch-breadcrumb-hint branch from 012ca89 to a5558ec Compare May 22, 2024 07:21
@mydea mydea merged commit a7aa8a0 into develop May 22, 2024
85 checks passed
@mydea mydea deleted the fn/node-fetch-breadcrumb-hint branch May 22, 2024 08:36
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.

beforeBreadcrumb can no longer access original Request object in v8
3 participants