Sentry is noisy on process exit
See original GitHub issueWe are using Sentry to report errors from cron tasks. We have MAILTO
set as a backup so that we receive emails about critical errors which happen before raven has a chance to initialize.
This leads to us getting the occasional email containing:
Sentry is attempting to send 1 pending error messages
Waiting up to 10 seconds
Press Ctrl-C to quit
It happens because there’s a hardcoded initial_timeout
of 0.1 seconds in the process exit hook. Is there any chance you could make this timeout configurable the way shutdown_timeout
is?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:23
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Tips for Reducing JavaScript Error Noise
You can either ignore the error via the Sentry UI, or configure Raven.js to prevent them client-side using the ignoreErrors option. Doing so ......
Read more >Node.js Sentry error caputuring not working
Sentry.captureException(e) is asynchronous, so process.exit(0) is terminating the process before Sentry.captureException is able to run.
Read more >Sentry Tower buttons!! - The Bard's Tale IV
If I go in and out of the tower, come back, you can press the other buttons again but no noise, no timer...
Read more >Sentry Industries FAQ's
HOW DO I USE MY BLUETOOTH SPEAKER? Android. Turn on your Bluetooth Speaker. ( Some devices require you to hold down the Bluetooth...
Read more >Sentry 2.0 Phone Call Blocker
Block all spam calls, including those not on the Black List · Preload White List at set up. Requires Caller Id Service. ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/getsentry/raven-python/blob/a698fc406d2e0f26616f0163b2b22e1a3a5b30f5/raven/transport/threaded.py#L62
Who will be the hero?
If you guys really want to hardcode this timeout and send to stdout, I thought of an alternative that would also solve the problem. Instead of unconditionally sending this through stdout where it will clobber your program output, send it through Python’s
logging
framework with a suitably unique logger name such asraven.shutdown_flush
. Then add a default handler for that logger during module init that sends the output to stdout. This would result in no change in the default behavior, but it would let users of the library override the default and route the message to wherever suits them best. @kornsn can send it to stderr in his apps, and the 10 people who 👍’d the issue can send it toNullHandler
. Everybody wins.Is it ok if this noise will be printed to stderr? I want to do so, but I’m not sure if it’s enough.