Stackify Ruby APM
Installation Guide
Rails Guide
Install Stackify Linux Agent.
Check that your setup meets our system requirements.
- Ruby version 2.0+
- Frameworks
- Ruby on Rails 4+
- Rack 1+
- Sinatra 1.4+
- Operating System
- Linux
Add
gem 'stackify-ruby-apm'
to yourGemfile
.In the root folder of your Rails app create a file
config/stackify_apm.yml
and then add this configurationapplication_name: 'Ruby Application' environment_name: 'Production'
Build/Deploy your application
Custom Instrumentation in Rails
- Create
config/stackify.json
file from the root of your app and place the class name and method name in which you want to instrument.
Example stackify.json:
{
"instrumentation": [
{
"class": "<class name>",
"method": "<method name>",
"trackedFunctionName": "{{ClassName}}#{{MethodName}}",
"trackedFunction": <true or false>,
"transaction": <true or false>
}
]
}
In the config/initializer folder of your Rails app create a file
config/initializer/stackify.rb
and then add this configurationRails.configuration.to_prepare do StackifyRubyAPM.run_custom_instrument end
Non-Rails Guide
Install Stackify Linux Agent.
Check that your setup meets our system requirements.
- Ruby version 2.0+
- Frameworks
- Rack 1+
- Sinatra 1.4+
- Operating System
- Linux
Add
gem 'stackify-ruby-apm'
to yourGemfile
.In the root folder of your Rails app create a file
config/stackify_apm.yml
and then add this configurationapplication_name: 'Ruby Application' environment_name: 'Production'
In the
config.ru
add the following lines:use StackifyRubyAPM::Middleware StackifyRubyAPM.start at_exit { StackifyRubyAPM.stop }
Build/Deploy your application
Custom Instrumentation in Non-Rails
- Create
config/stackify.json
file from the root of your app and place the class name and method name in which you want to instrument.
Example stackify.json:
{
"instrumentation": [
{
"class": "<class name>",
"method": "<method name>",
"trackedFunctionName": "{{ClassName}}#{{MethodName}}",
"trackedFunction": <true or false>,
"transaction": <true or false>
}
]
}
- In
config.ru
file add this line: StackifyRubyAPM.run_custom_instrument
Example:
use StackifyRubyAPM::Middleware
StackifyRubyAPM.start
StackifyRubyAPM.run_custom_instrument
at_exit { StackifyRubyAPM.stop }