rollbar / rollbar.js

Error tracking and logging from Javascript to Rollbar

Home Page:https://docs.rollbar.com/docs/javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filter errors based on Telemetry and Trace data

arctouch-raphaellupchinski opened this issue · comments

Hi,
I've been struggling to filter an error that's named as something far too generic for me to add it in the ignoredMessages array.
I was able to track that there was a specific event in common on the telemetry data that would allow me to filter those out, as it's caused by some ad code, that runs inside iframes.

For example, here's what I have for one of those errors:

"body": {
  "telemetry": [
    { ... },
    {
      "body": {
        "end_time_ms": null, 
        "url": "https://www.domain-from-ad.com/path", // doesn't matter much here...
        "status_code": null, 
        "subtype": "fetch", 
        "method": "get",
        ...
      }, 
      ...
    },
    { ... },
  ],
  "trace": {
    "frames": [], 
    "exception": {
      "raw": "TypeError: Failed to fetch", 
      "message": "Failed to fetch", 
      "description": "Failed to fetch", 
      "class": "TypeError", 
      "stack": "TypeError: Failed to fetch"
    }
  },
  ...
}

So in short, what I'd like is:

  • to filter all occurrences of those TypeError: Failed to fetch in the trace where
  • we had in the telemetry some item that had the domain-from-ad URL,
  • was a "subtype": "fetch"
  • and the status_code is null

Not sure if the checkIgnore method here is what I need to use here, and if it is, do I iterate over the telemetry array searching for it?

@arctouch-raphaellupchinski Yes, that should be the best place to detect these.