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

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 :slight_smile:

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.

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

1 Like

This was a quick fix. Thanks a lot

@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 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?

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

1 Like

Worked like a charm! Thanks a lot

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