Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Iterate continuously. Boost efficiency. Improve user experience. The
analytics.js Sentry Destination is open-source. You can browse the code on GitHub.
This document was last updated on October 16, 2018. If you notice any gaps, outdated information or simply want to leave some feedback to help us improve our documentation, please let us know!
The first step is to make sure Sentry supports the source type and connection mode you’ve chosen to implement. You can learn more about what dictates the connection modes we support here.
- From your Segment UI’s Destinations page click on “Add Destination”.
- Search for “Sentry” within the Destinations Catalog and confirm the Source you’d like to connect to.
- Drop in your “Public DSN” into the Sentry destination settings.
- We’ll automatically initialize Sentry with your “Public DSN” upon loading analytics.js.
If you haven’t had a chance to review our spec, please take a look to understand what the Identify method does. An example call would look like:
When you call
identify we call
Raven.setUserContext by passing in the
traits you provided. We will map the
userId you provide as
Segment lets you change these destination settings from your Segment dashboard without having to touch any code.
Set Release by Property
Dynamically track the version of your application in Sentry. If the property you set here is on the global window object (example: you input ‘my_custom_version’, and window.my_custom_version = ‘2.4.5’) then we will use that version. If not, we will default to the manually-set Release property. We recommend that this value is unique to prevent it from being overwritten by other integrations.
The inverse of whitelistUrls and similar to ignoreErrors, but will ignore errors from whole urls matching a regex pattern or an exact string.
An array of regex patterns to indicate which urls are a part of your app in the stack trace. All other frames will appear collapsed inside Sentry to make it easier to discern between frames that happened in your code vs other code. It’d be suggested to add the current page url, and the host for your CDN.
Maximum Message Length
By default, Raven does not truncate messages. If you need to truncate characters for whatever reason, you may set this to limit the length.
You can find your Public DSN by going to Sentry and clicking Projects & Teams > Any Project > Settings > Client Keys (DSN). This should be the PUBLIC DSN since it does not contain a secret.
A list of these messages to be filtered out before being sent to Sentry as either regular expressions or strings.
The name of the logger used by Sentry.
Track the version of your application in Sentry.
Typically this would be the server name, but that doesn’t exist on all platforms. Instead you may use something like the device ID, as it indicates the host which the client is running on.
Questions? Problems? Need more info? Contact us, and we can help!