How to configure multiple Java web applications in New Relic

21 September 2013
By Gonçalo Marques
In this tutorial we will see how to configure multiple Java web applications in New Relic


When we configure the New Relic agent to monitor our Java based application server it will by default aggregate all deployed web applications in a single application and show the corresponding aggregated performance indicators in New Relic's web console.

In this tutorial we will see how to configure multiple Java web applications to be listed individually in New Relic's console. We will assume that you have already deployed New Relic agent in your application server.

Used software:

  1. New Relic agent 2.21.3

New Relic settings file

The first step consists in changing enable_auto_app_naming parameter in the configuration file: newrelic.yml

enable_auto_app_naming: true

Change the parameter value to true. Now we are ready to configure our web applications to be listed distinctly.

Configuring application names

Now that we have configured New Relic to show applications separately we just have to define the name than each one will have in the web console.

By default New Relic will use display-name value defined in web.xml:

display-name value


We may also define it by the means of a context parameter:

Context parameter


If we need more fine-grained configuration we may define it individually by servlet:

By servlet


Or even by filter:

By filter


We may also define it programmatically:

Programmatic New Relic application name definition

protected void doGet(HttpServletRequest request,
   HttpServletResponse response)
     throws ServletException, IOException {

  } else {


Related Articles


About the author
Gonçalo Marques is a Software Engineer with several years of experience in software development and architecture definition. During this period his main focus was delivering software solutions in banking, telecommunications and governmental areas. He created the Bytes Lounge website with one ultimate goal: share his knowledge with the software development community. His main area of expertise is Java and open source.

GitHub profile:

He is also the author of the WiFi File Browser Android application: