Installation

Raygun's support for Ruby APM will allow you to profile your Ruby or Ruby on Rails application. Ruby teams can now get end-to-end monitoring with features like detailed trace transactions, dashboards, user experience monitoring and more.

It's as simple as installing our Agent and the appropriate Ruby gem.


Installation instructions for Ruby

The profiler only supports CRuby, also known as Matz's Ruby Interpreter (MRI).

  • 2.5.x
  • 2.6.x
  • 2.7.x
  • 3.0.x
  • 3.1.x

Contact us to support other Ruby versions.

Follow the agent installation instructions for your environment.


Include this gem in your Gemfile:

gem 'raygun-apm'

To avoid profiling test data, only enable profiling for your production environment:

group :production do
  gem 'raygun-apm'
end

Run bundle to install the gem.

Alternatively, install it using rubygems:

gem install raygun-apm

Installation instructions for Ruby on Rails

  • Rails 5.x
  • Rails 6.x

Contact us to support other Ruby on Rails versions.

Follow the agent installation instructions for your environment.


Include this gem in your Gemfile:

gem 'raygun-apm-rails'

To avoid profiling test data, only enable profiling for your production environment:

group :production do
  gem 'raygun-apm-rails'
end

Run bundle to install the gem.

Alternatively, install it using rubygems:

gem install raygun-apm-rails

If you are using Sidekiq, include the Sidekiq gem alongside the Ruby on Rails gem:

group :production do
  gem 'raygun-apm-rails'
  gem 'raygun-apm-sidekiq'
end

Alternatively, install it using rubygems:

gem install raygun-apm-sidekiq

This buildpack installs the Raygun APM agent on your dyno, and starts it after every deploy. To collect data from a Ruby application, you also need the relevant Ruby gem (raygun-apm-rails for a Rails app, raygun-apm otherwise) to your Gemfile.

If you've never deployed your Rails project on Heroku before, please consult the Getting Started on Heroku with Rails guide first to get started.

Navigate to the directory of your project:

cd <YOUR RUBY/RAILS PROJECT>

Initialize a new Heroku project:

heroku create

Add the Ruby buildpack:

heroku buildpacks:add heroku/ruby

Add the Raygun APM buildpack:

heroku buildpacks:add https://github.com/MindscapeHQ/heroku-buildpack-raygun-apm

Add your APM API key to your application configuration:

heroku config:add RAYGUN_API_KEY=<YOUR RAYGUN API KEY>

Commit the changes: e.g.

git commit -am "added heroku set up"

Deploy to Heroku:

git push heroku master


Having trouble receiving traces? Please look at our troubleshooting guide.