Host links missing in Java app's APM Summary


Changing your hostname settings, particularly the FQDN settings, may disable your server's network access. Test any changes thoroughly before deploying them to a production environment.

You cannot view links to your Linux hosts from your Java app's APM Summary page.


Configure the hostname settings so that your Linux agent in Infrastructure will return the exact same name string as the New Relic Java agent. Recommendation: Edit the fully qualified domain name (FQDN) settings. The agents read their hostname from the operating system's FQDN settings, so setting the hostname there will ensure that both agents share a single hostname.

The New Relic user interface uses the hostname to link an app to its host server. Changing the hostname will cause a different name to be reported for the app server than what is reported by any monitored apps. If the app link is currently working, changing the hostname may break the host-server links.

Example: Edit your FQDN settings

This example configures the server to use the following FQDN values:

  • IP address:
  • FQDN:
  • Short hostname: myhost

Most Linux distributions store hostname settings in two files, typically:

  • /etc/hosts
  • /etc/sysconfig/network (This path may not exist in your Linux distribution.)

To configure the hostname you want to be in effect the next time the host or server starts up:

  1. Append the IP address, FQDN, and short hostname to the existing data in /etc/hosts; for example: localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 myhost
  2. If /etc/sysconfig/network is present, append the FQDN to the existing data in /etc/sysconfig/network. For example:

  3. Use the command line to set the current hostname, so the changes take effect without restarting the server:

    sudo hostname
  4. Restart the Java agent and Infrastructure agent to register the new hostname.
Example: Script hostname settings on AWS Elastic Beanstalk

You can also configure the hostname to be an FQDN at startup by using a shell script. In this example, cloud-init passes a shell script to the Amazon Machine Image (AMI) at startup, using the variable UserData. A cloud-init script runs before the Java agent and the Infrastructure agent start, so the agents inherit the hostname settings from the cloud-init script.

This example script configures all hostname settings. Depending on your Linux distribution, the echo command to /etc/sysconfig/network may not be required.


# Set the hostname so the Infrastructure
# and Java agent see the same names.

SHORT_HOSTNAME=`hostname -s`
IP=`hostname -I`

hostname "${HOSTNAME}"
echo "${IP} ${HOSTNAME}" >> /etc/hosts
echo "HOSTNAME=${HOSTNAME}" >> /etc/sysconfig/network


New Relic links the app and the host or server together by string-matching the hostnames reported by the Java agent and the Linux agent for Infrastructure. If these two hostname strings are not identical, New Relic cannot connect the app and server in the APM Summary page.

There are several reasons this might occur. For example:

  • The JVM may be reporting the IP address and not the hostname.
  • The JVM may report an IPv6 address, while the Linux agent reports an IPv4 address.

For more help

If you need more help, check out these support and learning resources: