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

[WIP: do not merge] added use-cases for Hints using beforeBreadcrumb and beforeSend #1061

Closed
wants to merge 2 commits into from

Conversation

MimiDumpling
Copy link
Contributor

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.

@@ -956,6 +956,26 @@ They are available in two places: `beforeSend`/`beforeBreadcrumb` and `eventProc

#### Hints for Events

##### Use-Case: `before-send`
Copy link
Member

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) {
Copy link
Member

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)

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor

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.
Copy link
Member

@lobsterkatie lobsterkatie Jun 12, 2019

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/',
Copy link
Member

@lobsterkatie lobsterkatie Jun 12, 2019

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>

@MimiDumpling MimiDumpling changed the title added use-cases for Hints using beforeBreadcrumb and beforeSend [do not merge] added use-cases for Hints using beforeBreadcrumb and beforeSend Oct 31, 2019
@MimiDumpling MimiDumpling changed the title [do not merge] added use-cases for Hints using beforeBreadcrumb and beforeSend [WIP: do not merge] added use-cases for Hints using beforeBreadcrumb and beforeSend Oct 31, 2019
@joshuarli joshuarli deleted the update/mimi-js-hints branch August 4, 2020 01:34
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants