-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect containerID detection in apm-java-agent on GKE Autopilot cluster #3510
Comments
Thanks for reporting this @b2ronn , we did a few changes in 1.44.0 that should have improved that but maybe there is a regression. As the docker image ID of the agent is Can you please provide the following information:
Here if I'm not mistaken, you would have expected the agent to report |
Yes, expecting to see container.id= pod.name (if not passed through environment variables) can probably be obtained from:
and from elasticsearch document
However, Kubernetes data is present because I set them as environment variables. P.S. All of this was tested on a GKE Autopilot cluster. |
The underlying problem here is that there is strictly no stable and standard way to get the container/pod ID from the container itself, and as a consequence we have to rely on implementation details like parsing the For google (at least with GCP, not sure if it also applies to GKE), there is the metadata endpoint that can be called with (doc) For Kubernetes, the downward API with environment variables can be used to provide some information and our agents should already support them if they are set, which is very probably what you are doing here. The major downside here is that is requires explicit changes to the k8s configuration. So I think here we need to answer the following questions:
|
For example, to work around the limitation of the absence of containerID in Kibana in the APM interface > Services > ANY_SERVICE > infrastructure > Containers (we can't modify this interface), currently perform (for my example) a query
|
@SylvainJuge what do you think about the workaround suggested above? I think it can help at least in some cases. |
What workaround exactly are you suggesting here? |
Read the last message from b2ronn, about how to modify group by filter. |
Changing the kibana query? That sounds like something you could build into your own custom dashboard. But I'll pass this suggestion on to the UI folks and see if there is appetite |
Of course, a lot can be done on a custom dashboard. |
It's not that helpful because the containerID exists so the k8s pod part of the or clause doesn't get executed. It's the ID wrong but it exists |
Since there is an incorrect containerID, the filter ends up empty. |
What do you think gentlemen? |
It will be considered in the kibana enhancement requests |
Could you please provide a link to the ticket for kibana? |
Closing as this can't be fixed in the agent, however elastic/kibana#178209 enhancement request has been opened for the suggestions to improve the UI |
Description:
The apm-java-agent seems to incorrectly determine the containerID when the application is running on a GKE Autopilot cluster. This issue leads to discrepancies between the actual containerID (and other related identifiers like pod name/pod UID) and those obtained by collected via elastic-agent (https://www.elastic.co/blog/elastic-observe-gke-autopilot-clusters).
Steps to Reproduce:
Deploy an application utilizing the apm-java-agent on a GKE Autopilot cluster.
Check /proc/self/cgroup and /proc/self/mountinfo.
and pod status
Compare the obtained containerID with the one reported in the status.
Click to open Example Deployment
``` ```PS: and it would be good to define Pod_Name(as example from /etc/hostname)/Pod_UID/Node_Name from inside the container, without env variables.
The text was updated successfully, but these errors were encountered: