---
title: Filtering events
description: Ignore unwanted events before they're sent from your Ruby application to Honeybadger Insights.
url: https://docs.honeybadger.io/lib/ruby/insights/filtering-events/
---

For some applications, certain default events may be unecessary or excessively data heavy. To specify events to ignore, use the `events.ignore` configuration option. Here you can specify a list of event types for the gem to ignore. They can be either a string or a regex.

```yaml
events:
  ignore:
    - "enqueue.sidekiq"
    - !ruby/regexp "/.*.active_storage/"
```

You may also ignore events based on event data by specifying a hash object.

```yaml
events:
  ignore:
    - event_type: "chatty_events"
      custom_data: "ignore_me"
```

This will ignore events that have been created with the matching `event_type` and key(symbol)/value:

```ruby
Honeybadger.event('chatty_events', custom_data: 'ignore_me') # will not be sent to Insights
```

You can also use the `before_event` callback to inspect or modify event data, as well as calling `halt!` to prevent the event from being sent to Honeybadger:

config/initializers/honeybadger.rb

```ruby
Honeybadger.configure do |config|
  config.before_event do |event|
    # Ignore health check requests
    if event.event_type == "process_action.action_controller" && event[:controller] == "Rails::HealthController"
      event.halt!
    end


    # DB-backed job backends can generate a lot of useless queries
    if event.event_type == "sql.active_record" && event[:query].match?(/good_job|solid_queue/)
      event.halt!
    end
  end
end
```

`before_event` can be called multiple times to add multiple callbacks.

## Default ignored events

The gem comes configured to ignore a few events that can be chatty and not useful:

* `sql.active_record` events with queries that contain only “BEGIN” or “COMMIT”.
* `sql.active_record` events for database backed background processing gems (SolidQueue and GoodJob).
* `process_action.action_controller` events for `Rails::HealthController` actions.

## Sampling events

If you’d rather reduce event volume across the board instead of ignoring specific events, see [Sampling events](https://docs.honeybadger.io/lib/ruby/insights/sampling-events/).

---

## 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/)
