Install APM Insight Ruby on Rails Agent


Supported Environments

  • Ruby - 1.8.7 and higher
  • Rails - 3.0 and higher
  • Sinatra - 1.4.0 and higher

Steps to install APM Insight Ruby On Rails Agent

For Heroku applications

  • In Applications Manager APM Insight tab > Help Card > copy the License Key present there.
  • Download the the appropriate APM Insight Ruby on Rails Agent file (apminsight.gem) from here.
  • Copy this file to your application home directory.
  • Open 'Gemfile' in text editor, add gem 'apminsight'.
  • Execute 'bundle install' to install the dependencies.
  • Push these changes to your project repository (differs based on your deployment method).
  • Go to Heroku> your application > settings > Config variables, add the following variables
    • LICENSE_KEY = Enter your License Key
    • APM_APPLICATION_NAME = Enter your application name
  • Deploy the application in Heroku.

For all other applications

  • In Applications Manager APM Insight tab > Help Card > copy the License Key present there.
  • Ruby Agent installation can be done in two ways:
    • Install from rubygems.org by using the following command

      gem install apminsight

    • Download the the appropriate APM Insight Ruby on Rails Agent file (apminsight.gem) from here and run the command:

      gem install {path}/apminsight.gem

  • For Rails environment:
    • Add the following line into Gemfile

      gem 'apminsight'

    • Bundle it to your application by executing command

      bundle install

  • For Sinatra environment:
    • Add the following line into Gemfile

      gem 'apminsight'

    • If you are not using Bunde.require in your application, add the line to your application file

      require 'apminsight'

  • Once the gem is installed in your respective environment, copy the configuration file apminsight.conf from <Gem Installed folder>/apminsight/conf/ directory to application home directory
  • Open the apminsight.conf file in any text editor and update the mandatory configurations keys such as adding application.name, apm.hostapm.port, license.key etc in there. To learn more about the Ruby agent configurations, visit our Configuration Guide page.
  • Restart the application server

Note: To check if the agent is installed correctly, use the command gem list. This command will list all the installed gem in the machine. Check if the apminsight gem file is included in the list.