Apm-agent service_name as macro/variable

Is it possible to use some kind of variable/macro for elastic.apm.service_name option?
I have java app running on many machines, one app per one machine. Leaving this option empty causes to show the same "Service Name" in Kibana APM - I'd like to have service_name as hostname. So something like that could be very helpful:

-Delastic.apm.service_name=$hostname

I could use single configuration for all apps then :slight_smile:

Hi,
as a workaround you can export ENV variable before starting your application:

export ELATIC_APM_SERVICE_NAME=`hostname`
echo $ELATIC_APM_SERVICE_NAME
1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.