-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Late Init of sentry #3726
Comments
Hi @daniel-johns-99, you understand it correctly, when the SDK initialization is delayed all events (errors) that happened before the init will be lost. Generally, when changing the options we recommend closing and re-initializing the SDK. As the options are used during the initialization process and later changes might not have the desired effect, a module where the value is used might not be included. Typically Let us know if this helps. |
Are there any impacts on doing this? |
Closing the SDK flushes events which are currently being processed, how this takes depends on the current state of the app, the amount of events and the connection speed. |
Closing this due to inactivity. If this is still an issue feel free to comment here or open a new issue if the context changed. |
@krystofwoldrich is I see that javascript supports |
Yes, errors between the The Yes, the Shutdown and Draining page for React Native is missing the |
@krystofwoldrich would it be a valid feature request to have an api similar to JS SDK or is this not possible in React Native because of architectural limitations?
|
@realkosty We already have it, without the timeout option. import * as Sentry from `@sentry/react-native`;
Sentry.close(/* RN doesn't have the timeout property */).then(function () {}); |
Oh nice! So it is possible then to implement close/re-init in such way that no events are lost. |
@krystofwoldrich
any idea why that could be happening? their Sentry configuration: #3816 (comment) |
I'm not sure, I will try to reproduce it and update my post here. |
@realkosty As a question. If I reinit sentry as proposed. Does it track as a new session in the release health? In addition what happens to any other transactions which are already open. Are they lost? |
Hi @daniel-johns-99, A new session will be created. Note that |
Closing this due to inactivity. If this is still an issue feel free to comment here or open a new issue if the context changed. |
I read in the documentation that it's better to retrieve the Sentry DSN dynamically rather than embedding it in the app. But if I wait to fetch this configuration dynamically, I might miss events that occur during the wait, especially during app startup. Am I understanding this correctly? If I initialize Sentry 500ms after app start, will I lose events from the first 500ms?
Alternatively, is there a way to change configuration values after initialization? Specifically, I want to dynamically retrieve values for tracesSampleRate, sampleRate, and ignoreErrors, but I don't want to miss any events while waiting for these values before calling sentry.init. I know I can achieve this with an event processor, but I'd prefer using these built-in options before resorting to a custom solution.
Overall, I'm trying to understand the impact of delaying Sentry initialization versus initializing it immediately on app start and then adjusting configuration values once they're received (If that is even possible)
The text was updated successfully, but these errors were encountered: