Heroku is platform as a service (PaaS) providing support for several programming languages. You can use Atatus APM with your Heroku apps. Atatus APM supports PHP, Java, Ruby, Python and Node.js languages.

Follow the below mentioned steps to install Atatus in Heroku Ruby app.

Rails installation steps

  1. From Heroku dashboard, select the relevant application you have created and choose Atatus from the add-on page. There are two ways to choose the add-on.

    • From UI, you can click on the Configure add-ons and then select the subscription plan.
    • From Command line
    copy
    icon/buttons/copy
        heroku addons:create atatus:$planlevel -a YOUR_APP
    
  2. Go to Atatus dashboard by clicking on the Atatus add-on and navigate to the Settings » Account Settings » License Keys in Atatus and copy the Atatus APM License key.

  3. From your terminal, go to your Rails app directory and set the license key and application name in heroku config as follows.

    copy
    icon/buttons/copy
    heroku config:set ATATUS_APP_NAME='Rails App' -a YOUR_APP
    
    heroku config:set ATATUS_LICENSE_KEY='Your APM License Key' -a YOUR_APP
    
    copy
    icon/buttons/copy
    # Verify config
    heroku config
    
  4. Add the Atatus agent gem to your Gemfile.

    copy
    icon/buttons/copy
    gem 'atatus'
    
  5. Install the gem from your application root directory.

    copy
    icon/buttons/copy
    bundle install
    
  6. Run the following commands to commit the changes.

    copy
    icon/buttons/copy
    git add .
    git commit -m "Add Atatus Agent"
    git push heroku master && heroku logs --tail
    
  7. Access your server from your web app or mobile app or curl. You will visualize your application's metrics within minutes.

Sinatra installation steps

  1. From Heroku dashboard, select the relevant application you have created and choose Atatus from the add-on page. There are two ways to choose the add-on.

    • From UI, you can click on the Configure add-ons and then select the subscription plan.
    • From Command line
    copy
    icon/buttons/copy
        heroku addons:create atatus:$planlevel -a YOUR_APP
    
  2. Go to Atatus dashboard by clicking on the Atatus add-on and navigate to the Settings » Account Settings » License Keys in Atatus and copy the Atatus APM License key.

  3. From your terminal, go to your Sinatra app directory and set the license key and application name in heroku config as follows.

    copy
    icon/buttons/copy
    heroku config:set ATATUS_APP_NAME='Sinatra App' -a YOUR_APP
    
    heroku config:set ATATUS_LICENSE_KEY='Your APM License Key' -a YOUR_APP
    
    copy
    icon/buttons/copy
    # Verify config
    heroku config
    
  4. Add the Atatus agent gem to your Gemfile.

    copy
    icon/buttons/copy
    gem 'atatus'
    
  5. Install the gem from your application root directory.

    copy
    icon/buttons/copy
    bundle install
    
  6. In config.ru file, use Atatus middleware inside the Sinatra app and start Atatus agent.

    copy
    icon/buttons/copy
    require 'sinatra/base'
    require 'atatus'
    
    class MySinatraApp < Sinatra::Base
      # TODO: add this line inside your app class
      use Atatus::Middleware
    
      # your code here.
    end
    
    # TODO: Start Atatus agent.
    Atatus.start()
    
  7. Run the following commands to commit the changes.

    copy
    icon/buttons/copy
    git add .
    git commit -m "Add Atatus Agent"
    git push heroku master && heroku logs --tail
    
  8. Access your server from your web app or mobile app or curl. You will visualize your application's metrics within minutes.