-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add severity allowlist to sentry integration installation (#8182)
* 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
1 parent
21f220f
commit f577f8f
Showing
1 changed file
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
|
@@ -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) | ||
)], | ||
}) | ||
``` | ||
|
||
|