- 1 Minute to read
- Print
- DarkLight
- PDF
Ruby APM with AWS Fargate
- 1 Minute to read
- Print
- DarkLight
- PDF
This document details how to install the Ruby APM Profiler in your Ruby application running on AWS Fargate.
Stackify supports AWS Fargate by adding our Retrace Container to your AWS Fargate tasks.
The configuration is in two parts; adjusting your Dockerfile config to include the appropriate Stackify profiler and then adjusting task/container definition configuration in AWS Fargate. The configuration details are provided below in JSON samples.
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
- Add the stackify volume to the task definition:
{
"volumes": [
{
"name": "stackify"
}
]
}
- Add the stackify-retrace container to the task definition:
{
"containerDefinitions": [
{
"name": "stackify-retrace",
"image": "stackify/retrace:latest",
"memoryReservation": "512",
"essential": true,
"environment": [
{
"name": "STACKIFY_KEY",
"value": "[YOUR_ACTIVATION_KEY]"
},
{
"name": "STACKIFY_ENV",
"value": "[YOUR_ENVIRONMENT_NAME]"
},
{
"name": "STACKIFY_DEVICE_ALIAS",
"value": "AWS Fargate"
}
],
"mountPoints": [
{
"sourceVolume": "stackify",
"containerPath": "/var/stackify"
}
]
}
]
}
Note: Replace [YOUR_ACTIVATION_KEY]
and [YOUR_ENVIRONMENT_NAME]
.
Use Image stackify/retrace-arm64
if running on an ARM processor.
- Add stackify mount points to your application container definition:
{
"containerDefinitions": [
{
"mountPoints": [
{
"sourceVolume": "stackify",
"containerPath": "/usr/local/stackify"
}
]
}
]
}
Verify
Start up your Ruby application task and make requests. You can then verify results in the Retrace dashboard.