• /
  • EnglishEspañol日本語한국어Português
  • EntrarComeçar agora

Name your .NET application

New Relic's .NET agent gives you several ways to change the application name reported and displayed in APM. This document gives you an overview of those naming options.

For a general overview of APM app naming (not .NET-specific), see Name your application. To change an application's name without breaking data continuity, use the UI alias-change option.

Set your app name (recommended method)

When you first deploy your app, you can change the default name to a more descriptive one. Since New Relic collects metrics using these names, customizing them allows you to run the same application on multiple hosts and get metrics from all their instances.

Typically, configuring your app-local newrelic.config file is the most convenient naming method.

Naming method

Description

Recommended:

Configure your app-local newrelic.config file

This method lets you give your app a unique name with specific configuration settings. It also works for both IIS and non-IIS hosted apps.

  1. Copy the newrelic.config file from the agent home directory into your app's root folder.

    Default: %ALLUSERSPROFILE%\New Relic\.NET Agent

  2. Open the copy and set your app name as follows:

    <application>
    <name>App Name</name>
    </application>
  3. Restart your application.

As long as your app is active, data should appear within a few minutes. If not, follow our troubleshooting procedures.

Other methods

If you have a specific use or purpose in mind, you may prefer a different naming method. Here's a full list of the alternative methods:

Importante

Some methods take precedence over others. Before choosing a naming method, make sure you understand how your configurations may be affected.

Naming method

Description

Configure your web.config file

If you have apps hosted on IIS and prefer not to have a local newrelic.config file, you can configure the naming settings in your web.config file.

Set app name using environment variables

If you want to easily set app names during the deployment of containers, set an environment variable in the application's environment.

Name after app pools

If your IIS application pools already have unique names you like, or if you're using a shared network content infrastructure (SNCI), you can name your app after its assigned app pool.

Configure your app.config file

If you have applications not hosted on IIS and prefer not to have a local newrelic.config file, you can configure the naming settings in your app.config file.

Use the .NET agent API

If you want to rename your app programmatically, you can use the SetApplicationName() agent API call to set the app name at run time. This name will take priority over all other application naming sources.

As long as your app is active, data should appear within a few minutes. If not, make sure you've performed an IISRESET from an administrative command prompt if you've changed your .NET app's configuration file (newrelic.config or app.config). Otherwise, follow our troubleshooting procedures.

Use multiple app names

You can use multiple app names to aggregate data from your applications. We sometimes call this "rolling up" your data.

For the .NET agent, you can set up to three application names. The first name is the primary application name, and the second and third names are used for the more general data aggregation categories. For more about how multiple app names work, see Use multiple app names.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.