Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 12, 2025

WIP, Based on #18165

  • Unify attribute -> typed attribute conversion
  • Logs can now have array attributes
  • Apply scope attributes to logs

TBD:

  • permitting units requires extending the Log.attributes type to a similar object that users can pass into scope.setAttribute(s) to define units. I'd rather do this in a follow-up PR.

closes #18159

@Lms24 Lms24 changed the base branch from develop to lms/feat-core-scope-setAttributes November 12, 2025 11:46
@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.82 kB +0.07% +16 B 🔺
@sentry/browser - with treeshaking flags 23.32 kB +0.08% +17 B 🔺
@sentry/browser (incl. Tracing) 41.56 kB +0.05% +18 B 🔺
@sentry/browser (incl. Tracing, Profiling) 46.16 kB +0.05% +20 B 🔺
@sentry/browser (incl. Tracing, Replay) 79.99 kB +0.03% +20 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.72 kB +0.03% +16 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 84.66 kB +0.03% +21 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 96.91 kB +0.03% +20 B 🔺
@sentry/browser (incl. Feedback) 41.54 kB +0.06% +21 B 🔺
@sentry/browser (incl. sendFeedback) 29.51 kB +0.07% +19 B 🔺
@sentry/browser (incl. FeedbackAsync) 34.5 kB +0.06% +20 B 🔺
@sentry/react 26.54 kB +0.08% +19 B 🔺
@sentry/react (incl. Tracing) 43.77 kB +0.04% +17 B 🔺
@sentry/vue 29.29 kB +0.07% +18 B 🔺
@sentry/vue (incl. Tracing) 43.38 kB +0.06% +22 B 🔺
@sentry/svelte 24.84 kB +0.07% +16 B 🔺
CDN Bundle 27.26 kB +0.09% +24 B 🔺
CDN Bundle (incl. Tracing) 42.25 kB +0.05% +20 B 🔺
CDN Bundle (incl. Tracing, Replay) 78.77 kB +0.03% +18 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 84.23 kB +0.03% +22 B 🔺
CDN Bundle - uncompressed 80.07 kB +0.05% +34 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 125.42 kB +0.03% +34 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 241.46 kB +0.02% +34 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 254.22 kB +0.02% +34 B 🔺
@sentry/nextjs (client) 45.99 kB +0.04% +17 B 🔺
@sentry/sveltekit (client) 41.94 kB +0.05% +18 B 🔺
@sentry/node-core 51.51 kB +0.03% +13 B 🔺
@sentry/node 159.96 kB +0.02% +22 B 🔺
@sentry/node - without tracing 92.93 kB +0.03% +19 B 🔺
@sentry/aws-serverless 108.45 kB +0.02% +15 B 🔺

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 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,650 - 9,071 -5%
GET With Sentry 1,567 18% 1,773 -12%
GET With Sentry (error only) 5,879 68% 6,207 -5%
POST Baseline 1,180 - 1,209 -2%
POST With Sentry 565 48% 619 -9%
POST With Sentry (error only) 1,059 90% 1,071 -1%
MYSQL Baseline 3,306 - 3,378 -2%
MYSQL With Sentry 423 13% 551 -23%
MYSQL With Sentry (error only) 2,676 81% 2,733 -2%

View base workflow run

@Lms24 Lms24 force-pushed the lms/feat-core-logs-apply-scope-attributes branch 2 times, most recently from 52339f2 to b97b3f4 Compare November 18, 2025 12:15
@Lms24 Lms24 force-pushed the lms/feat-core-scope-setAttributes branch 2 times, most recently from a3e204d to 205752c Compare November 18, 2025 16:51
@Lms24 Lms24 force-pushed the lms/feat-core-logs-apply-scope-attributes branch from 5053159 to e5785ea Compare November 18, 2025 16:52
@Lms24 Lms24 force-pushed the lms/feat-core-scope-setAttributes branch 2 times, most recently from fbbd768 to 04d75b1 Compare November 21, 2025 14:23
Base automatically changed from lms/feat-core-scope-setAttributes to develop November 21, 2025 14:42
@Lms24 Lms24 force-pushed the lms/feat-core-logs-apply-scope-attributes branch from e5785ea to 561085c Compare November 21, 2025 14:47
@Lms24 Lms24 force-pushed the lms/feat-core-logs-apply-scope-attributes branch from e575427 to 5388d82 Compare December 12, 2025 11:52
@Lms24 Lms24 self-assigned this Dec 12, 2025
@Lms24
Copy link
Member Author

Lms24 commented Dec 12, 2025

OK, so we still have 2 problems and a minor inconvenience here:

  1. Relay still drops array attributes. Our scope attribute API supports adding arrays but these attributes would simply not make it to Sentry. This is not really a problem for scope attributes (since we don't document them yet) but if we switch log attributes to the same serialization logic as for scope attributes, array attributes on logs would no longer be stringified but also dropped.
  2. Suppose Relay supports array attributes, we'd still have a somewhat breaking change in that log array attributes would no longer be stringified but sent as arrays. I don't think this is the end of the world but we should keep this in mind and tell the logs folks about it
  3. (minor inconvenience) units are also dropped by Relay. Again only a proble for scope attributes for now but we could easily add support for log attributes as well. The values of the attributes with units are still forwarded correctly.

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.

Apply Scope attributes to logs

2 participants