---
title: "Ruby APM with AWS ECS"
slug: "ruby-apm-with-aws-ecs"
description: "Learn how to install Ruby APM Profiler on AWS Elastic Container Service (ECS). Follow our guide for setup and configuration. Verify results on Retrace dashboard."
updated: 2020-06-18T20:38:06Z
published: 2020-06-18T20:38:06Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ruby APM with AWS ECS

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](/docs/aws-elastic-container-service-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](/docs/aws-elastic-container-service-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.
