Automatic instrumentation
Honeybadger Insights captures events from your Ruby application, including web requests, database queries, background jobs, and cache operations, and makes them available for querying, visualization, and dashboards. In a Rails app, this gives you performance monitoring and observability out of the box without additional instrumentation libraries.
In Honeybadger Ruby gem v6.0+, Insights is enabled by default. If you’re using an older
gem version (v5.11+), you’ll need to enable it manually in your honeybadger.yml
configuration file:
insights: enabled: trueEvent captures
Section titled “Event captures”Automatic instrumentation sends events from Rails, ActiveJob, Sidekiq, SolidQueue, Karafka, Net::HTTP, Puma, and more to Honeybadger, where they will be displayed in the Insights section of your project.
See the Ruby event reference for every event the gem emits, with field schemas and types.
To find these events, filter by event_type::str. Here’s an example BadgerQL
query that you can use:
fields @ts, @preview| filter event_type::str == "perform.sidekiq"| sort @tsCustomizing Insights for a specific plugin
Section titled “Customizing Insights for a specific plugin”When Insights is active, all plugins are enabled if the required library is present. For example, if Sidekiq is present in your app, the Sidekiq plugin will be loaded. You can disable automatic Insights instrumentation for a specific plugin by adding a configuration like this:
sidekiq: insights: enabled: falseThis will only affect Insights-related data capture and not the error notification portion of the plugin.
Some plugins allow for an easy way to choose if you want to capture events, metrics, or both for a particular plugin. The following configuration options are available:
rails: insights: events: true metrics: falsekarafka: insights: events: true metrics: falsesidekiq: insights: events: true metrics: falsenet_http: insights: events: true metrics: falsesolid_queue: insights: events: true metrics: falsepuma: insights: events: true metrics: falseautotuner: insights: events: true metrics: falseEvent options are all true by default. It is recommened to turn off events for plugins that may be producing more data than you actually need. Metric data collection is false by default since most metrics can be calculated from events.
By default, the net_http plugin logs the domain name of any request as part of
the event payload. You can enabling logging of the full URL by setting the
following configuration:
net_http: insights: full_url: trueManaging event volume
Section titled “Managing event volume”If some events are noisy or you’d like to reduce quota consumption:
- Filtering events — ignore specific event types, or inspect and halt events with a callback.
- Sampling events — send only a percentage of events.
Sending your own events
Section titled “Sending your own events”Automatic instrumentation covers the libraries the gem knows about. To send your own application events, see Sending custom events.
Metrics
Section titled “Metrics”The Honeybadger Ruby gem does more than just send events when they occur in your app. You can also enable metric collection. Check out Collecting and Reporting Metrics for more information.
Sending Rails logs to Insights
Section titled “Sending Rails logs to Insights”If you are already using the Rails logger to track events in your application, you can send those events to Insights by using a structured logging gem.