Supported Versions

  • We currently support all versions of Grape since 1.2.

Installation steps

  1. Add the Atatus agent gem to your Gemfile.

    copy
    icon/buttons/copy
    gem 'atatus'
    
  2. Install the Atatus Ruby agent.

    copy
    icon/buttons/copy
    bundle install
    

    The Ruby bundle install will automatically require Atatus.

  3. Config File Structure:

    The Ruby agent's atatus.yml is a YAML configuration file comprising a common section followed by environment-specific sections like development, testing, and production.

    Environment Detection:

    The agent selects the config section based on environment variables like RUBY_ENV, RAILS_ENV, or RACK_ENV. If none are set, it defaults to the development environment.

    Failure to indent correctly may result in the agent throwing an error during startup, indicating "Unable to parse configuration file".

    development:
      license_key: 'YOUR_LICENSE_KEY'
      app_name: "grape app (Development)"
    production:
      license_key: 'YOUR_LICENSE_KEY'
      app_name: "grape app (Production)"
    

    Example:

    config/atatus.yml

    development:
      license_key: 'lic_apm_******'
      app_name: "grape app (Development)"
    production:
      license_key: 'lic_apm_******'
      app_name: "grape app (Production)"
    
  4. Add middleware to start (and stop) Atatus when booting your app.

    # Example config.ru
    
    require 'grape'
    
    module MyModule
      class API < Grape::API
        use Atatus::Middleware
    
      # ...
      end
    end
    
    Atatus::Grape.start(MyModule::API)
    run MyModule::API
    

5. Restart your Grape ruby server to view your performance data within minutes.