- 1 Minute to read
- Print
- DarkLight
- PDF
Ruby APM with AWS ECS
- 1 Minute to read
- Print
- DarkLight
- PDF
This document details how to install the Ruby APM Profiler in your Ruby application running on AWS Elastic Container Service (ECS).
Prerequisite
Follow the Retrace AWS ECS Guide.
Ruby Application Setup
Add Stackify APM Module
Modify application Gemfile
:
gem 'stackify-ruby-apm'
Configure Application
Add config/stackify_apm.yml
to your application, modify application_name and environment_name.
application_name: 'Ruby Application'
environment_name: 'Production'
Rails
Profiler will startup automatically, no additional configuration.
Non-Rails
Include StackifyRubyAPM::Middleware when starting your application:
# config.ru
require 'stackify-ruby-apm'
use StackifyRubyAPM::Middleware
StackifyRubyAPM.start
# application startup
at_exit { StackifyRubyAPM.stop }
Task Configuration
Application containers are required to have the stackify volume mount configured in the Retrace AWS ECS Guide.
Add the stackify volume to the task definition:
{
"volumes": [
{
"name": "stackify",
"host": {
"sourcePath": "/var/stackify"
}
}
]
}
Add stackify mount points to the container definition:
{
"containerDefinitions": [
{
"mountPoints": [
{
"readOnly": false,
"containerPath": "/usr/local/stackify",
"sourceVolume": "stackify"
}
]
}
]
}
Verify
Start up your Ruby application task and make requests. You can then verify results in the Retrace dashboard.