Skip to content

feat: added Get/Set Environment on Scope - #5772

Open
bitsandfoxes wants to merge 8 commits into
mainfrom
feat/scope-set-environment
Open

feat: added Get/Set Environment on Scope#5772
bitsandfoxes wants to merge 8 commits into
mainfrom
feat/scope-set-environment

Conversation

@bitsandfoxes

@bitsandfoxes bitsandfoxes commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Adds a getter and setter to the scope that allows users to configure the Environment at runtime.

💡 Motivation and Context

See #5769

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 0ae192d

@sentry

sentry Bot commented Jul 16, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.50.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 312.19 ms 327.22 ms 15.03 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3699cd5 423.60 ms 495.52 ms 71.92 ms
d15471f 294.13 ms 399.49 ms 105.36 ms
f064536 329.00 ms 395.62 ms 66.62 ms
3998a95 415.94 ms 478.54 ms 62.60 ms
46b442b 321.41 ms 339.30 ms 17.89 ms
b6cfb57 372.92 ms 507.77 ms 134.85 ms
d217708 375.27 ms 415.68 ms 40.41 ms
18c0bc2 306.73 ms 349.77 ms 43.03 ms
4c04bb8 333.16 ms 408.16 ms 75.00 ms
d8b6ce1 340.00 ms 388.36 ms 48.36 ms

App size

Revision Plain With Sentry Diff
3699cd5 1.58 MiB 2.10 MiB 533.45 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
f064536 1.58 MiB 2.20 MiB 633.90 KiB
3998a95 1.58 MiB 2.10 MiB 532.96 KiB
46b442b 0 B 0 B 0 B
b6cfb57 1.58 MiB 2.28 MiB 718.80 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
18c0bc2 1.58 MiB 2.13 MiB 557.33 KiB
4c04bb8 0 B 0 B 0 B
d8b6ce1 0 B 0 B 0 B

Previous results on branch: feat/scope-set-environment

Startup times

Revision Plain With Sentry Diff
9f4de8c 324.54 ms 361.39 ms 36.85 ms
284a8f9 319.11 ms 381.14 ms 62.03 ms

App size

Revision Plain With Sentry Diff
9f4de8c 0 B 0 B 0 B
284a8f9 0 B 0 B 0 B

…nment

# Conflicts:
#	sentry-android-core/src/main/java/io/sentry/android/core/ApplicationExitInfoEventProcessor.java
#	sentry-android-core/src/test/java/io/sentry/android/core/ApplicationExitInfoEventProcessorTest.kt
@bitsandfoxes
bitsandfoxes marked this pull request as ready for review July 17, 2026 13:17
Comment thread sentry/src/main/java/io/sentry/Scope.java
Comment thread sentry/src/main/java/io/sentry/Scope.java

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 879e15a. Configure here.

Comment thread sentry/src/main/java/io/sentry/SentryClient.java
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.

1 participant