Use multiple names for an app

When working with your data in New Relic, you may want to view aggregated data for an application across clusters, environments, or data centers, while at the same time be able to view each of your application instance's data individually.

If you use multiple names for an app, the last name assigned is the least specific name New Relic uses to roll up the data. For best results to view both instance-level and aggregated data, set the order of your app's rollup names from most specific to least specific in your configuration file.

Roll up app data

Normally, when two instances report with the same app name, agent language, and license key, New Relic aggregates their data into a single app within the New Relic user interface. You can also view data for the individual hosts and instances from the app's New Relic APM Overview page.

To segment your app in a different way, or to work with each instance as an individual app while maintaining the overall view of the data, use your New Relic agent's config file to give an app up to three different rollup names. New Relic will then report the app's data separately to each app listed in the config file.

For example, you might want to separate the data collected for your app running in development, staging, and production environments, but also have a common view of the app in every environment. Or, if you have two data centers running the same code, you could name one app EastCoastApp;AggregateApp and the second app WestCoastApp;AggregateApp.

Define app names from most to least specific

You can give each app up to three names, which New Relic uses to aggregate data from most to least specific. You can then use the New Relic UI to view data for each app name individually, as well as in aggregate for overall application performance. When doing so, the order in which you specify the app names is important.

Using multiple names Comments
Most specific A unique rollup name.
Less specific

A shared rollup name to aggregate data in the New Relic UI. This provides more general organization.

Optional, least specific An additional, shared rollup name. If used, this is the most general name New Relic uses to aggregate data into a single app.

Name app instances via agent config file

The naming convention you use in your configuration file depends on your New Relic agent. Set the order of your app's names so that the first rollup name is the most unique.

The second and third names can be unique, or they can be the same. The second name is more general for aggregate data, and the third name (if used) is the most general.

Agent Configuration file value
Go Set AppName to a maximum of three names separated by a semicolon.
Java Set app_name to a maximum of three names separated by a semicolon.
.NET Use any of the available options to name your .NET app.
Node.js Set app_name to a maximum of three names separated by a comma. Enclose the string of names with single or double quotes. (Or, change the environment variable NEW_RELIC_APP_NAME.)
PHP Set newrelic.appname to a maximum of three names separated by a semicolon.
Python Set app_name to a maximum of three names separated by a semicolon. Do not add a space after the semicolon, or the next name will be interpreted as a comment.
Ruby Set app_name to a maximum of three names separated by a semicolon.

For more information, refer to the configuration file documentation for your agent.

Examples

Here are examples of how you could use multiple rollup names for a single app.

One app, three clusters

A Java app collecting survey data runs on three clusters. Change the value for the app name in your agent config file by giving it three different names, one for each cluster:

    app_name: SurveyCluster1;Survey Data
    app_name: SurveyCluster2;Survey Data
    app_name: SurveyCluster3;Survey Data

This will create four apps in the New Relic UI:

  • The app name for aggregate data for all three clusters is Survey Data.
  • The individual results for the associated cluster are SurveyCluster1, SurveyCluster2, and SurveyCluster3.
Two instances of one app

A PHP agent is monitoring an e-commerce application running on two clusters in each of two data centers, and you want to view data for each subgroup as well as the overall aggregated data.

    newrelic.appname="EcomClusterA;EcomEast;EcomAll"
    newrelic.appname="EcomClusterB;EcomEast;EcomAll"
    newrelic.appname="EcomClusterC;EcomWest;EcomAll" 
    newrelic.appname="EcomClusterD;EcomWest;EcomAll" 

This will create seven applications in the New Relic UI, including:

  • Four apps: One for each of the four clusters (A B C D)
  • Two apps: One for each datacenter (East and West)
  • One app for the overall data across clusters and data centers (EcomAll)

Other options to organize your apps

If you do not want to apply multiple names to your apps, you can organize them with labels and categories. This allows you to easily sort, filter, and page through them from their product index pages in the New Relic UI.

You can also set distinct performance thresholds for each environment with alert conditions and key transactions. These thresholds will apply to the individual apps, while the overall app will not have its own thresholds. The overall app will treat incoming data according to the threshold for the relevant enviroment.

For more help

Additional documentation resources include:

  • Rename applications (how to change your app's label in the UI or change your config file's unique identifier that the data collector uses to distinguish one app from another)
  • Name your application (how to give your app a specific name and why it is important)
  • Rename Browser apps (how to rename an existing Browser app via UI settings, copy/paste JavaScript, or REST API)

Join the discussion about New Relic APM in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

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