-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 doesn't work with both pod UID and container name in sources #32104
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I think this is because |
Here's an excerpt from the documentation:
This led me to believe that |
@paulius-valiunas condition 1. states that This feels like a possible duplicate of #31509, do you agree? |
If you're trying to associate the telemetry to pod data using |
@TylerHelmuth I don't think this works either way. If you look at the implementation of Pod cache updates, it goes like so:
Container attributes are not calculated during this process, but instead at runtime based on the
|
I'm not trying to extract the container name, I already have it. I'm just trying to get the image name and tag. |
Also, the documentation says:
That's why I added the "already known" fields to both |
@swiatekm-sumo you're right. We should add to the README that container fields can't be used for association.
Yes I agree, I think that sentence is wrong and could be removed.
Similar to #31509 (comment), can you check that the container name on the telemetry matches the container name the processor is recording? If they don't match the other container details cannot be extracted. I also suggest you make the pod_association section look like this: pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: connection As @swiatekm-sumo pointed out |
In that case, you should remove this section too:
If I may ask, how could you possibly get
Yes, I'm getting the correct container name, everything comes from Kubernetes log files.
I'm getting all my logs from a filelog receiver so the connection/IP-related sources won't work.
You have a point, |
@paulius-valiunas while This section of the README is accurate:
Although I think we should update the word In your situation, you''ll be able to associate the pod logs you're collecting via the filelog receiver to the pod metadata via Your k8sattributes/filelog:
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.uid
extract:
metadata:
- "container.image.name"
- "container.image.tag" |
Yes, the documentation needs to be a lot clearer. What exactly does "resource attributes are provided" mean? Do they have to be in the resource but not referenced by In addition, I don't think "[they] do nothing in the Overall, some things might be hard to explain in words, but it would be great to have more examples in the documentation. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@TylerHelmuth if this issue is still relevant I would be happy to look into this |
I have created a PR for the readme in an attempt to make things a bit clearer and highlight potential limitations for association rules: #33800 please let me know if there is something you think needs further elaboration |
…tributes processor (#33800) **Description:** This PR attempts to improve the documentation of the k8sattributes processor. Being relatively new to this component I tried to make the documentation a bit easier to understand for new users, and highlight some limitations I found while going through the implementation. **Link to tracking Issue:** #32104 **Testing:** Trying out different configurations and association rules to get a better understanding **Documentation:** Extended the readme of this component --------- Signed-off-by: Florian Bacher <[email protected]> Co-authored-by: Tiffany Hrabusa <[email protected]>
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Component(s)
processor/k8sattributes
What happened?
Description
If I provide pod UID, container name, and namespace name, to the k8sattributes processor, it doesn't seem to work.
Steps to Reproduce
Expected Result
Should add
k8s.node.name
to the resourceActual Result
Doesn't add anything. Doesn't log anything useful either. With debug logs enabled:
After removing
k8s.container.name
fromsources
, the processor started adding the node name to my resources.Collector version
OpenTelemetry Operator 0.42.3
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: