New Relic

New Relic could be considered the granddaddy of SaaS monitoring tools, chances are that if you are a developer you will have heard of New Relic. It has been around for a while and it is the standard to which other SaaS tools compare themselves.

New Relic has grown into several products over the year, currently, they offer:

  • New Relic APM: The main application performance-monitoring tool. This is what most people will know New Relic for; this toll gives you the code level visibility of your application.
  • New Relic Mobile: A set of libraries to embed into your native mobile apps, giving APM levels of detail for your iOS and android application.
  • New Relic Insights: A high-level view of all of the metrics collected by other New Relic services.
  • New Relic Servers: Monitors your host servers, recording metrics around CPU, RAM, and storage utilization.
  • New Relic Browser: Gives you an insight into what happens with your web-based applications once they leave your servers and enter your end user's browser
  • New Relic Synthetics: Monitors your applications responsiveness from various locations around the world.

Rather than looking at all of these offerings that give us an insight into what is happening with our Docker-based code, as that's probably a whole module on its own, we are going to take a look at the server product.

The server monitoring service offered by New Relic is available free of charge, you just need an active New Relic account, you can sign up for an account at https://newrelic.com/signup/ details on New Relics pricing can be found at their homepage at http://newrelic.com/.

Installing the agent

Like the other SaaS offerings we have looked at in this chapter, New Relic Servers has a host-based client, which needs to be able to access the Docker binary. To install this on a CentOS machine, run the following:

yum install http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm
yum install newrelic-sysmond

For Ubuntu, run the following command:

echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list
wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
apt-get update
apt-get install newrelic-sysmond

Now that you have the agent installed, you need to configure the agent with your license key. You can do this with the following command and make sure that you add your license, which can be found in your settings page:

nrsysmond-config --set license_key= wn5AYlhjRhgn3shcjW14y3yOT09WsF7d

Now that the agent is configured, we need to add the newrelic user to the docker group so that the agent has access to our container information:

usermod -a -G docker newrelic

Finally, we need to start the New Relic Server agent and restart Docker:

/etc/init.d/newrelic-sysmond restart
/etc/init.d/docker restart

Tip

Restarting Docker will stop the running containers that you have; make sure that you make a note of these using docker ps and then start them manually and back up once the Docker service restarts.

You should see your server appear on your New Relic control panel after a few minutes.

Installing the agent

Exploring the web interface

Once you have the New Relic server agent installed, configured, and running on your host machine, you will see something similar to the following screenshot when clicking on Servers in the top menu:

Exploring the web interface

Selecting the server will allow you to start exploring the various metrics that the agent is recording:

Exploring the web interface

From here, you have the option to drill down further:

  • Overview: Gives a quick overview of your host machine
  • Processes: Lists all of the processes that are running both on the host machine and within your containers
  • Network: Lets you see the network activity for your host machine
  • Disks: Gives you details on how much space you are using
  • Docker: Shows you the CPU and memory utilization for your containers

As you may have guessed, we are going to be looking at the Docker item next, click on it and you will see a list of your active images:

Exploring the web interface
Exploring the web interface

You may have noticed a difference between New Relic and the other services, as you can see New Relic does not show you the running containers, instead it shows you the utilization by Docker image.

In the preceding screenshot, I have four containers active and running the WordPress installation we have used elsewhere in the module. If I wanted a breakdown per container, then I would be out of luck, as demonstrated by the following screen:

Exploring the web interface

It's a pretty dull screen, but it gives you an idea about what you will see if you are running multiple containers that have been launched using the same image. So how is this useful? Well, coupled with the other services offered by New Relic, it can give you an indication of what your containers were up to when a problem occurred within your application. If you remember the Pets versus Cattle versus Chickens analogy from Chapter 1, Introduction to Docker Monitoring, we don't necessarily care which container did what; we just want to see the impact it had during the issue we are looking into.

Summary and further reading

Due to the amount of products it offers, New Relic can be a little daunting at first, but if you work with a development team that actively uses New Relic within their day-to-day workflow, then having all of the information about your infrastructure alongside this data can be both valuable and necessary, especially during an issue:

Tip

If you have launched a cloud instance and are no longer using it then, now is a good time to power the instance down or terminate it altogether, this will ensure you do not get billed for any services you are not using.

Summary and further reading
Summary and further reading
Summary and further reading
Summary and further reading
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset