Ruby Troubleshooting
Why am I not seeing any data in Scout?
Work through these steps:
Check if monitoring is enabled for your environment in the configuration
Look for the log file at
log/scout_apm.log. If it doesn’t exist, the gem wasn’t initialized. Ensurescout_apmisn’t restricted to a specific group in your Gemfile.Enable debug logging: Set
log_level: debugin scout_apm.yml (orSCOUT_LOG_LEVEL=debug) and restartVerify the gem is deployed: Run
bundle list scout_apmConfirm the config file exists at
config/scout_apm.ymlRestart the app and verify it’s processing requests
Using Unicorn? Add
preload_app trueto your Unicorn config
If still not working, contact support@scoutapm.com with debug logs and your gem list.
Why do I see “StackLevelTooDeep” errors?
This occurs when multiple monitoring tools use different instrumentation methods (alias_method vs prepend). Two fixes:
- List
scout_apmabove the conflicting gem in your Gemfile:
gem 'scout_apm'
gem 'newrelic_rpm' # Must be after scout_apm- For agent versions 5.3.0+, set
use_prepend: truein config, orSCOUT_USE_PREPEND=truefor Heroku.
Why is there significant time in “Controller” or “Job”?
This indicates time outside Scout’s default instrumentation. Options:
- Custom Instrumentation: Use Scout’s API to instrument specific code sections
- Auto Instruments: Enable to automatically break down controller code (note: doesn’t instrument background jobs)
Why are memory metrics missing?
Memory allocation metrics require: - Ruby 2.1+ - scout_apm version 2.0+
Without these, Scout functions but doesn’t report allocation metrics.
Why aren’t certain errors being reported?
By default, Scout ignores ActiveRecord::RecordNotFound and ActionController::RoutingError. To collect these, set errors_ignored_exceptions to an empty array:
SCOUT_ERRORS_IGNORED_EXCEPTIONS=[]Why is there a conflict with SimpleCov?
When Auto Instruments is enabled in test environments, conflicts with SimpleCov can occur. Disable Auto Instruments in the test environment via config or environment variables.
What overhead does Scout add?
Scout is built for production with minimal overhead. Two scenarios have higher overhead:
detailed_middleware enabled: Instrumenting each middleware adds overhead. Keep disabled unless needed.
Resque instrumentation: Since Resque forks child processes, Scout uses WEBrick to aggregate results. For ~18ms jobs, overhead is about 8%. Longer jobs have lower relative overhead.