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

Add severity allowlist to sentry integration installation #8182

Merged
merged 5 commits into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions contents/docs/libraries/sentry.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ This way, debugging issues becomes a lot easier, and you can also correlate erro

Make sure you're using both PostHog and Sentry as JS modules. You'll need to replace `'your organization'` and `project-id` with the organization and project-id from Sentry.

- `'your organization'` will be in the URL when you go to your Sentry instance, like so: `https://sentry.io/organizations/your-organization/projects/`
- `project-id` will be the last few digits in your Sentry DSN, such as `https://[email protected]/project-id`
- `'your organization'`: will be in the URL when you go to your Sentry instance, like so: `https://sentry.io/organizations/your-organization/projects/`
- `project-id`: will be the last few digits in your Sentry DSN, such as `https://[email protected]/project-id`
- `prefix`: Optional: Url of a self-hosted sentry instance (default: https://sentry.io/organizations/)
- `severityAllowList`: Optional: by default this is `['error']`, you can provide more Sentry severity levels (e.g. `['error', 'info']`) or '*' to capture any severity. Only available from posthog-js version 1.118.0 forward

```js-web
import posthog from 'posthog-js'
Expand All @@ -29,7 +31,13 @@ posthog.init('<ph_project_api_key>')

Sentry.init({
dsn: '<your Sentry DSN>',
integrations: [new posthog.SentryIntegration(posthog, 'your organization', project-id)],
integrations: [new posthog.SentryIntegration(
posthog,
'your organization',
project-id,
undefined, // optional: but necessary if you want to set a severity allowlist
['error', 'info'] // optional: here is set to handle captureMessage (info) and captureException (error)
)],
})
```

Expand Down
Loading