---
title: metric.hb
description: A metric recorded through Honeybadger's instrumentation API and flushed by the metrics registry. The metric_type field tells you whether the event came from gauge, increment_counter, decrement_counter, histogram, or time.
url: https://docs.honeybadger.io/insights/event-types/ruby/metric.hb/
---

A metric recorded through Honeybadger’s instrumentation API and flushed by the metrics registry. The metric\_type field tells you whether the event came from gauge, increment\_counter, decrement\_counter, histogram, or time.

Category **Metrics** Fields **15** [honeybadger-ruby](https://docs.honeybadger.io/lib/ruby/)

## Fields

| Field           | Type                   | Description                                                                                                                     |
| --------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `event_type`    | string                 | Allowed value: `metric.hb`.                                                                                                     |
| `metric_name`   | string                 | Name of the metric as passed to the recording call.                                                                             |
| `metric_type`   | string                 | The metric type. Timers are gauges recorded via Honeybadger.time. Allowed values: `gauge`, `counter`, `histogram`, `timer`.     |
| `samples`       | integer                | Number of observations recorded in this flush window.                                                                           |
| `interval`      | integer                | Length of the aggregation/flush window in seconds (insights.registry\_flush\_interval, default 60).                             |
| `total`         | number                 | Sum of all recorded values in the window (gauge, timer, and histogram metrics).                                                 |
| `min`           | number                 | Minimum recorded value in the window (gauge, timer, and histogram metrics).                                                     |
| `max`           | number                 | Maximum recorded value in the window (gauge, timer, and histogram metrics).                                                     |
| `avg`           | number                 | Average of recorded values in the window (gauge, timer, and histogram metrics).                                                 |
| `latest`        | number                 | Most recently recorded value in the window (gauge, timer, and histogram metrics).                                               |
| `counter`       | number                 | Accumulated counter value for the window (counter metrics).                                                                     |
| `bins`          | array\<array\<number>> | Histogram bin counts as \[upper\_bound, count] pairs. The final bin's upper bound is 1e20, which represents infinity.           |
| `hostname`      | string                 | Server hostname. Attached to every event by default (events.attach\_hostname).                                                  |
| `environment`   | string                 | Application environment, e.g. "production". Attached to every event by default (events.attach\_environment).                    |
| `metric_source` | string                 | Source plugin or component that recorded the metric, e.g. "rails", "sidekiq", "solid\_queue", "net\_http", "puma", "autotuner". |

## Example

```json
{
  "event_type": "metric.hb",
  "metric_name": "duration.process_action.action_controller",
  "metric_type": "gauge",
  "metric_source": "rails",
  "samples": 20,
  "interval": 60,
  "total": 1820.5,
  "min": 12.3,
  "max": 210.4,
  "avg": 91.03,
  "latest": 88.6,
  "hostname": "web-1.example.com",
  "environment": "production"
}
```

---

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