Skip to content

Conversation

k-fish
Copy link
Member

@k-fish k-fish commented Oct 7, 2025

Summary

This allows the js sdk to send in new trace metric protocol items, although this code is experimental since the schema may still change. Most of this has been copied from logs so some parts may need to be modified / removed later (eg. api, buffer) but this should allow us to start on UI work by sending in larger amounts of data from sentry js app to test grouping / aggregations etc.

This allows the js sdk to send in new trace metric protocol items, although this code is experimental since the schema may still change. Most of this has been copied from logs so some parts may need to be modified / removed later (eg. buffer) but this should allow us to start on UI work by sending in larger amounts of data from sentry js app to test grouping / aggregations etc.
@k-fish k-fish requested review from AbhiPrasad and a team October 7, 2025 14:54
}
if (_enableTraceMetrics) {
_INTERNAL_flushMetricsBuffer(this);
}
Copy link

Choose a reason for hiding this comment

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

Bug: Syntax Error in Visibility Change Handler

A missing closing brace for the if (_enableTraceMetrics) block within the visibilitychange event handler causes a syntax error.

Fix in Cursor Fix in Web

if (metricBuffer.length >= MAX_METRIC_BUFFER_SIZE) {
_INTERNAL_flushMetricsBuffer(client, metricBuffer);
}
}
Copy link

Choose a reason for hiding this comment

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

Bug: Metric Loss During Buffer Flush

When the metric buffer reaches its maximum size, a newly captured metric is added to the buffer before the flush condition is evaluated. If a flush is triggered, it processes the buffer before the new metric was added. Subsequently, the entire buffer is cleared, causing the newly added metric to be lost and never sent.

Fix in Cursor Fix in Web

Copy link
Contributor

github-actions bot commented Oct 7, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.38 kB +0.51% +123 B 🔺
@sentry/browser - with treeshaking flags 22.88 kB +0.51% +114 B 🔺
@sentry/browser (incl. Tracing) 40.58 kB +0.35% +139 B 🔺
@sentry/browser (incl. Tracing, Replay) 78.97 kB +0.18% +139 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.61 kB +0.2% +132 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 83.65 kB +0.18% +150 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 95.81 kB +0.12% +111 B 🔺
@sentry/browser (incl. Feedback) 41.09 kB +0.3% +122 B 🔺
⛔️ @sentry/browser (incl. sendFeedback) (max: 29 kB) 29.04 kB +0.45% +128 B 🔺
@sentry/browser (incl. FeedbackAsync) 33.96 kB +0.33% +110 B 🔺
@sentry/react 26.09 kB +0.46% +119 B 🔺
@sentry/react (incl. Tracing) 42.54 kB +0.3% +124 B 🔺
@sentry/vue 28.9 kB +0.47% +133 B 🔺
@sentry/vue (incl. Tracing) 42.37 kB +0.27% +114 B 🔺
@sentry/svelte 24.42 kB +0.54% +131 B 🔺
⛔️ CDN Bundle (max: 26 kB) 26.56 kB +3.07% +791 B 🔺
⛔️ CDN Bundle (incl. Tracing) (max: 41 kB) 41.1 kB +1.91% +768 B 🔺
CDN Bundle (incl. Tracing, Replay) 77.39 kB +1.07% +815 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 82.85 kB +0.94% +768 B 🔺
CDN Bundle - uncompressed 77.97 kB +3.47% +2.61 kB 🔺
⛔️ CDN Bundle (incl. Tracing) - uncompressed (max: 120 kB) 121.97 kB +2.19% +2.61 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 237.13 kB +1.12% +2.61 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 249.89 kB +1.06% +2.61 kB 🔺
@sentry/nextjs (client) 44.57 kB +0.32% +142 B 🔺
@sentry/sveltekit (client) 40.96 kB +0.24% +98 B 🔺
@sentry/node-core 50.73 kB +0.32% +161 B 🔺
@sentry/node 154.36 kB +0.11% +168 B 🔺
@sentry/node - without tracing 92.58 kB +0.18% +161 B 🔺
@sentry/aws-serverless 106.31 kB +0.17% +171 B 🔺

View base workflow run

Copy link
Contributor

github-actions bot commented Oct 7, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,626 - 8,994 -4%
GET With Sentry 1,344 16% 1,430 -6%
GET With Sentry (error only) 6,105 71% 6,248 -2%
POST Baseline 1,164 - 1,205 -3%
POST With Sentry 515 44% 555 -7%
POST With Sentry (error only) 1,031 89% 1,068 -3%
MYSQL Baseline 3,351 - 3,329 +1%
MYSQL With Sentry 416 12% 505 -18%
MYSQL With Sentry (error only) 2,718 81% 2,716 +0%

View base workflow run

@chargome chargome self-requested a review October 8, 2025 07:03
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.

1 participant