Skip to content

feat(core): Expose top-level Sentry.setAttribute / setAttributes#6354

Open
antonis wants to merge 1 commit into
mainfrom
feat/expose-set-attribute
Open

feat(core): Expose top-level Sentry.setAttribute / setAttributes#6354
antonis wants to merge 1 commit into
mainfrom
feat/expose-set-attribute

Conversation

@antonis

@antonis antonis commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

@sentry/core 10.61.0 added top-level setAttribute(key, value) and setAttributes(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 setAttribute and setAttributes to the export { … } from '@sentry/core' block in packages/core/src/js/index.ts and regenerates the API report.

💡 Motivation and Context

Closes #6350

💚 How did you test it?

CI

📝 Checklist

🔮 Next steps

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>
@antonis antonis force-pushed the feat/expose-set-attribute branch from 0b16d46 to 0a2a869 Compare June 25, 2026 14:48
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(core): Expose top-level Sentry.setAttribute / setAttributes by antonis in #6354
  • feat(core): Use native btoa for envelope base64 encoding by alwx in #6351

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 0a2a869

@antonis

antonis commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@sentry review

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Jun 25, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

@sentry

sentry Bot commented Jun 25, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.16.0 (94) Release

⚙️ sentry-react-native Build Distribution Settings

@antonis antonis marked this pull request as ready for review June 25, 2026 15:05
@antonis antonis removed the ready-to-merge Triggers the full CI test suite label Jun 25, 2026
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3846.29 ms 1216.06 ms -2630.23 ms
Size 4.98 MiB 6.50 MiB 1.52 MiB

Baseline results on branch: main

Startup times

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

@github-actions

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 423.53 ms 477.58 ms 54.05 ms
Size 49.74 MiB 54.85 MiB 5.11 MiB

Baseline results on branch: main

Startup times

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

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3854.11 ms 1219.16 ms -2634.94 ms
Size 4.98 MiB 6.50 MiB 1.52 MiB

Baseline results on branch: main

Startup times

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

@github-actions

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 503.53 ms 555.94 ms 52.41 ms
Size 49.74 MiB 54.85 MiB 5.11 MiB

Baseline results on branch: main

Startup times

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

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.

Expose top-level Sentry.setAttribute / Sentry.setAttributes for API parity with core

1 participant