diff options
author | Adam Charnock <acharnock@gmail.com> | 2017-05-24 12:25:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-24 12:25:26 +0100 |
commit | 08dd19dc45887a8691a5d895d38ac2fae5bc0e73 (patch) | |
tree | 7ff666eff79218e7f4e5cffff9a0314d69990c03 | |
parent | bb341218ccafe83d734144bcd8287e7ca1f907eb (diff) | |
download | raven-08dd19dc45887a8691a5d895d38ac2fae5bc0e73.tar.gz |
Ensure consistent fingerprint for SoftTimeLimitExceeded exceptions
I've been finding that ``SoftTimeLimitExceeded`` exceptions have not been grouped in the Sentry UI as I would have expected. I believe I have traced it down to the line changed in this pull request. They seemed to occasionally stop form new groups for non-obvious reasons.
After looking around, it seems that ``sender`` (presumably a task instance) includes an object ID in its string representation. As a result, the fingerprint would be different for every celery worker process.
This change will attempt to use the full task name (i.e. ``"my.app.tasks.do_it"``) before falling back to the original implementation.
-rw-r--r-- | raven/contrib/celery/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/raven/contrib/celery/__init__.py b/raven/contrib/celery/__init__.py index edf2c42..554a5c6 100644 --- a/raven/contrib/celery/__init__.py +++ b/raven/contrib/celery/__init__.py @@ -73,7 +73,7 @@ class SentryCeleryHandler(object): # This signal is fired inside the stack so let raven do its magic if isinstance(einfo.exception, SoftTimeLimitExceeded): - fingerprint = ['celery', 'SoftTimeLimitExceeded', sender] + fingerprint = ['celery', 'SoftTimeLimitExceeded', getattr(sender, 'name', sender)] else: fingerprint = None |