-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(android): Add docs for using the Android SDK within a shared environment #11089
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 210 bytes ⬆️
|
@@ -0,0 +1,60 @@ | |||
--- | |||
title: Shared Environments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m
: title should be more descriptive, also not sure if troubleshooting is the ideal parent page - maybe usage or data management? wdty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I've moved it to the bottom of our configuration section. Title is now "Using Sentry within an SDK"
|
||
<Note> | ||
|
||
Using the sentry SDK within another SDK is discouraged. This can lead to unexpected behavior and potential data leakage. If you need to use Sentry within another SDK, please follow the best practices outlined below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the sentry SDK within another SDK is discouraged. This can lead to unexpected behavior and potential data leakage. If you need to use Sentry within another SDK, please follow the best practices outlined below. | |
Using the Sentry SDK within another SDK is [discouraged](https://docs.sentry.io/platforms/). This can lead to unexpected behaviour and potential data leakage. If you need to use Sentry within another SDK, please follow the best practices outlined below. |
Hi there, the docs team is focusing on other priorities at the moment, so it may take us another week or more to get to this PR. If you need us to review this sooner, please let us know so we can prioritize accordingly. Thanks for your patience! |
</Note> | ||
|
||
In order to not conflict with other Sentry instances, you should use the `Hub` API to create a new instance of Sentry. | ||
The Hub API works the same way as the global Sentry instance, but it is not global and can be used within your component. If you want to capture uncaught exceptions, you can use the `UncaughtExceptionHandlerIntegration` to capture them. As this will capture all uncaught exceptions within your app, you should use the `BeforeSendCallback` to filter out events that are not relevant for your SDK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's implied by the text, but should we be explicit that there are no default integrations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I wouldn't as we barely have any docs about the other integrationn, most of them are marked as internal, and many of them could leak user data.
When setting up Sentry in a shared environment where multiple Sentry instances may run, you should **not use `Sentry.init()`**, as this will pollute the global state. | ||
|
||
</Note> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any specific use cases like Browser Extensions
in JS, just so readers won't confuse it with using RN and Android for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, but I rephrased it a bit to make it more clear - thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I left some thoughts in comments but nothing crucial.
Fixes #10910
DESCRIBE YOUR PR
Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES