-
-
Notifications
You must be signed in to change notification settings - Fork 657
Not all errors are being captured #1297
Comments
We're seeing a similar issue: we're also unable to capture some exceptions in Any information about this issue is much appreciated! |
Does the app shut down afterwards? |
@mitsuhiko my team is running ETL scripts in the background with cron-scheduled jobs. They tend to finish after a definite time, but they're not applications per-se. |
@mitsuhiko My team is also running ETL scripts, among other things, in the background with cron-scheduled Celery jobs. So far we've only observed the issue in these contexts. |
Can you share the configuration? |
@mitsuhiko Our configuration looks something like this:
And triggering the exception is something straightforward like:
We've tried various combinations of including/omitting |
I think that is a different issue. That sounds like the logging system does not properly function for you. @untitaker slightly related to this issue but i think an explicit handler on a single logger is a usecase that the new SDK does not handle properly now. We probably need to find a way to elevate specific loggers to send on different levels. |
If we replace the call to Interestingly, this case results in missed messages as well:
|
@mitsuhiko we apply this decorator to every ETL function that we invoke: def alert(func):
"""Decorator to alert admins if function raises an exception."""
@wraps(func)
def wrapper(*args, **kwargs):
try:
func(*args, **kwargs)
except Exception:
# Sentry capture exception
client = sentry_con()
client.captureException()
# Email
err_path = path.basename(traceback.extract_stack()[2].filename)
err_data = traceback.format_exc()
# Assumes that a settings.json file exists in the same directory as the module.
with open(path.join(path.dirname(__file__), 'settings.json'), 'r') as settings:
admins = load(settings)['admins']
mail = mail_con()
mail.send_message(
subject="Error while running {}".format(err_path),
to=admins,
body=err_data
)
return wrapper |
I have similar issue as @huangsam. |
We get some of our
TimeoutError
andConnectionError
instances from ourclient.captureException
call in anexcept
block but not always. I've been runningping
againstgoogle.com
andsentry.io
from the server and there seems to be no dropping of packets. This concerns the simple Python integration, and not the Flask/Django integration.The text was updated successfully, but these errors were encountered: