Since the Agent is packaged as a Ruby Gem, installation is as simple as adding it to your Gemfile:
gem 'appdynamics' |
You must configure the application using a config file or using Env
variables.
To configure using a config file:
app_name: My App tier_name: Rails node_name: Production log_max_file_size: <Maximum bytes for Ruby log file (default 5 * 1024 * 1024)"> log_max_num_files: <Maximum number of Ruby agent log files (default 10)> controller: host: mycontroller.com port: 443# Optional account: myaccount access_key: accesskey cert_path: <absolute path> use_ssl: true# Optional http_proxy_host: <http_proxy_host> http_proxy_port: <http_proxy_port> http_proxy_username: <http_proxy_username> http_proxy_password_file: <absolute path to password file> log_dir: <log path> log_level: <trace|debug|info|warn|error|fatal> log_max_file_size: <Maximum bytes for sdk controller log file (default 5 * 1024 * 1024)"> log_max_num_files: <Maximum number of sdk controller log files (default 10)> |
Alternatively, to configure using ENV
variables:
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 |
If you are using Rails, no further configuration is necessary.
For Sinatra, you must add the following to your application:
require 'appdynamics/sinatra' set(:appdynamics_config, file: "config/appdynamics.yml") |
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:
config.appdynamics.environments << :development |
Download the code and run 'bundle exec yard'
in it. You can then open 'doc/index.html'
in the browser.
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:
bundle config build.app_dynamics --with-appdynamics-dir={INSTALL_PATH} |