Customizing Error Grouping
Honeybadger groups similar exceptions together using rules which we’ve found to work the best in most cases. The default information we use to group errors is:
- The file name, method name, and line number of the error’s location
- The class name of the error
- The component/controller name
We use this information to construct a “fingerprint” of the exception. Exceptions with the same fingerprint are treated as the same error in Honeybadger.
It is possible to customize your grouping by sending a different fingerprint to Honeybadger when the exception is reported.
There are two ways you can customize the fingerprint: globally (for all
exceptions that are reported from your app), and locally (when calling
Customizing the Grouping for all Exceptions
Honeybadger.before_notify callback in conjunction with the
Notice#fingerprint method allows you to change the fingerprint of a
notice to properly group the same notices.
Honeybadger.configure do |config| config.before_notify do |notice| notice.fingerprint = [notice.error_class, notice.component, notice.backtrace.join(',')].join(':') end end
For a list of properties available on the
notice parameter, see the API
Customizing the Grouping for
:fingerprint option can be used to override the fingerprint for an
exception reported with
Honeybadger.notify(exception, fingerprint: 'a unique string')