Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Sentry users for general error macros #9

Merged
merged 2 commits into from
Feb 4, 2020

Conversation

maxno-kivra
Copy link
Member

The ?failed and ?exception macros get picked up by parse_message already
and allow attaching arbitray extra data to be sent to Sentry.

This makes it so that attaching user as extra data is sent as a proper
raven user, allowing Sentry to do smart things like count the number of
affected users and searching for all issues related to this user.

Copy link

@chsukivra chsukivra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be useful, link me to a sandbox sentry entry when it is done.

@maxno-kivra maxno-kivra force-pushed the mn-raven-user-from-extras branch 8 times, most recently from 1b2a914 to c14fb47 Compare February 3, 2020 15:44
The ?failed and ?exception macros get picked up by parse_message already
and allow attaching arbitray extra data to be sent to Sentry.

This makes it so that attaching `user` as extra data is sent as a proper
raven user, allowing Sentry to do smart things like count the number of
affected users and searching for all issues related to this user.

Sentry expects certain keys to work, from the docs:

id:
    The unique ID of the user.
email:
    The email address of the user.
ip_address:
    The IP of the user.
username:
    The username of the user.

All other keys are stored as extra information but not specifically
processed by Sentry.

To make this easier, if you don't provide a proplist/eon object, it will
default to using the `user` key as `id`.
@maxno-kivra maxno-kivra force-pushed the mn-raven-user-from-extras branch from c14fb47 to a8a1ab2 Compare February 3, 2020 16:20
Copy link

@chsukivra chsukivra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks interesting.

@maxno-kivra
Copy link
Member Author

I've tested this by hand in sandbox on beehive, and it looks pretty sweet if I say so myself.

https://sandbox-sentry.kivra.com/kivra/beehive/issues/286792/events/dcae5d4bede6497d8c7585cbdde51374/

@maxno-kivra maxno-kivra merged commit 0e39934 into kivra Feb 4, 2020
@maxno-kivra maxno-kivra deleted the mn-raven-user-from-extras branch February 4, 2020 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants