Skip to content

Commit

Permalink
Add severity allowlist to sentry integration installation (#8182)
Browse files Browse the repository at this point in the history
* Add severity allowlist to sentry integration installation

* Update contents/docs/libraries/sentry.md

* Update contents/docs/libraries/sentry.md

* Update contents/docs/libraries/sentry.md
  • Loading branch information
pauldambra authored Apr 5, 2024
1 parent 21f220f commit f577f8f
Showing 1 changed file with 11 additions and 3 deletions.
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

0 comments on commit f577f8f

Please sign in to comment.