Skip to content

Conversation

chargome
Copy link
Member

@chargome chargome commented Oct 10, 2025

  • Fixing some of the types according to the specs.
  • Do not send metric when trace is not available

@chargome chargome self-assigned this Oct 10, 2025
@chargome chargome changed the title fix(tracemetrics): Update types feat(tracemetrics)!: Update types Oct 10, 2025
Copy link
Contributor

github-actions bot commented Oct 10, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.4 kB - -
@sentry/browser - with treeshaking flags 22.9 kB - -
@sentry/browser (incl. Tracing) 40.61 kB - -
@sentry/browser (incl. Tracing, Replay) 78.98 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.62 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.67 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.82 kB - -
@sentry/browser (incl. Feedback) 41.1 kB - -
@sentry/browser (incl. sendFeedback) 29.06 kB - -
@sentry/browser (incl. FeedbackAsync) 33.97 kB - -
@sentry/react 26.11 kB - -
@sentry/react (incl. Tracing) 42.55 kB - -
@sentry/vue 28.92 kB - -
@sentry/vue (incl. Tracing) 42.39 kB - -
@sentry/svelte 24.44 kB - -
CDN Bundle 26.64 kB +0.02% +5 B 🔺
CDN Bundle (incl. Tracing) 41.16 kB +0.02% +8 B 🔺
CDN Bundle (incl. Tracing, Replay) 77.45 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 82.91 kB +0.01% +8 B 🔺
CDN Bundle - uncompressed 78.2 kB +0.03% +19 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 122.2 kB +0.02% +19 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 237.36 kB +0.01% +19 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 250.12 kB +0.01% +19 B 🔺
@sentry/nextjs (client) 44.64 kB - -
@sentry/sveltekit (client) 40.98 kB - -
@sentry/node-core 50.72 kB -0.03% -13 B 🔽
@sentry/node 154.35 kB -0.01% -15 B 🔽
@sentry/node - without tracing 92.57 kB -0.02% -12 B 🔽
@sentry/aws-serverless 106.31 kB -0.01% -10 B 🔽

View base workflow run

Copy link
Contributor

github-actions bot commented Oct 10, 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,921 - 9,063 -2%
GET With Sentry 1,325 15% 1,396 -5%
GET With Sentry (error only) 6,136 69% 6,125 +0%
POST Baseline 1,193 - 1,208 -1%
POST With Sentry 487 41% 511 -5%
POST With Sentry (error only) 1,041 87% 1,045 -0%
MYSQL Baseline 3,274 - 3,293 -1%
MYSQL With Sentry 525 16% 489 +7%
MYSQL With Sentry (error only) 2,670 82% 2,726 -2%

View base workflow run

@chargome chargome requested review from AbhiPrasad and k-fish October 13, 2025 09:04

return 0;
}

Copy link

Choose a reason for hiding this comment

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

Bug: Unused Functions Cause Compilation Errors

The estimateMetricSizeInBytes, estimateLogSizeInBytes, and estimatePrimitiveSizeInBytes functions seem accidentally committed. They are unused, unrelated to the PR's purpose, and cause compilation errors due to undefined types (Metric, Log, Primitive) and the isPrimitive function. Furthermore, their array size estimation logic accesses value[0] without checking for empty arrays and assumes homogeneous element types.

Fix in Cursor Fix in Web

const spanId = span ? span.spanContext().spanId : undefined;

if (!traceId) {
DEBUG_BUILD && debug.warn('[Metric] No trace ID available, will not send metric.');
Copy link
Member

Choose a reason for hiding this comment

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

We don't do this for logs. When can this ever happen?

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