Skip to content

feat(core): Move console integration into core and add to cloudflare/vercel-edge #16024

New issue

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

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

Already on GitHub? # to your account

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

AbhiPrasad
Copy link
Member

resolves #15439
resolves #4532

resolves https://linear.app/getsentry/issue/JSC-192

Supercedes #16021

Our console instrumentation was always inconsistent, but adding breadcrumbs should not really be. This PR adds a unified console instrumentation to @sentry/core, and makes the Node SDK use that. We also add this to the vercel-edge and cloudflare SDKs.

I also left todo comments in the deno and browser SDKs for us to unify into this single integration afterwards.

Copy link
Contributor

github-actions bot commented Apr 10, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.28 KB - -
@sentry/browser - with treeshaking flags 23.12 KB - -
@sentry/browser (incl. Tracing) 36.95 KB - -
@sentry/browser (incl. Tracing, Replay) 74.14 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.51 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 78.8 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 90.61 KB - -
@sentry/browser (incl. Feedback) 39.68 KB - -
@sentry/browser (incl. sendFeedback) 27.9 KB - -
@sentry/browser (incl. FeedbackAsync) 32.67 KB - -
@sentry/react 25.09 KB - -
@sentry/react (incl. Tracing) 38.87 KB - -
@sentry/vue 27.51 KB - -
@sentry/vue (incl. Tracing) 38.67 KB - -
@sentry/svelte 23.32 KB - -
CDN Bundle 24.51 KB - -
CDN Bundle (incl. Tracing) 36.95 KB - -
CDN Bundle (incl. Tracing, Replay) 71.99 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 77.16 KB - -
CDN Bundle - uncompressed 71.47 KB - -
CDN Bundle (incl. Tracing) - uncompressed 109.23 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.52 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 233.05 KB - -
@sentry/nextjs (client) 40.49 KB - -
@sentry/sveltekit (client) 37.39 KB - -
@sentry/node 143.23 KB +0.1% +141 B 🔺
@sentry/node - without tracing 96.47 KB +0.19% +184 B 🔺
@sentry/aws-serverless 120.77 KB +0.12% +140 B 🔺

View base workflow run

Co-authored-by: Francesco Gringl-Novy <francesco.novy@sentry.io>
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.

I think this is a worthwhile change! Nice!

Comment on lines 37 to 38
it('handles different console levels correctly', () => {
const levels = ['debug', 'info', 'warn', 'error'] as const;
Copy link
Member

Choose a reason for hiding this comment

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

l/nit: I'd rather use it.each so that we'd know for which specific level the test failed.

Also q: I noticed this pattern in quite a few tests (not yours, more generally in the repo) and was wondering: Am I maybe missing something why this is preferrable over it.each? 😅

Again, not a blocker, feel free to ignore

Copy link
Member Author

Choose a reason for hiding this comment

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

Also q: I noticed this pattern in quite a few tests (not yours, more generally in the repo) and was wondering: Am I maybe missing something why this is preferrable over it.each? 😅

I've been leaning less toward using it.each because it's easier for me to it.only test one at a time, but I agree the table test is the better pattern here. Will change.

@AbhiPrasad AbhiPrasad merged commit d007407 into develop Apr 10, 2025
152 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-move-console-to-core branch April 10, 2025 11:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add Console integration to @sentry/cloudflare Unify console instrumentation
3 participants