Skip to content

Commit

Permalink
Merge pull request #2192 from newrelic/fix-null-port-jfr-events
Browse files Browse the repository at this point in the history
Don't add null port to hostname attribute on JFR events
  • Loading branch information
jasonjkeller authored Jan 10, 2025
2 parents 13ad7f1 + a140bb6 commit a21d6e2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ private String getHostname() {
logger.error(e.getMessage());
host = InetAddress.getLoopbackAddress().getHostAddress();
}
return String.format("%s:%s", host, appPort);
if (appPort != null) {
return String.format("%s:%s", host, appPort);
} else {
return host;
}
}

@VisibleForTesting
Expand Down

0 comments on commit a21d6e2

Please sign in to comment.