Identify Java Spring boot services by its application name

Hi Team,

Below are the version details for the Elastic APM agent configuration. I have a microservice based java application and the java agent jar is attached to all the java services (.jar) under same agent name.

I need to identify the service name (or Spring boot application name property) for all the services.

As per my understanding currently the metadata provides only ephimeral id field to uniquely identify the jvm instance which is different for different services.

Is there any way i can get the application name for each java service. Any changes in the java agent code that can help me identify every service by its application name.

Kibana version: 8.4

Elasticsearch version: 8.4

APM Server version: 8.4

APM Agent language and version: Java Language with Elastic APM Agent v1.53

Best Regards,
Namita

Are you setting the agent name via the service_name config option

Hi @Jack_Shirazi , Yes setting service_name in the elastic apm properties file

So if you've set them all to the same name, that takes precedence and that's what you'll see. How about leaving that unset and letting the agent infer the name? Does that help?

haven't tried removing the service_name property . Will check on this part to see how it goes.

Is there any other approach for this at agent code level?

Best Regards,
Namita

Generally the auto-detected service name is useful enough, or the deployment environment can explicitly set a service name per service using environment variables and deployment configuration. The only other mechanism I can think of would be to use an ingest pipeline to transform the name based on some other metadata