Sentry-javascript: ignoreErrors, ignoreUrls, includePaths, etc equivalent in @sentry/browser?

Created on 8 Oct 2018  路  8Comments  路  Source: getsentry/sentry-javascript

Package + Version

  • [x] @sentry/browser
  • [ ] @sentry/node
  • [ ] raven-js
  • [ ] raven-node _(raven for node)_
  • [ ] other:

Version:

4.0.6

Description

When upgrading to @sentry/browser from raven-js, I can't find the equivalent of setting these options. Is there one? What is the suggested way to do this now?

Question

Most helpful comment

They are exactly the same, we just didn't document them just yet :) (whitelistUrls, blacklistUrls, ignoreErrors)

see: https://github.com/getsentry/sentry-javascript/blob/50918f98b09662f5000bdcfb6341187b3e97f66f/packages/core/src/interfaces.ts#L30-L131 for common options + https://github.com/getsentry/sentry-javascript/blob/50918f98b09662f5000bdcfb6341187b3e97f66f/packages/browser/src/backend.ts#L13-L27 for browser-specific ones

All 8 comments

They are exactly the same, we just didn't document them just yet :) (whitelistUrls, blacklistUrls, ignoreErrors)

see: https://github.com/getsentry/sentry-javascript/blob/50918f98b09662f5000bdcfb6341187b3e97f66f/packages/core/src/interfaces.ts#L30-L131 for common options + https://github.com/getsentry/sentry-javascript/blob/50918f98b09662f5000bdcfb6341187b3e97f66f/packages/browser/src/backend.ts#L13-L27 for browser-specific ones

Thanks @kamilogorek, but ignoreErrors (out of the 3 i mentioned at least) is the only one that seems to be there. Are the others not supported anymore?

@reintroducing ignoreUrls === blacklistUrls and as for includePaths it's not available anymore, as we have eventProcessors for cases like this. See: https://docs.sentry.io/learn/filtering/?platform=javascript and https://docs.sentry.io/platforms/javascript/#eventprocessors

@kamilogorek Thanks for the quick responses. Roger that on ignoreUrls, my apologies for not looking at the names better, I thought they'd map 1:1.

As for includePaths, this was our config:

includePaths: [
    /https?:\/\/d2yt77z1f5bzb8\.cloudfront\.net/i
]

How would that translate to the eventProcessors?

Right now it'd be kinda "more complex than I'd like it to be", but we already merged a "rewriteFrames" integration, which will make it very easy. It'll be released before Friday this week :)

```js
Sentry.init({
integrations: [new Sentry.Integrations.RewriteFrames({
iteratee: function (frame) {
// check for paths here and override frames, eg. (1:1 copied from raven-js)
// https://github.com/getsentry/sentry-javascript/blob/50918f98b09662f5000bdcfb6341187b3e97f66f/packages/raven-js/src/raven.js#L1708-L1717
return frame;
}
})]
})

rewriteFrames has been already released, so let me close this :)

Hey @kamilogorek, where can i find docs on RewriteFrames? Or, in particular (addition to?), how would i use RewriteFrames to achieve what I was doing with includePaths before? Dziekuje :)

@reintroducing we don't have docs for pluggable integrations just yet, but code should be straightforward enough to read through :) https://github.com/getsentry/sentry-javascript/blob/master/packages/core/src/integrations/pluggable/rewriteframes.ts

And here's your example:

Sentry.init({
  integrations: [new Sentry.Integrations.RewriteFrames({
    iteratee: function (frame) {
      if (frame.filename) {
        frame.in_app = /https?:\/\/d2yt77z1f5bzb8\.cloudfront\.net/i.test(frame.filename)
      }
      return frame;
    }
  })]
})

Prosz臋 bardzo :)

Was this page helpful?
0 / 5 - 0 ratings