# Elastic: How to enable autodetect on metadata like container id in Elastic APM Agent/APM Server?

**URL:** <https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257>\
**Category:** APM\
**Tags:** java\
**Created:** [April 9, 2020, 7:14am UTC](https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257 "2020-04-09T07:14:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [April 9, 2020, 7:14am UTC](https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257/1 "2020-04-09T07:14:05Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** : 7.6.0

**Elasticsearch version** : 7.6.0

**APM Server version** : 7.6.0

**APM Agent language and version** : 1.2.0

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

I have set up an elastic stack with elasticsearch, filebeat, kibana and apm server, and an spring-boot-application with the apm java agent and started my setup in a docker compose file. I have enabled the dashboard and I can see traces about processes in the application. But I cannot filter for container id, because there is no id. How do I enable my stack apm server/apm agent to receive the metadata about container id, pod id and so on.

Where can I enable metadata for apm server / apm agent to receive the container id for instance.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [April 9, 2020, 7:46am UTC](https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257/2 "2020-04-09T07:46:59Z")

</div>

This should be as easy as updating your Java agent.  
Docker and k8s metadata has been introduced in version 1.3.0: [https://www.elastic.co/guide/en/apm/agent/java/current/release-notes-1.x.html#release-notes-1.3.0](https://www.elastic.co/guide/en/apm/agent/java/current/release-notes-1.x.html#release-notes-1.3.0)

---

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [April 20, 2020, 8:10am UTC](https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257/3 "2020-04-20T08:10:12Z")

</div>

This was a quick fix. Thanks a lot

---

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [April 20, 2020, 8:14am UTC](https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257/4 "2020-04-20T08:14:24Z")

</div>

@felixbarny  
One more question: I receive the container id but the pod is still missing. What settings do I need to adjust to get the information about pods?

Right now I setup this [https://www.elastic.co/de/blog/using-elastic-apm-java-agent-on-kubernetes-k8s](https://www.elastic.co/de/blog/using-elastic-apm-java-agent-on-kubernetes-k8s) blogpost. And its working properly for APM Server in general and the container id specificly. If I chose the petclinic service I've got no information about pods. Can I even expect to see pods in this setup?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [April 20, 2020, 12:47pm UTC](https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257/5 "2020-04-20T12:47:04Z")

</div>

See this docs page on how to set the k8s metadata: [https://www.elastic.co/guide/en/apm/server/master/metadata-api.html#kubernetes-data](https://www.elastic.co/guide/en/apm/server/master/metadata-api.html#kubernetes-data)

---

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [April 23, 2020, 7:04am UTC](https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257/6 "2020-04-23T07:04:41Z")

</div>

Worked like a charm! Thanks a lot

---

<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:** [May 14, 2020, 3:04am UTC](https://discuss.elastic.co/t/elastic-how-to-enable-autodetect-on-metadata-like-container-id-in-elastic-apm-agent-apm-server/227257/7 "2020-05-14T03:04:45Z")

</div>

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