Hey Elixir friends, great news! Honeybadger now offers performance monitoring for your Elixir, Phoenix, and Oban applications.
Last year, we launched Honeybadger Insights, a new logging and performance monitoring tool bundled with Honeybadger. Insights allows you to query your logs and events to diagnose performance issues, perform root-cause analyses, and create charts and dashboards to see what's happening in real time. It's also deeply integrated with error tracking, unlocking direct access to query and analyze your error data.
Everyone who tries Honeybadger Insights LOVES it. But there was a problem: you still had to get your data into Honeybadger, and there was no automatic way to visualize it to discover performance insights. Until today, that is. :)
Elixir performance monitoring in Honeybadger
Today, we're thrilled to announce several powerful new features designed just for Elixir developers:
- A new Phoenix performance dashboard. Instead of creating a dashboard from scratch, select " Phoenix" from our list of curated monitoring dashboards. The new dashboard allows you to monitor requests, slow controllers, Ecto queries, and more.
- A new Oban dashboard. We love Oban at Honeybadger and thought it would be the perfect companion to the Phoenix dashboard (the first of many useful dashboards, we hope!). The Oban dashboard gives you a quick overview of your Oban performance, including job counts by status, worker stats, and slow jobs.
- Elixir & Phoenix performance instrumentation. Our Hex package now automatically sends performance events and metrics (via telemetry) from Phoenix and other popular libraries. The new instrumentation powers your dashboard, but you can also use our query language (BadgerQL) to dig into the data yourself, which creates some exciting possibilities.
I'm excited to dig into each of these features—but real quick, here's the tl;dr:
You can try Honeybadger for free right now with 50MB/day ingest included—that's 1.5GB/month for free. Our team pricing is reasonable, too; Honeybadger is almost 4 times cheaper than Papertrail for logging. 🤯
The Phoenix Performance Dashboard
When creating a dashboard in Honeybadger, you have several options. To get started, select the new " Phoenix" dashboard from the list:
Our team curates each dashboard to make it easy for you to ramp up with Honeybadger and BadgerQL. Just install our latest Hex package, select your dashboard(s), and you're done.
Here's what the Phoenix dashboard looks like:
Honeybadger's new Phoenix Performance Dashboard
The new Phoenix dashboard includes the following widgets by default:
- Requests - A count of the total number of requests to your Phoenix app for the current period. This tells you i.e. how many requests you handled in the past day.
- Request Stats - A dual-axis line chart showing request counts and average duration over time, helping you spot performance trends and correlate traffic spikes with slowdowns.
- Response Counts - A line chart showing the number of responses grouped by status code over time, making it easy to spot error spikes and unusual patterns.
- 10 Slowest Controller Actions - Your slowest Phoenix controller actions with their average duration, controller name, and action. This table points you to where you can improve performance in your app.
- 10 Slowest Ecto Queries - Your slowest database queries with their average and max duration, source, and SQL query string. This table helps you identify and optimize your most time-consuming database operations.
- LiveView Events - A count of the total number of LiveView events for the current period.
- LiveView Event Counts - A line chart showing the number of LiveView events over time, making it easy to spot anomalies in LiveView activity.
- LiveView Event Performance - A multi-line chart showing average duration by view type for your LiveView components, helping identify which components to optimize.
- LiveView Mount Performance - A multi-line chart showing mount duration by view type for your LiveView components, allowing you to detect slow initial loads.
After you create a dashboard, you don't have to keep the default widgets—we designed Honeybadger dashboards to be customized. In fact, reading the underlying queries is a great way to learn BadgerQL. To see the query and raw data behind any dashboard widget, click "Open in Query Editor":
You can tweak the query, review the results, and update the dashboard from there:
New monitoring dashboard for Oban
We also added a monitoring dashboard for Oban. To get it, select "Oban" from the list when creating a new dashboard in Honeybadger:
Here's what the Oban dashboard looks like:
Honeybadger's new Oban Monitoring Dashboard
The new Oban dashboard includes the following default widgets:
- Successful Jobs - A large counter showing the total number of successfully processed jobs in your Oban queues. This tells you i.e. how many background jobs completed successfully in the current period.
- Job Status Breakdown — Individual counters for job states such as discarded, snoozed, failed, and canceled jobs.
- Job Counts by Status - A stacked area chart showing the distribution of job states over time, helping you spot trends in job processing and identify periods of increased failures.
- Job Durations - A multi-line chart showing average execution time by worker module over time. This helps you identify which workers are taking longer to process and track performance trends across different job types.
- Overall Worker Stats - A table listing additional statistics for each worker module.
- Slowest 10 Runs - Your slowest individual job executions. This table helps you investigate specific slow jobs and understand their impact on your system.
Of course, you can rearrange, edit, and replace the default dashboard widgets to make them even more specific to your application.
Elixir & Phoenix performance instrumentation
The data that feeds the new Phoenix and Oban dashboards is sent automatically from the honeybadger
Hex package in version ~> 0.24
—so make sure you upgrade to the latest version. To enable Honeybadger's automatic instrumentation, add the following to your configuration:
# config/config.ex
config :honeybadger,
insights_enabled: true
Honeybadger automatically instruments the following libraries when they are available:
- Ecto: Database queries
- Plug/Phoenix: HTTP requests
- LiveView: Phoenix LiveView lifecycle events
- Oban: Background job processing
- Absinthe: GraphQL query execution
- Finch: HTTP client requests, often used by other libraries like Req
- Tesla: HTTP client requests
After deploying the new configuration, some new events and metrics will begin to appear in Honeybadger Insights, and your dashboards will come alive!
Sending custom events
You can also send your own events to Honeybadger using the Honeybadger.event/1
or Honeybadger.event/2
functions:
# Using event/1
Honeybadger.event(%{event_type: "user_created", user: user.id})
# Using event/2
Honeybadger.event("user_created", %{user: user.id})
The first argument in event/2
is the type of the event (event_type
), and the second argument is a map containing any additional data you want to include. We'll also add a ts
field with the current timestamp to the event if you don't supply one.
You can find these events with the following BadgerQL query:
fields @ts, @preview
| filter event_type::str == "user_created"
| sort @ts
Sending logs from your infrastructure
Last but not least, Honeybadger isn't just for errors and application data! You can use our syslog, Vector, or PaaS integrations to send additional data from your infrastructure to Honeybadger, where you can query, visualize, and analyze all of your production data in one place.
Start monitoring your Elixir performance
To try out the new Elixir performance monitoring features in Honeybadger, all you need to do is sign up for a free Honeybadger account. We include 50MB/day (1.5GB/month) ingest for free, and you can upgrade to a paid plan if you need more. Our pricing is reasonable, too. Honeybadger is almost 4 times cheaper than Papertrail for logging. 🤯
As always, we'd love to hear from you. Send us an email with your feedback and suggestions.