--- title: "Ruby APM with Heroku" slug: "ruby-apm-with-heroku" description: "Learn how to install the Ruby APM Profiler in your Heroku Ruby app. Add Stackify APM module, configure settings, and verify results in the Retrace dashboard." updated: 2020-08-10T21:08:30Z published: 2020-08-10T21:08:30Z canonical: "docs.stackify.com/ruby-apm-with-heroku" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.stackify.com/llms.txt > Use this file to discover all available pages before exploring further. # Ruby APM with Heroku This document details how to install the **Ruby APM Profiler** in your **Ruby** application running on **Heroku**. ## Ruby Application Setup ### Add Stackify APM Module Modify application `Gemfile`: ``` gem 'stackify-ruby-apm' ``` ### Configure Application Add `config/stackify_apm.yml` to your application, modify **application_name** and **environment_name**. ``` application_name: 'Ruby Application' environment_name: 'Production' ``` #### Rails Profiler will startup automatically, no additional configuration. #### Non-Rails Include **StackifyRubyAPM::Middleware** when starting your application: ``` # config.ru require 'stackify-ruby-apm' use StackifyRubyAPM::Middleware StackifyRubyAPM.start # application startup at_exit { StackifyRubyAPM.stop } ``` ### Add Buildpack ``` heroku buildpacks:add -i=1 https://github.com/stackify/heroku-buildpack-stackify.git ``` ### Configure Buildpack ``` heroku config:set STACKIFY_KEY="XXXXXXXXXX" heroku config:set STACKIFY_APPLICATION_NAME="My Application" heroku config:set STACKIFY_ENVIRONMENT_NAME="Production" ``` Set `STACKIFY_KEY` to your **Stackify Activation Key**. ## Verify Deploy changes to Heroku and make requests. You can then verify results in the Retrace dashboard.