-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[WIP: do not merge] added use-cases for Hints using beforeBreadcrumb and beforeSend #1061
Conversation
@@ -956,6 +956,26 @@ They are available in two places: `beforeSend`/`beforeBreadcrumb` and `eventProc | |||
|
|||
#### Hints for Events | |||
|
|||
##### Use-Case: `before-send` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we just put all of these on a child page? its not core to usage and is more of "go much deeper on your integration" focus - same bucket as most of advanced usage
import * as Sentry from '@sentry/browser'; | ||
|
||
init({ | ||
beforeSend(event, hint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we call this 'hints' elsewhere? if so we should match that in the code sample (I might be wrong though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everywhere I've seen the parameter used, it's been called hint
. I think the heading Hints is plural only because calling it Hint would be weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's called hint
in the Python SDK's internal source code. We can make an effort to rename this in docs and code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's singular in JS and Go as well.
@@ -956,6 +956,26 @@ They are available in two places: `beforeSend`/`beforeBreadcrumb` and `eventProc | |||
|
|||
#### Hints for Events | |||
|
|||
##### Use-Case: `before-send` | |||
|
|||
The `before-send` callback is passed the event and a second argument `hint` which holds one or more hints. Typically this hint holds the original exception so that additional data can be extracted or grouping is affected. `before-send` will be called right before the event is sent to the server, so it’s the last place where you can edit its data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so that additional data can be extracted or grouping is affected
Not sure what you mean by "grouping is affected" here, but IMHO you get enough meaning by just leaving it off.
import * as Sentry from '@sentry/browser'; | ||
|
||
Sentry.init({ | ||
dsn: 'https://<key>@sentry.io/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'https://<key>@sentry.io/'
<- should be 'https://<key>@sentry.io/<project-id>
Hints section was unclear on how/what situation to use the hints. Added two use-cases to help clarify and provide some guidance on usage of hints.