# Elastic APM Java Agent : Agent Id

**URL:** <https://discuss.elastic.co/t/elastic-apm-java-agent-agent-id/321533>\
**Category:** APM\
**Tags:** java\
**Created:** [December 19, 2022, 8:53am UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-agent-id/321533 "2022-12-19T08:53:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [December 19, 2022, 8:53am UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-agent-id/321533/1 "2022-12-19T08:53:01Z")

</div>

Hi Team,

I was going through the metadata provided by Elastic APM and came across the key agent.ephemeral\_id.  
Can someone please help me understand its purpose and how does the value serve the purpose in observability.

I have a microservice based application in which all the microservices are using the same elastic APM jar with same service.name.  
I wanted to understand how does the jar uniquely identify the every service in this case.

Best Regards,  
Namita

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [December 20, 2022, 5:10pm UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-agent-id/321533/2 "2022-12-20T17:10:10Z")

</div>

Hi @Namita_Jaokar ,

I am not certain about the usage of this field in the UI, but I can tell you about what features it can be used for:

The `agent.ephemeral_id` is a random ID that is generated when the agent starts, it allows to distinguish multiple JVMs having the same `service.name` and `service.version`.

Trying to use the `process.pid` for the same usage would lead to issues as it it quite common to have `process.pid = 1` in containers for example.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 10, 2023, 1:10pm UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-agent-id/321533/3 "2023-01-10T13:10:25Z")

</div>

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