---
title: Tagging errors
description: Add tags to Ruby error reports to categorize and filter errors for better organization and analysis.
url: https://docs.honeybadger.io/lib/ruby/errors/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 exceptions happen. There are two ways to add tags to errors from your Ruby app:

## Tagging errors in global context

Every exception which is reported within the current context will have the specified tags added. Use the `tags` key to set the tags:

```ruby
# Using a comma-separated string
Honeybadger.context({
  tags: 'critical, badgers'
})


# Or using an array of strings
Honeybadger.context({
  tags: ['critical', 'badgers']
})
```

## Tagging errors in `Honeybadger.notify`

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

```ruby
# Using a comma-separated string
Honeybadger.notify(exception,
  tags: 'critical, badgers'
)


# Or using an array of strings
Honeybadger.notify(exception,
  tags: ['critical', 'badgers']
)
```

## Tag processing

Tags are processed as follows:

* Comma-separated strings are split into individual tags
* Whitespace is automatically trimmed from each tag
* Tags from context and explicit tags are merged and deduplicated
* Empty tags are ignored

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
