Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Anchor
Prerequisites
Prerequisites
Following sections provide the configuration and requirement details to install the Ruby agent.

Since the Agent is packaged as a Ruby Gem, installation is as simple as adding it to your Gemfile:

Code Block
languageruby
titleGemfile
gem 'appdynamics'

Basic Configuration

You must configure the application using a config file or using Env variables.

...

Code Block
 def self.env_to_key
      @env_to_key ||= super.merge(
        'APP_NAME' => :app_name,
        'TIER_NAME' => :tier_name,
        'NODE_NAME' => :node_name,
        'LOG_MAX_NUM_FILES' => :log_max_num_files,
        'LOG_MAX_FILE_SIZE' => :log_max_file_size,
        'CONTROLLER_HOST' => :'controller.host',
        'CONTROLLER_ACCOUNT' => :'controller.account',
        'CONTROLLER_ACCESS_KEY' => :'controller.access_key',
        'CONTROLLER_CERT_PATH' => :'controller.cert_path',
        'CONTROLLER_PORT' => :'controller.port',
        'CONTROLLER_USE_SSL' => :'controller.use_ssl',
        'CONTROLLER_HTTP_PROXY_HOST' => :'controller.http_proxy_host',
        'CONTROLLER_HTTP_PROXY_PORT' => :'controller.http_proxy_port',
        'CONTROLLER_HTTP_PROXY_USERNAME' => :'controller.http_proxy_username',
        'CONTROLLER_HTTP_PROXY_PASSWORD_FILE' => :'controller.http_proxy_password_file',
        'CONTROLLER_LOG_DIR' => :'controller.log_dir',
        'CONTROLLER_LOG_LEVEL' => :'controller.log_level',
        'CONTROLLER_LOG_MAX_NUM_FILES' => :'controller.log_max_num_files',
        'CONTROLLER_LOG_MAX_FILE_SIZE' => :'controller.log_max_file_size',
        'LAZY_START' => :lazy_start
      )
    end

Rails Setup

If you are using Rails, no further configuration is necessary.

Sinatra Setup

For Sinatra, you must add the following to your application:

Code Block
languageruby
require 'appdynamics/sinatra'
set(:appdynamics_config, file: "config/appdynamics.yml")

Miscellaneous Requirements

Enable in Rails Development Mode

We do not recommend instrumenting your development environment. However, for the sake of testing, this might be useful. To do so, update the config/application.rb to include:

Code Block
languageruby
config.appdynamics.environments << :development

View Initial Documentation

Download the code and run 'bundle exec yard' in it. You can then open 'doc/index.html' in the browser.

Alternate C/C++ SDK

The Ruby agent uses the AppDynamics C/C++ SDK, which is bundled with the gem. An alternate version (API compatible with 4.4/4.5) can be used by passing the parameters --with-appdynamics-dir to the installation. With bundler, you can set this as a config option:

...