---
title: Use multiple names for an app
source: https://docs.newrelic.com/docs/apm/agents/manage-apm-agents/app-naming/use-multiple-names-app
---

When working with your APM data in New Relic, you may want to view aggregated, "rolled up" data for an application that spans multiple clusters, environments, or data centers, but also be able to view each of the app instance's data separately. You can do this by setting multiple app names for your APM-monitored apps.

## Before you start [#important-notes]

Here are some important caveats to be aware of when using multiple app names.

### Alternative solutions [#alt-options]

Because adding multiple app names results in [reporting duplicate data](#duplicate), you may want to consider these other options.

If your goal is to be able to more easily filter your telemetry data by attributes (for example, filter by agent region), we recommend one of these options instead:

-   Add [tags](https://docs.newrelic.com/docs/new-relic-solutions/new-relic-one/core-concepts/use-tags-help-organize-find-your-data) via the agent config file (for example, [this Java config](https://docs.newrelic.com/docs/apm/agents/java-agent/configuration/java-agent-configuration-config-file/#labels))
-   Add [custom attributes](https://docs.newrelic.com/docs/data-apis/custom-data/custom-events/collect-custom-attributes/#enabling-custom)

As another option for organizing your app data, you can set distinct performance thresholds for each environment using [alert conditions](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/learn-alerts/introduction-alerts) and [key transactions](https://docs.newrelic.com/docs/apm/transactions/key-transactions/create-update-key-transactions). These thresholds will apply to the individual apps, while the overall rolled-up app won't have its own thresholds. The overall app will treat incoming data according to the threshold for the relevant environment.

### Duplicate data [#duplicate]

Using multiple app names results in generating duplicate events and metrics, which is counted as ingested data. For example, if your New Relic-monitored app has three app names set, it will report three times the events and metrics.

If you do want to use multiple app names and not one of the alternate solutions below, you can use [drop data rules](https://docs.newrelic.com/docs/data-apis/manage-data/drop-data-using-nerdgraph) to drop some specific events you don't need.

### Priority of names [#priority]

The order of app names in the agent configuration matters. For more information, see [Define app names](#most-least-specific).

## How using multiple app names works [#rollup]

Normally, when two instances report with the same app name, agent language, and [license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#ingest-license-key), New Relic aggregates their data into a single New Relic-monitored app. You can also view data for the individual hosts and instances from the app's New Relic [APM **Overview** page](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/apm-overview-page#infra-server).

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](#agent) 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`.

## Roll up browser data [#browser-rollup]

When you use multiple names to report application data, any browser monitoring data from that application will also be grouped into multiple applications using the same configuration.

> #### ⚠️ IMPORTANT
>
> Session replay and trace data, which reports to the blobs endpoint, don't support several applications reporting. Only the primary app, or the first listed, will get the data. Other browser data will populate into each of the up to three applications.

## Define app names from most to least specific [#most-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](#example1)            | A shared rollup name to aggregate data in the New Relic UI. This provides more general organization.                          |
| Optional, [least specific](#example2) | 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 [#agent]

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**                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| C         | Identify a maximum of three names separated by a semicolon `;` in your [newrelic_app_config_t\* config;](https://docs.newrelic.com/docs/agents/c-sdk/install-configure/install-c-sdk-compile-link-your-code#app-name).                                                                                                                                                                                                                         |
| Go        | Set [`AppName`](https://docs.newrelic.com/docs/agents/go-agent/instrumentation/go-agent-configuration#app-name) to a maximum of three names separated by a semicolon.                                                                                                                                                                                                                                                                          |
| Java      | Set [`app_name`](https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-configuration-config-file#cfg-app_name) to a maximum of three names separated by a semicolon.                                                                                                                                                                                                                                                       |
| .NET      | Use any of the available options to [name your .NET app](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/name-your-net-application).                                                                                                                                                                                                                                                                                |
| Node.js   | Set [`app_name`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#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`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/configuring-nodejs-environment-variables#app_name).) |
| PHP       | Use any of the available options to [name your PHP application](https://docs.newrelic.com/docs/agents/php-agent/configuration/name-your-php-application). Use three names separated by a semicolon.                                                                                                                                                                                                                                            |
| Python    | Set [`app_name`](https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration#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`](https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration#app_name) to a maximum of three names separated by a semicolon.                                                                                                                                                                                                                                                          |

For more information, refer to the [configuration file documentation](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/configure-agent) 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.

Cluster 1:

````yml
app_name: SurveyCluster1;Survey Data
```

Cluster 2:

```yml
app_name: SurveyCluster2;Survey Data
```

Cluster 3:

```yml
app_name: SurveyCluster3;Survey Data
```

This will report four applications in APM:

* The app name for aggregate data from all three clusters is `Survey Data`.
* Three individual applications named `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.

Cluster A:

````ini
newrelic.appname="EcomClusterA;EcomEast;EcomAll"
```

Cluster B:

```ini
newrelic.appname="EcomClusterB;EcomEast;EcomAll"
```

Cluster C:

```ini
newrelic.appname="EcomClusterC;EcomWest;EcomAll"
```

Cluster D:

```ini
newrelic.appname="EcomClusterD;EcomWest;EcomAll"
```

This example configuration will report seven applications in the APM UI:

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

````
