APM best practices guide

Application Monitoring Tips You Need To Know

It's one thing to know how to use APM, but it's another thing to know how to use New Relic's application performance monitoring software well. Here are some best practices designed to help you become an APM master—and a key asset to your team!

To get a high-level overview of all your applications and services, use the entity explorer in New Relic One.

1. Standardize application names

Most New Relic agents provide a default application name, such as "My Application" or "PHP Application," if you don't specify one in your New Relic configuration file. You don't want to end up with 20 identically named applications, be sure to select a descriptive identifier for your apps as soon you deploy them.

To keep things consistent and easy to navigate, New Relic recommends standardizing your application naming (for example, all apps in Staging append [Staging] or the like at the end of their names). Ideally, you want your new Java applications to be named automatically to reduce the chances of typographical errors and misnaming.

How to do it

For Java applications, automatic application naming can come from the following sources:

  • Request attribute
  • Servlet init parameter
  • Filter init parameter
  • Web app context parameter
  • Web app context name (display name)
  • Web app context path

Choose the method that fits best your needs and follow these steps.

For non-Java applications, there are no automatic naming methods, so refer to the documentation for your APM agent.

2. Add tags to your applications

When several different applications use the same account, and each application spans multiple environments (for example, development, test, pre-production, production), it can be hard to find a specific application in your overview dashboard. That's why we recommend adding tags to your apps so that you can segment them into logical groups.

The two most common tags that mature APM customers use are application name and environment. So, for example, if you wanted to view the billing application in Test, you could simply filter by "billing app" (name label) and "test" (environment label).

APM is designed so that apps can roll up into an unlimited number of meaningful categories.

How to do it

  1. Read the overview: Use tags to organize and group what you monitor.
  2. Follow these instructions for creating tags: NerdGraph tagging API tutorial.

3. Create and evaluate alert policies

When key performance indicators spike or drop, individuals and teams in your organization need to be notified. Alerting in New Relic provides a set of tools including dynamic baselines that allow you to detect problems before they impact your end users.

Alert policies can be set up in two primary ways:

  • Static threshold alerts are great when you already know the nature of an application and its normal behaviors aren't likely to change anytime soon. Apdex score, response time, error rate, throughput are some of the static thresholds you can create alert policies on.
  • Dynamic baseline alerts make it easy to determine and set dynamic alert thresholds for applications with varying seasonal patterns and growth trends (which make it difficult to set thresholds that define normal behavior). These alerts use baselines modeled from your application’s historical metric data.

Each alert policy can contain as many conditions as you need, and each alert condition includes three components:

  • Type of condition (metric, external service, and so on)
  • Entities that the policy targets (for example, apps monitored by New Relic APM or New Relic Browser, hosts monitored by New Relic Infrastructure, and so on)
  • Thresholds that escalate into alerting situations with increasing severity

Once you have your alerting set up, you then want to make sure you're taking advantage of all viable notification channels. After all, what good are alerts if no one knows about them?

You can manage alerts by creating specific user groups and by leveraging New Relic's integrated alert channels, including Slack, PagerDuty, webhooks, and email. Be sure to evaluate alert policies on a regular basis to ensure that they are always valid.

How to do it

See the detailed documentation:

  • To set up dynamic baseline alerts and choose an application, follow standard procedures. You will see a preview of the metric with the predicted baseline You can select a metric for that application and see the corresponding baseline. Then, using the threshold sliders, you can set how closely you want your threshold to follow the baseline prediction.
  • To set up static threshold alerts for your Apdex settings, follow standard procedures.
  • To set up your alert notification channels, follow standard procedures.

4. Identify and set up key transactions

Depending on the nature of your application, some transactions may be more important to you than others. New Relic's key transactions feature is designed to help you closely monitor what you consider to be your app's most business-critical transactions, whether that's end-user or app response time, call counts, error rates, or something else. You can also set alert threshold levels for notifications when your key transactions are performing poorly.

How to do it

  1. In the menu bar, select More > Key transactions, and then select Add more. Then select the app and web transaction or, from the selected transaction, select Track as key transaction.
  2. Type a name for the key transaction, and select Track key transaction.
  3. Optional: If the agent for the selected app supports custom alerting, use the default values that New Relic automatically fills, or select Edit key alert transaction policy to set the Apdex and alert threshold values.
  4. To view the key transactions dashboard details, select View new key transaction.

5. Track deployment history

