Set process names for process monitored by newrelic infra

The display name for the few java process is in newrelic- infra is coming as “java”.
Is there a way to change the display name for the process. And how is the diisaply name process is being set in new relic UI.

2 Likes

Hi @Swapna_P-BNG, Apologies for the late response.

You can try using the processDisplayName attribute documented here.

Let me know if that helps in any way.

@nmcnamara can we set this processDisplayName using through java args.

Hi @Swapna_P-BNG, so you will need to set a custom attribute for the process name, so I would suggest reading the documentation on custom attributes here.

It seems that setting processDisplayName as a custom attribute on the infrastructure agent just turns all processes into having that display name. Do you know what the docs mean by this?

Another source of the name may be a parsed component of the command line, if it is a known command line format (for example, Java app).

Hi @angelahsu, We extract the name of the process as described here - processDisplayName.

You can also filter your processes based on their command-line arguments.

There is an option you can enter in your Infrastructure agent’s /etc/newrelic-infra.yml configuration file that will make the agent report command-line arguments:

strip_command_line: false

Once you’ve added the above option, you’ll need to restart your agent and then you should shortly begin seeing those arguments for each process in the UI. It’s important to bear in mind that all arguments will be captured, which may include potentially sensitive information like credentials .

You can find the documentation on this here:

Let me know if that works for you.

@nmcnamara we are talking about java process for which we don’t have access to source code. Is there any way to specify a parameter in the command line and NewRelic will use that parameter for displaying? If possible give us an example.

What we have tried is:
java -Dnewrelic.config.app_name=“My App Name” MainClass -processDisplayName=“My App Name”

This is not making any difference and the process is still showing as “java” in NewRelic, whereas we wanted to see it as “My App Name”.

image