-
-
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
How to disable Sentry again at runtime? #2039
Comments
That gets me the current value, but how do I change it? |
|
And just to be sure, that will make Sentry stop sending anything to Sentry servers? |
Correct - sentry-javascript/packages/core/src/baseclient.ts Lines 327 to 329 in 41f01bc
|
Could you consider this a feature request for something more explicit, or at least a request for official documentation? |
@felixfbecker Sure, can you just elaborate why you need this? |
As described in the issue description, we need to allow users to opt in and out of error reporting for privacy reasons. Anything that is unclear? Happy to provide more info but not sure what you are looking for |
@felixfbecker Sorry, still not fully awake 😅 should have read the initial issue. Just for the record, there are other ways of handling this (e.g. |
Why is this issue closed if this feature request is in the works ? |
Any updates on providing the In Raven I think you had |
Sentry.init({
beforeSend(event) {
if (shouldSendEvent) return event;
return null;
}
});
What's your use-case specifically? It's already possible to conditionally drop and/or enable/disable sdk. |
Thanks, I couldn't find on the docs if actually sending null would prevent the sdk from reporting errors. this solves my use case |
@diegolanda https://docs.sentry.io/error-reporting/configuration/?platform=go#before-send but I agree |
what about set |
It will effectively do the same thing as beforeSend with null, which is dropping all captured events. |
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Description
We allow to enable or disable error reporting in our browser extension (which is needed for GDPR). A browser extensions background script is long-running (doesn't re-run at page reloads), so when error reporting is disabled, we need to disable Sentry after it was already enabled with
Sentry.init()
. I see there isSentry.init({ enabled: false })
but it doesn't look legal to callSentry.init()
twice. How can I disable Sentry after it was enabled before, at runtime?The text was updated successfully, but these errors were encountered: