Reducing Noise

Honeybadger can ignore frequent/unwanted errors in order to reduce noise, limit bandwidth usage, or both.

If you want to ignore errors of a specific type or with a specic error message, the simplest way is to use the ignorePatterns configuration option:

Honeybadger.configure({
  // ...
  ignorePatterns: [/NoisyError/i, /unwanted error message/i]
});

Any error whose message matches one of the ignorePatterns will be ignored.


To ignore errors based on additional properties (such as the stack trace), use a Honeybadger.beforeNotify handler:

Honeybadger.beforeNotify(function(notice) {
  if (/third-party-domain/.test(notice.stack)) { return false; }
});

The following notice properties are available in beforeNotify handlers:

  • stack - The stack trace
  • name - The exception class name
  • message - The error message
  • url - The current url
  • projectRoot - The root url
  • environment - Name of the environment. example: "production"
  • component - Similar to a rails controller name. example: "users"
  • action - Similar to a rails action name. example: "create"
  • fingerprint - A unique fingerprint, used to customize grouping of errors in Honeybadger.
  • context - The context object.
  • params - An object of request parameters.
  • cookies - An object of cookie key/values. May also be sent as a string in the document.cookie "foo=bar;bar=baz" format.

Finally, if your application is reporting too many errors (which could interfere with bandwidth constraints, or cause you to use up your monthly error volume too quickly), use the maxErrors configuration option:

Honeybadger.configure({
  // ...
  maxErrors: 20
});

On each page load, errors will be sent to Honeybadger until the maxErrors threshold has been reached. In the above example, 20 errors will be reported per page load.

Use Honeybadger.resetMaxErrors() to reset the counter between page loads (useful for single page apps which don't typically reload the page often).