Ruby Language Runtime Metrics (Private Beta)
Last updated 15 November 2017
To provide more visibility into the Ruby runtime, the Ruby runtime metrics feature surfaces additional language-specific time series metrics within Application Metrics. Ruby metrics include free and allocated heap object counts and number of free memory slots. The feature is currently in private beta. If you would like to be flagged in, or have questions or feedback, you can reach us at email@example.com.
Ruby language metrics are available for all paid dynos (Hobby and above) and Private Spaces.
For general information on metrics display settings, please refer to the language runtime metrics parent document.
Get access to the private beta
If you haven’t already, please contact us with the names of your apps to be flagged into the private beta.
You can continue with the rest of the steps, but will not see any ruby metrics in your application’s dashboard until your applications are flagged into the private beta and restarted.
Add the metrics buildpack
The next step is to add the
heroku/metrics buildpack to your application. This can be done through the CLI or the dashboard
Adding the buildpack via the CLI
To add the buildpack using the command line interface (CLI), run the following:
$ heroku buildpacks:add -i 1 heroku/metrics
Adding the buildpack via the Dashboard
From the Settings tab for your app add the buildpack like so:
Prepare the application
On Rails 5, 4, & 3, add the barnes gem to your Gemfile:
$ bundle install
Add the barnes gem to the Gemfile:
$ bundle install
In your application code require the barnes library and start Barnes with default values like so:
require 'barnes' # Other Application Code Barnes.start
Commit & Push
To finish up commit the changes and push to Heroku like so:
$ git add -A . $ git commit -am "Enable Heroku Ruby Metrics" $ git push heroku master
Heap Objects Count
Max and average allocated and freed heap object counts are displayed on a log scale, with freed shown as mirrored below the y-axis baseline. Metrics reflect the selected time interval, with the default being the most recent one.
Free Memory Slots
The Free Memory Slots plot displays the minimum, maximum and average available free memory slots for the selected time interval. The most recent interval is shown as the default.