Ruby APM with Docker
  • 1 Minute to read
  • Dark
    Light
  • PDF

Ruby APM with Docker

  • Dark
    Light
  • PDF

Article Summary

This document details how to install the Ruby APM Profiler in your Ruby application running on Docker or Docker Swarm.

Prerequisite

Follow the Retrace Docker Install Guide.

Ruby Docker Setup

Add Stackify Ruby APM GEM

Add the Stackify APM GEM to each application to monitor.
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 }

Running your Application

Start your application with the stackify shared volume.

docker run -v stackify:/usr/local/stackify [your-application-image]

Verify

Make application requests, you can then verify results in the Retrace dashboard.


Was this article helpful?