-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from datamade/hcg/upgrade-sentry
Upgrade Sentry SDK
- Loading branch information
Showing
3 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Flask==0.10.1 | ||
Flask==0.11 | ||
requests==2.7.0 | ||
boto==2.38.0 | ||
flask_cors==2.1.2 | ||
raven[flask] | ||
sentry-sdk[flask]==0.16.1 | ||
gunicorn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
def before_send(event, hint): | ||
''' | ||
Group like messages under the same fingerprint. | ||
''' | ||
from app import MISSING_PIN_ERROR, MISSING_DOCUMENT_ERROR, MISSING_IMAGE_ERROR | ||
|
||
event_message = event.get('message') | ||
|
||
if event_message: | ||
if event_message.startswith(MISSING_PIN_ERROR): | ||
event['fingerprint'] = ['no-image-for-pin'] | ||
elif event_message.startswith(MISSING_DOCUMENT_ERROR): | ||
event['fingerprint'] = ['no-document-for-url'] | ||
elif event_message.startswith(MISSING_IMAGE_ERROR): | ||
event['fingerprint'] = ['no-image-for-url'] | ||
|
||
return event |