Skip to content

fix(node): Flush buffered metrics on process exit - #24806

Merged
nicohrubec merged 1 commit into
developfrom
nh/flush-metrics
Sep 29, 2026
Merged

nicohrubec merged 1 commit into
developfrom
nh/flush-metrics

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Add the missing beforeExit flush for metrics, matching the existing behavior for logs and client reports. This ensures buffered metrics are sent when a Node process exits naturally, even if the timer or size threshold has not triggered a flush yet.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 29a93e1. Configure here.

Comment thread packages/node/test/sdk/client.test.ts
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31.08 kB - -
@sentry/react (incl. Tracing) 53.54 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 31.02 kB - -
CDN Bundle (incl. Tracing) 51.77 kB - -
CDN Bundle (incl. Logs, Metrics) 33.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.75 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74 kB - -
CDN Bundle (incl. Tracing, Replay) 89.36 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.53 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.5 kB - -
CDN Bundle - uncompressed 91.66 kB - -
CDN Bundle (incl. Tracing) - uncompressed 154.03 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.99 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.8 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.76 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.7 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.39 kB - -
@sentry/nextjs (client) 55.78 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.99 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 141.92 kB +0.04% +47 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.88 kB - -
@sentry/node - without tracing 90.93 kB +0.06% +47 B 🔺
@sentry/node - without channel injection 120.29 kB +0.04% +41 B 🔺
@sentry/aws-serverless 99.17 kB +0.04% +35 B 🔺
@sentry/cloudflare (withSentry) - minified 206.62 kB - -
@sentry/cloudflare (withSentry) 514.02 kB - -

View base workflow run

@nicohrubec
nicohrubec marked this pull request as ready for review September 28, 2026 17:33
@nicohrubec
nicohrubec requested a review from a team as a code owner September 28, 2026 17:33
@nicohrubec
nicohrubec requested review from JPeer264 and isaacs and removed request for a team September 28, 2026 17:33
@nicohrubec
nicohrubec merged commit 545d1e1 into develop Sep 29, 2026
244 checks passed
@nicohrubec
nicohrubec deleted the nh/flush-metrics branch September 29, 2026 06:58
nicohrubec added a commit that referenced this pull request Sep 29, 2026
Add the missing metrics exit on flush in Deno similar to
#24806.

---------

Co-authored-by: GPT-6 <codex@openai.com>
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