• EnglishEspañol日本語한국어Português
  • Log inStart now

Hostname logic in Java

The Java agent automatically assigns a host:port name to your JVMs. If the default name is not useful, you can set a display name to distinguish your JVMs in the New Relic UI. For supported frameworks, the Java agent uses the instance name instead of the display name.

The Java agent uniquely identifies running agents by their host, port, and dispatcher, regardless of the environment used.

Display names

If the default host:port label in the APM UI is not useful, you can decorate that name in the New Relic UI with a display name. Set the display name via configuration, either in an environment variable or in your newrelic.yml config file. The environment variable takes precedence over the config file value. After the JVM is restarted and the Java agent is reporting again , the display name will show in the JVM list as seen in the example below in addition to host:port.

To set a display name:

Restart your JVM to see your changes in the New Relic UI.

Tip

You can also set the display name with a system property.

Instance names

For WebSphere and WebLogic users, the Java agent also reports the instance name for each active app server instance, which is visible in the APM Settings > Environment page. Generally, this name is provided by the app server. If an instance name is set, it will be used instead of the display name in the New Relic UI.

Hostname logic precedence

If there are multiple hostname settings (for example, you use WebSphere and also set the display_name property), the agent uses this precedence:

  • display_name overrides the default name, and the WebSphere and WebLogic instance names.
  • WebSphere and WebLogic instance names override the default name.
  • The default (host:port) name has lowest precedence.

Hosts and unique agent identifiers

The Java agent uses hosts, ports, and dispatchers to uniquely identify multiple JVMs reporting to the same app name. Multiple agents running on the same server are therefore reported separately, as long as their ports or dispatcher names differ.

The unique identifier is based on the following values:

  • Host: An identifier for your app's parent server that is derived from the Operating System. This value is not configurable by the Java agent.
  • Port: The port associated with the app server. If the agent can't determine the port number, or your app is not running in an app server, defaults to 0. This value is user-configurable.
  • Dispatcher Name: The name of the app server. For example, Apache Tomcat, Glassfish, or WebLogic. If there is no active app server, defaults to Unknown.
Copyright © 2024 New Relic Inc.

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