Skip to content

Fully anonymous or native stacktraces ignored by allowUrls and denyUrls #3977

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

Closed
lobsterkatie opened this issue Sep 13, 2021 · 5 comments
Closed
Labels
Package: browser Issues related to the Sentry Browser SDK Type: Improvement

Comments

@lobsterkatie
Copy link
Member

lobsterkatie commented Sep 13, 2021

Package + Version

@sentry/browser >= 6.11.0

Description

(Originally a question from a customer)

As of #3842, anonymous and native frames are ignored by allowUrls and denyUrls. This makes sense when, further into the stacktrace, there's a real filename on which to filter. However, there are cases where ignoring such values leaves nothing to filter on (because the stacktrace contains no actual filenames). In those cases, perhaps we should consider reverting to the old behavior, so that such events are again filterable by allowUrls and denyUrls.

[EN: It's not clear how common an issue this is. If you land here because you're having the same problem, please let us know!]

@onurtemizkan onurtemizkan self-assigned this Sep 13, 2021
@onurtemizkan onurtemizkan added Feature: Errors Package: browser Issues related to the Sentry Browser SDK and removed Status: Untriaged labels Sep 13, 2021
@lobsterkatie
Copy link
Member Author

In the meantime, the filtering can be done manually using beforeSend:

function beforeSend(event, hint) {
  frames = event.exception?.values[0].stacktrace?.frames;
  if (frames) {
    lastFilename = frames[frames.length - 1].filename;
    // as of https://github.com/getsentry/sentry-javascript/pull/3842, these
    // values are ignored by `allowUrls` and `denyUrls` if they're in the last
    // frame
    if (lastFilename === "<anonymous>" || lastFilename === "[native code]") {
      // in some cases, however, they're in *all* the frames, and in those cases
      // we *do* actually want to use the value as a filter
      if (
        frames.every(
          (frame) =>
            !frame.filename ||
            frame.filename === "<anonymous>" ||
            frame.filename === "[native code]"
        )
      ) {
        return null;
      }
    }
  }

  return event;
}

@lobsterkatie
Copy link
Member Author

@onurtemizkan - I think we should wait on this until we know there's a strong need for it.

@github-actions
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@amakhrov
Copy link

I definitely have the same cases (example: https://sentry.io/organizations/crunchbase/issues/2843910577/?project=190044)

I ended up with custom code at our side to filter those out in the beforeSend callback (just as suggested in the comment above - I wish I had discovered it earlier :) ).

@github-actions
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: browser Issues related to the Sentry Browser SDK Type: Improvement
Projects
None yet
Development

No branches or pull requests

4 participants