Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Dec 19, 2025

pre-work for #18160

Use the same attibute serialization logic we already use in logs.

Bundle size impact:

  • size decreases for users with logs and metrics
  • size increases for metrics-only users. I think this is because previously the separate serialization logic could be inlined a lot while now it has to inline the slightly larger logic. Since it's not used in any non-treeshakeable default behavior (yet), this results in higher bundle size. Given we'll use this in our span serialization logic in v11, it will become part of the minimum SDK anyway (without metrics), so it should be fine to do this now.
  • Because we include metrics (but not logs) in all our CDN bundles by accident, this now also increases CDN bundle size 😬. We're tracking removal of this for most bundles in v11 (Create separate cdn bundles for metrics #18583)

I think the largest positive long-term aspect of this refactor is that we'll re-use this logic more and more going forward (scope attributes on metrics, spansv2, and other telemetry items in the future), so I'd like to have it unified.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 19, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.82 kB - -
@sentry/browser - with treeshaking flags 23.32 kB - -
@sentry/browser (incl. Tracing) 41.6 kB - -
@sentry/browser (incl. Tracing, Profiling) 46.19 kB - -
@sentry/browser (incl. Tracing, Replay) 80.17 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.91 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 84.85 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 97.1 kB - -
@sentry/browser (incl. Feedback) 41.54 kB - -
@sentry/browser (incl. sendFeedback) 29.51 kB - -
@sentry/browser (incl. FeedbackAsync) 34.5 kB - -
@sentry/browser (incl. Metrics) 25.92 kB +0.28% +71 B 🔺
@sentry/browser (incl. Logs) 26.08 kB +0.04% +9 B 🔺
@sentry/browser (incl. Metrics & Logs) 26.62 kB -0.44% -115 B 🔽
@sentry/react 26.54 kB - -
@sentry/react (incl. Tracing) 43.79 kB - -
@sentry/vue 29.29 kB - -
@sentry/vue (incl. Tracing) 43.41 kB - -
@sentry/svelte 24.84 kB - -
CDN Bundle 27.34 kB +0.32% +85 B 🔺
CDN Bundle (incl. Tracing) 42.36 kB +0.28% +116 B 🔺
CDN Bundle (incl. Tracing, Replay) 79.06 kB +0.14% +107 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 84.51 kB +0.13% +107 B 🔺
CDN Bundle - uncompressed 80.31 kB +0.32% +254 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 125.75 kB +0.21% +254 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 242.28 kB +0.11% +254 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 255.04 kB +0.1% +254 B 🔺
@sentry/nextjs (client) 46.02 kB - -
@sentry/sveltekit (client) 41.97 kB - -
@sentry/node-core 51.61 kB - -
@sentry/node 161.56 kB +0.04% +50 B 🔺
@sentry/node - without tracing 93.05 kB - -
@sentry/aws-serverless 108.56 kB -0.01% -1 B 🔽

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Dec 19, 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 9,404 - 10,990 -14%
GET With Sentry 1,778 19% 1,876 -5%
GET With Sentry (error only) 6,089 65% 7,515 -19%
POST Baseline 1,222 - 1,112 +10%
POST With Sentry 597 49% 515 +16%
POST With Sentry (error only) 1,071 88% 924 +16%
MYSQL Baseline 3,357 - 3,701 -9%
MYSQL With Sentry 523 16% 405 +29%
MYSQL With Sentry (error only) 2,730 81% 3,010 -9%

View base workflow run

@Lms24 Lms24 requested review from AbhiPrasad and chargome December 19, 2025 16:49
@Lms24 Lms24 marked this pull request as ready for review December 19, 2025 16:49
@Lms24 Lms24 self-assigned this Dec 19, 2025
@Lms24 Lms24 force-pushed the lms/ref-core-metrics-logs-unify branch from 9d87fba to 0a298b5 Compare December 19, 2025 17:04
@Lms24
Copy link
Member Author

Lms24 commented Dec 19, 2025

huh looks like I broke undefined/null behaviour in comparison to the previous implementation. Will double check when I'm back

@Lms24 Lms24 marked this pull request as draft December 19, 2025 18: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.

2 participants