---
title: "Node.js APM with AWS ECS"
slug: "nodejs-apm-with-aws-ecs"
updated: 2020-02-27T22:24:08Z
published: 2020-02-27T22:24:08Z
---

> ## 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.

# Node.js APM with AWS ECS

This document details how to install the **Node.js APM Profiler** in your **Node.js** application running on **AWS Elastic Container Service (ECS)**.

## Prerequisite

Follow the [Retrace AWS ECS](/docs/aws-elastic-container-service-ecs) Guide.

## Node.js Application Setup

#### Add Stackify APM Module

Add the Stackify APM module to each application to monitor.

```
npm install stackify-node-apm --save
```

#### Configure Application

Copy `node_modules/stackify-node-apm/stackify.js` into your application's root directory and modify **Application Name** and **Environment Name**.

#### Initialize Profiler

Add `require('stackify-node-apm')` to the top of your application's main module.

#### 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 Node.js application task and make requests. You can then verify results in the Retrace dashboard.
