feat(core): Expose top-level Sentry.setAttribute / setAttributes#6354
Open
antonis wants to merge 1 commit into
Open
feat(core): Expose top-level Sentry.setAttribute / setAttributes#6354antonis wants to merge 1 commit into
antonis wants to merge 1 commit into
Conversation
Re-export `setAttribute` and `setAttributes` from `@sentry/core` (added in 10.61.0) so RN users can call them directly instead of via `getCurrentScope().setAttribute(...)`. The top-level core functions delegate to the isolation scope, which the RN SDK already patches via `enableSyncToNative`, so primitive attributes sync to native for free. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0b16d46 to
0a2a869
Compare
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
|
Contributor
Author
|
@sentry review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0a2a869. Configure here.
Open
6 tasks
📲 Install BuildsAndroid
|
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7a89652+dirty | 3861.46 ms | 1229.61 ms | -2631.85 ms |
| 7d8c8bd+dirty | 3837.24 ms | 1215.51 ms | -2621.73 ms |
| bc0d8cf+dirty | 3830.33 ms | 1220.52 ms | -2609.81 ms |
| 0b1b5e3+dirty | 3823.96 ms | 1220.12 ms | -2603.84 ms |
| c823bb5+dirty | 3843.44 ms | 1225.70 ms | -2617.74 ms |
| 21a1e70+dirty | 3834.15 ms | 1218.43 ms | -2615.73 ms |
| 3a829f0+dirty | 3839.76 ms | 1214.69 ms | -2625.06 ms |
| b0d3373+dirty | 3831.75 ms | 1227.29 ms | -2604.46 ms |
| 7d6fd3a+dirty | 1223.29 ms | 1229.57 ms | 6.28 ms |
| 038a6d7+dirty | 3849.69 ms | 1228.40 ms | -2621.28 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7a89652+dirty | 5.15 MiB | 6.70 MiB | 1.55 MiB |
| 7d8c8bd+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| bc0d8cf+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 0b1b5e3+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| c823bb5+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| 21a1e70+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| 3a829f0+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| b0d3373+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 7d6fd3a+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 038a6d7+dirty | 5.15 MiB | 6.70 MiB | 1.55 MiB |
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 23598c3+dirty | 414.12 ms | 426.24 ms | 12.12 ms |
| 5fe1c6c+dirty | 401.62 ms | 445.28 ms | 43.66 ms |
| 0b1b5e3+dirty | 416.42 ms | 470.58 ms | 54.16 ms |
| c151573+dirty | 530.34 ms | 559.43 ms | 29.09 ms |
| f3215d3+dirty | 411.11 ms | 454.38 ms | 43.27 ms |
| 7887847+dirty | 416.61 ms | 462.04 ms | 45.43 ms |
| 5a010b7+dirty | 425.62 ms | 469.38 ms | 43.76 ms |
| 7ac3378+dirty | 404.78 ms | 439.84 ms | 35.06 ms |
| a3265b6+dirty | 406.86 ms | 449.84 ms | 42.98 ms |
| a0d8cf8+dirty | 411.71 ms | 467.57 ms | 55.87 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 23598c3+dirty | 43.75 MiB | 48.16 MiB | 4.41 MiB |
| 5fe1c6c+dirty | 43.75 MiB | 48.14 MiB | 4.39 MiB |
| 0b1b5e3+dirty | 48.30 MiB | 53.60 MiB | 5.29 MiB |
| c151573+dirty | 48.30 MiB | 53.54 MiB | 5.24 MiB |
| f3215d3+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 7887847+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| 5a010b7+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 7ac3378+dirty | 43.75 MiB | 48.13 MiB | 4.37 MiB |
| a3265b6+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| a0d8cf8+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7d8c8bd+dirty | 3847.98 ms | 1230.77 ms | -2617.21 ms |
| 64630e5+dirty | 3845.49 ms | 1215.19 ms | -2630.30 ms |
| ad66da3+dirty | 3855.02 ms | 1213.43 ms | -2641.59 ms |
| 5569641+dirty | 3824.35 ms | 1210.78 ms | -2613.57 ms |
| f170ec3+dirty | 3844.74 ms | 1222.67 ms | -2622.07 ms |
| 4b87b12+dirty | 1199.49 ms | 1199.78 ms | 0.29 ms |
| ae37560+dirty | 3840.10 ms | 1217.89 ms | -2622.21 ms |
| 68672fc+dirty | 3832.22 ms | 1228.29 ms | -2603.93 ms |
| 267d3ed+dirty | 3860.14 ms | 1223.39 ms | -2636.76 ms |
| 7d6fd3a+dirty | 1210.89 ms | 1217.63 ms | 6.74 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7d8c8bd+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 64630e5+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| ad66da3+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 5569641+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| f170ec3+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| 4b87b12+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| ae37560+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 68672fc+dirty | 5.15 MiB | 6.71 MiB | 1.55 MiB |
| 267d3ed+dirty | 5.15 MiB | 6.69 MiB | 1.54 MiB |
| 7d6fd3a+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 20fbd51+dirty | 594.38 ms | 655.35 ms | 60.97 ms |
| 7436d0f+dirty | 429.58 ms | 452.52 ms | 22.94 ms |
| ad66da3+dirty | 411.49 ms | 449.38 ms | 37.89 ms |
| 7ff4d0f+dirty | 403.38 ms | 427.06 ms | 23.68 ms |
| a3265b6+dirty | 410.96 ms | 444.76 ms | 33.80 ms |
| a50b33d+dirty | 353.21 ms | 398.48 ms | 45.27 ms |
| 6176a94+dirty | 403.58 ms | 446.73 ms | 43.15 ms |
| 5569641+dirty | 465.92 ms | 532.22 ms | 66.30 ms |
| 5a010b7+dirty | 475.15 ms | 519.02 ms | 43.88 ms |
| 1e5d96d+dirty | 423.33 ms | 482.46 ms | 59.13 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 20fbd51+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| 7436d0f+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| ad66da3+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 7ff4d0f+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| a3265b6+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| a50b33d+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 6176a94+dirty | 48.30 MiB | 53.54 MiB | 5.24 MiB |
| 5569641+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 5a010b7+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 1e5d96d+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
@sentry/core10.61.0 added top-levelsetAttribute(key, value)andsetAttributes(attrs)APIs (getsentry/sentry-javascript#21705). The RN SDK re-exports core through an explicit allowlist, so these weren't exposed to RN users.This PR adds
setAttributeandsetAttributesto theexport { … } from '@sentry/core'block inpackages/core/src/js/index.tsand regenerates the API report.💡 Motivation and Context
Closes #6350
💚 How did you test it?
CI
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps