Tagging Errors

Each error in Honeybadger has tags. Tags can be used to filter results when searching and can even apply to integrations so that only errors with a combination of certain tags trigger an email or a Slack message, for example.

Tags can be used to create custom workflows, such as:

  • Find all errors tagged "badgers" and resolve them.
  • Tag critical errors as "critical" and configure PagerDuty to alert you only when a critical error happens.
  • If you have errors which aren't actionable (but you still want to know about them), you could tag them with "low_priority" and exclude those errors when automatically creating issues via the GitHub integration.
  • Tag all errors that happen in an area of your app with the name of the team that is responsible for them, then notify their Slack channel for only those errors.

These are just examples: you can use tags however you want!

While you can always add tags to existing errors through the Honeybadger UI, they are most useful when you add them programmatically as the errors happen. There are two ways to add tags to errors from JavaScript:

Tagging Errors in Global Context

Every error which is reported within the current context will have the tags "critical" and "badgers" added:

Honeybadger.setContext({ tags: 'critical, badgers' });

Tagging Errors in Honeybadger.notify

The tags will be added for just the current error being reported:

Honeybadger.notify(error, { tags: 'critical, badgers' });