-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
k8sattributes: automatically extract k8s.container.name #19468
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
How do you know which container is sending data from a pod? |
Thanks for the response Dmitrii. I see what you are saying: currently the code is relying on the fact that the What I would recommend is to continue using the same logic, but instead relying on the Actually, discovering this now, I understand why I was surprised to find out that container tags were missing in my traces, despite me adding the container ID in the SDK. That is quite unfortunate and unexepected. I wouldn't ask to make a breaking change, but to at least temporarily add this functionality to allow picking up the |
To shed more light onto the alternative I am proposing, can you please clarify how users are expected to set |
@gbbr I see now. I didn't know that instrumentations can set |
Yes, I'd be happy to work on this. Thanks for looking. |
P.S. I was thinking |
Looking for the specific container always comes after looking for a pod, so it doesn't matter which attribute is used to identify a container within a pod. If we want to keep it this way, we don't even need any changes to the Another thing you need to do, is to add |
Got it.
Thanks. I will do it as you initially suggested, as part of
Good point. This is something we need better support for (e.g. #19759). It is easy to omit this detail if nothing (or nobody) warns you. |
Just for curiosity, what benefits we can get from adding |
No need to provide any other pod-identifying attributes or use the |
I'm going to turn back around on what I initially said re. my approach. I was not familiar enough with the code base at the time to express the best opinion. My suggestion is as follows:
This is basically what you (@dmitryax) suggested here. WDYT? |
@fatsheep9146 the main advantage I can think of is that you can then use the SDK API for pod association, without needing to mess around with your Kubernetes deployment's YAML to set environment variables etc. However, I am now proposing (as per my latest comment) that we address this aspect as part of a separate issue (which I am willing to open and work on). Otherwise, mixing both this change and that one might result in too much complexity both for reviewing and for writing in a qualitative way. |
Component(s)
processor/k8sattributes
Is your feature request related to a problem? Please describe.
The container name is already available in the spec and could easily be added when extracting pod container attributes as part of the already existing Container struct.
The information could be added as the k8s.container.name tag.
Describe the solution you'd like
I would like to add this automatically (or by means of config). Happy to work on it myself.
The text was updated successfully, but these errors were encountered: