Advanced Configuration
  • 1 Minute to read
  • Dark
    Light
  • PDF

Advanced Configuration

  • Dark
    Light
  • PDF

Article Summary

Ruby CLI Support

The Stackify Ruby Profiler can be used to track Ruby CLI applications.

General Configuration

Configuration is required to itemize which methods mark the start of a transaction.
Include a config/stackify.json file in your application:

{
    "instrumentation": [{
        "class": "SampleClass1",
        "method": "execute",
        "transaction": true
    }]
}

Rails Configuration

In the config/initializer folder of your Rails app create config/initializer/stackify.rb and then add this configuration:

Rails.configuration.to_prepare do
  StackifyRubyAPM.run_custom_instrument
end

Non-Rails Configuration

Add StackifyRubyAPM.run_custom_instrument to config.ru

Example:

use StackifyRubyAPM::Middleware
StackifyRubyAPM.start
StackifyRubyAPM.run_custom_instrument
at_exit { StackifyRubyAPM.stop }
Ruby CLI applications are tracked in Retrace at Monitoring > Other Apps. You must use the Add App button to add your application.

Was this article helpful?