Skip to content

fix(node-core): Apply correct SDK metadata #17014

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

Merged
merged 3 commits into from
Jul 15, 2025

Conversation

andreiborza
Copy link
Member

@andreiborza andreiborza commented Jul 15, 2025

While adding the SDK to the release-registry I noticed that we never apply the correct metadata to node-core.

64d056a failing tests show the node-core SDK getting incorrect sentry.javascript.node metadata (from NodeClient)

88a975a applies correct metadata to both SDKs

I was debating changing the underlying NodeClient to not automatically set sentry.javascript.node but wasn't sure of the implications so decided not to.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Node SDK Metadata Overwrite Error

The Node SDK incorrectly reports 'sentry.javascript.node-core' metadata instead of 'sentry.javascript.node'. This occurs because the applySdkMetadata call for 'node' in the Node SDK's _init function is overwritten by a subsequent applySdkMetadata call for 'node-core' within initNodeCore, as both operate on the same options object.

packages/node/src/sdk/index.ts#L52-L59

): NodeClient | undefined {
applySdkMetadata(options, 'node');
const client = initNodeCore({
...options,
// Only use Node SDK defaults if none provided
defaultIntegrations: options.defaultIntegrations ?? getDefaultIntegrationsImpl(options),
});

packages/node-core/src/sdk/index.ts#L123-L124

applySdkMetadata(options, 'node-core');

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.88 kB - -
@sentry/browser - with treeshaking flags 22.35 kB - -
@sentry/browser (incl. Tracing) 39.75 kB - -
@sentry/browser (incl. Tracing, Replay) 77.88 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.61 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.58 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 94.68 kB - -
@sentry/browser (incl. Feedback) 40.58 kB - -
@sentry/browser (incl. sendFeedback) 28.56 kB - -
@sentry/browser (incl. FeedbackAsync) 33.46 kB - -
@sentry/react 25.61 kB - -
@sentry/react (incl. Tracing) 41.72 kB - -
@sentry/vue 28.31 kB - -
@sentry/vue (incl. Tracing) 41.53 kB - -
@sentry/svelte 23.9 kB - -
CDN Bundle 25.18 kB - -
CDN Bundle (incl. Tracing) 39.44 kB - -
CDN Bundle (incl. Tracing, Replay) 75.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 80.91 kB - -
CDN Bundle - uncompressed 73.54 kB - -
CDN Bundle (incl. Tracing) - uncompressed 116.99 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 243.99 kB - -
@sentry/nextjs (client) 43.75 kB - -
@sentry/sveltekit (client) 40.2 kB - -
@sentry/node 167.69 kB +0.02% +19 B 🔺
@sentry/node - without tracing 100.34 kB -0.02% -17 B 🔽
@sentry/aws-serverless 128.48 kB +0.02% +13 B 🔺

View base workflow run

@andreiborza andreiborza merged commit 90c2385 into develop Jul 15, 2025
234 of 235 checks passed
@andreiborza andreiborza deleted the ab/set-correct-sdk-metadata branch July 15, 2025 12:41
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.

2 participants