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.
events: ignore: - "enqueue.sidekiq" - !ruby/regexp "/.*.active_storage/"You may also ignore events based on event data by specifying a hash object.
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:
Honeybadger.event('chatty_events', custom_data: 'ignore_me') # will not be sent to InsightsYou 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:
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 endendbefore_event can be called multiple times to add multiple callbacks.
Default ignored events
Section titled “Default ignored events”The gem comes configured to ignore a few events that can be chatty and not useful:
sql.active_recordevents with queries that contain only “BEGIN” or “COMMIT”.sql.active_recordevents for database backed background processing gems (SolidQueue and GoodJob).process_action.action_controllerevents forRails::HealthControlleractions.
Sampling events
Section titled “Sampling events”If you’d rather reduce event volume across the board instead of ignoring specific events, see Sampling events.