-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
enabled
flag
#2313
Comments
It's a workaround but you can do this for now await SentryFlutter.init((options) {
options.beforeSend = (event, hint) async {
if (kDebugMode) {
return null;
}
return event;
};
}); Let's see if we can do this more cleanly and easier |
which enable option do you refer to in other SDKs? |
Gotcha, I will discuss this internally |
What exactly are you trying to accomplish / expecting, just not send the event in debug builds? |
Exactly! When developing, I will inevitably develop some runtime errors, and I don't want Sentry to be populated with these events, as they can become noise when debugging actual production issues. For instance, we are notified in Slack for each new issue. |
In that case I'd use the snippet that I posted above with beforeSend which will achieve exactly what you're trying to do. We don't have the enabled option in other mobile sdks as well and I want to keep the feature set similar. So I don't think we should add this option now. |
Only setting the DSN in production should do the trick? |
either setting dsn in prod or using beforeSend, both work - whatever you prefer if you want to minimize the overhead in general you could conditionally use |
Problem Statement
I want to enable Sentry only in production builds
In other Sentry SDKs there is an
enabled
optionSolution Brainstorm
No response
Are you willing to submit a PR?
None
The text was updated successfully, but these errors were encountered: