❮ Back to FAQ

Ruby Configuration

How do I configure Scout APM for Ruby?

Scout can be configured via: - A config/scout_apm.yml YAML file - Environment variables (which override yaml settings)

For Heroku, use environment variables. For other deployments, either approach works.

What are the required configuration settings?

SettingDescription
nameYour application name (e.g., “Photos App”)
keyYour organization API key from the Scout UI
monitorSet to true to enable monitoring

How do I configure Scout using environment variables?

Uppercase the config key and prefix with SCOUT_. For example:

export SCOUT_KEY=your_key_here
export SCOUT_NAME="My Application"
export SCOUT_MONITOR=true

Can I use ERB in the config file?

Yes. ERB is evaluated when loading the config file. For example:

common: &defaults
  name: <%= "ProjectPlanner.io (#{Rails.env})" %>

How do I configure different environments separately?

Set unique app names per environment to keep data separate:

common: &defaults
  name: <%= "YOUR_APP_NAME (#{Rails.env})" %>
  key: YOUR_KEY
  monitor: true

production:
  <<: *defaults

development:
  <<: *defaults
  monitor: false

staging:
  <<: *defaults

Or use environment variables: SCOUT_NAME="My App (Staging)"

How do I ignore certain endpoints?

Use the ignore configuration option to exclude endpoints by path prefix:

ignore: ['/health', '/status']

How do I disable Scout on a specific server?

Set monitor: false in the configuration for that server. You can also use ERB to programmatically enable/disable based on hostname:

monitor: <%= Socket.gethostname.match(/web[1..5]/) %>

What are the logging options?

  • log_level: Set to debug, info, warn, or error. Default is INFO.
  • log_file_path: Directory for scout_apm.log. Use stdout for STDOUT logging. Heroku defaults to STDOUT.

What is the detailed_middleware option?

By default, Scout aggregates all middleware timings into a single “Middleware” category. Setting detailed_middleware: true shows time spent in each individual middleware. This adds overhead and is disabled by default since middleware is rarely a bottleneck.

Ready to Optimize Your App?

Join engineering teams who trust Scout Monitoring for hassle-free performance monitoring. With our 3-step setup, powerful tooling, and responsive support, you can quickly identify and fix performance issues before they impact your users.