Project

barnes

0.31
Low commit activity in last 3 years
There's a lot of open issues
A long-lived project that still receives updates
Collect Ruby GC, ObjectSpace, and Puma metrics and report them directly to Heroku Runtime Metrics via HTTP.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.3
~> 2
>= 10
~> 5.6

Runtime

>= 0
>= 0
 Project Readme

Barnes

Ruby runtime metrics for Heroku Runtime Metrics. Collects GC stats, ObjectSpace counts, and Puma thread/pool metrics and POSTs them directly to HEROKU_METRICS_URL.

Originally a fork of trashed.

Setup

Rails

Add this to your Gemfile:

gem "barnes"

Then run:

$ bundle install

Barnes will start automatically via a Railtie when HEROKU_METRICS_URL is set in the environment (this is provided automatically on Heroku dynos).

Non-Rails (Puma)

Add the gem to your Gemfile:

gem "barnes"

Then in your puma.rb:

require 'barnes'

before_fork do
  Barnes.start
end

How it works

Barnes starts a background thread that collects metrics at a configurable interval (default: 10 seconds) and POSTs them as JSON to the URL in HEROKU_METRICS_URL.

Barnes is a silent no-op when:

  • HEROKU_METRICS_URL is not set (e.g. local development)
  • The dyno is a one-off run.* dyno

No external dependencies or sidecar processes are required.

Configuration

Barnes.start(
  interval: 10,   # seconds between reports (default: 10)
  panels:   []    # custom instrumentation panels (default: built-in ResourceUsage)
)

Requirements

  • Ruby >= 3.1