When development teams are pushing new code out as frequently as possible, it can be hard to measure the impact that each deployment is having on performance. One way to stay in tune with how these changes are affecting your application is with deployment reports.

These reports list recent deployments and their impact on end-users and app servers' Apdex scores, along with response times, throughput, and errors. You can also view and drill down into the details to catch errors related to recent deployments, or file a ticket and share details with your team.

How to do it

  1. From the New Relic menu bar, select APM > (selected app) > Events > Deployments.
  2. To view performance after a deployment, go to the selected app's Overview dashboard in the Recent events section.

A blue vertical bar on a chart indicates a deployment. To view summary information about the deployment, point to the blue bar.

6. Review APM reports

From SLA, deployment, and capacity to scalability, host usage reports, and more, New Relic APM offers a variety of downloadable reporting tools surfacing historical trends—all great ways to report to senior executive teams or customers. Take a look at the full list of reports and use them to your advantage.

How to do it

  1. From the New Relic APM menu bar, select Applications > (selected app) > Reports.
  2. Select the report you'd like to see.
  3. If you want to save or export a report to share, select Download this report as .csv, which will create a report with comma-separated values.

7. Review your environment with service maps

Use New Relic service maps, a feature included in APM, to understand how apps and services in your architecture connect and talk to each other. Service maps are visual, customizable representations of your application architecture. Maps automatically show you your app's connections and dependencies, including databases and external services. Health indicators and performance metrics show you the current operational status for every part of your architecture.

How to do it

  1. Go to one.newrelic.com > More > service maps.
  2. To get started, read the instructions in Introduction to service maps.

8. Keep current

With New Relic’s SaaS platform, getting new features is as easy as updating your agent. Most likely your organization already has a set of scripts for deploying application upgrades into your environment. In a similar fashion, you can also automate your New Relic agent deployment to ensure that your systems are up to date. Both Puppet and Chef scripts are great examples of deployment frameworks that make life easier by allowing you to automate your entire deployment and management process.

How to do it

Regularly review which version of the agent you're using so that you know when an update is needed. If the latest agent release contains a needed fix or added functionality, download it.

To deploy the agent automatically (preferred as a method to avoid errors):

  1. Use existing deployment scripts, provided they can be adapted to handle the deployment.

    OR

    Create and maintain a script that specifically deploys and configures the New Relic agent. Ideally, the script would pull the agent files from a repository where the files are versioned (for rollback purposes).

  2. Once the script has been created, shut down the application (unless script handles this).
  3. Run the deployment script.
  4. Start the application (unless script handles this).
  5. If problems arise, run the script to roll back to the previous version.

To deploy the agent manually:

  1. Back up the current agent directory.
  2. Deploy the updated agent into the existing agent directory.
  3. Modify configuration files by comparing new files with existing files. In particular, make sure things like license key and custom extensions are copied over to the new configuration.
  4. Restart the application.
  5. If problems arise, restore the old agent using the backup and restart.

9. Manage user access

This is available only for accounts on our original product-based pricing plan.

Enable role-based access control (RBAC) and single sign-on (SSO)

New Relic allows authorized individuals to access the broadest possible amount of data, regardless of their assigned role. As an Owner or Administrator of your New Relic account, you can control the permissions of individual users or entire roles with RBAC. To find out what is possible and how to make changes, see Users and roles.

Security is no doubt of utmost concern to your organization. To simplify password management for your employees and strengthen security, you may already be using SSO with your other systems. You should do the same with New Relic.

Using New Relic's SSO integration feature, account administrators will be able to enforce strong passwords and restrict login via a corporate authentication mechanism. This way, New Relic users who have already authenticated using a corporate SSO system will be able to bypass the New Relic login prompt.

How to do it

  1. Log in to New Relic as an admin and go to the SSO configuration page. From the New Relic title bar, select (your account name) > Account Settings > Integrations > Single Sign On.
  2. From the SAML Single Sign On page, review your New Relic SAML Service Provider details.
  3. To upload your SAML Identity Provider certificate, select Choose File, and then follow standard procedures to select and save the file.
  4. Copy and paste in (or type) the Remove login URL that your users will use for Single Sign-On.
  5. If your organization’s SAML integration provides a redirect URL for logout, copy and paste in (or type) the Logout landing URL; otherwise leave blank.
  6. Save, test, and enable.

For more help

If you need more help, check out these support and learning resources: