I have many long-running processes that are using Sentry.io to report their errors. Starting and stopping these processes is expensive so we're trying to selectively disable Sentry without stopping the application.
It doesn't seem like there's a way to say sentry_sdk.disable() (or similar)
The best I can see is setting the sample_rate=0.0 to effectively "disable" the integration by just not sending messages; we lose the RAM though.
Is there a better way, am I missing something?
You can try using Sentry's BeforeEvent and return null:
Sentry.init({
beforeSend(event) {
if (shouldSendEvent) return event;
return null;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With