Enabling New Relic Servers for Docker

For the latest, most advanced host monitoring (including Docker), check out Infrastructure.

New Relic Servers for Linux includes integrated Docker monitoring features. Use this document to install and configure Servers for Linux specifically to monitor servers with Docker containers.

Installing Docker with Servers for Linux

Docker monitoring requires New Relic Servers for Linux version 2.1.0 or higher, and is only available for 64-bit systems. To enable Docker monitoring:

  1. Install and configure Docker.
  2. Install New Relic Servers for Linux on your Docker server, NOT on your Docker container.
  3. If a docker group doesn't already exist, create a new group named docker:

    groupadd -r docker
  4. Add the newrelic user to the docker group with a command similar to:

    usermod -a -G docker newrelic
  5. Restart Docker.
  6. Restart the New Relic Servers for Linux agent.

Wait a few minutes, then view your Docker metrics in the Virtualization page.

Specifying the container file location

Most installations require no additional configuration. However, some older Linux distributions store their Docker container data files in non-standard locations:

CGroup Root

If your distribution stores its CGroup files in a non-default location, you can specify the location in nrsysmond.cfg. Add the following command to nrsysmond.cfg, customizing the root directory for your system if necessary:

cgroup_root="/sys/fs/cgroup"
Path to the Stat files

By default, the CPU and Memory stats collected per container are recorded from:

/sys/fs/cgroup/cpu/system.slice/docker-{container_id}/cpu.stat
/sys/fs/cgroup/memory/system.slice/docker-{container_id}/memory.stat

However, some Linux distributions customize this path. In that case, the most common location for these stats to be stored is:

/sys/fs/cgroup/memory/docker/{container_id}/memory.stat
/sys/fs/cgroup/cpu/docker/{container_id}/cpu.stat

To use this path instead, add the following command to nrsysmond.cfg and restart the Server Monitor to apply the change:

cgroup_style=0

Enable memory usage metrics

On some Linux distributions, memory metric collection is disabled by default. To capture memory metrics with New Relic Servers, enable memory metric collection by adding kernel command-line parameters. For more information, see the Docker runtime metrics documentation.

For more help

Additional documentation resources include:

Discuss New Relic Servers in the New Relic Online Technical Community! Troubleshoot and ask questions, or discuss Servers for Linux or Servers for Windows in detail.

If you need additional help, get support at support.newrelic.com.