-
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
[receiver/k8sobjects] Kubernetes events are missing namespace resource attribute #36352
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi @tetianakravchenko, I just looked at this and could reproduce this behaviour as well. From my understanding of the readme, the
type: ADDED
object:
kind: Event
metadata:
name: my-event
namespace: my-namespace
kind: Event
metadata:
name: my-event
namespace: my-namespace Thus, the The other suggestion regarding the addition of the missing attribute in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.112.0/receiver/k8sobjectsreceiver/unstructured_to_logdata.go#L36-L40 also seems reasonable to me, but I would like to get the opinion of the code owners of this component. I'd be happy to work on a fix once we have decided on which approach to take here |
I have created a PR now to make sure the generated log records have the same structure, regardless of the underlying mode (pull or watch): #36432 |
Component(s)
receiver/k8sobjects
What happened?
Description
Kubernetes events, collected using the
watch
mode:are missing the namespace
resource.attribute
.Looking to the code - https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.112.0/receiver/k8sobjectsreceiver/unstructured_to_logdata.go#L58-L60 it seems that it is expected that this attribute is added.
watchObjects
have a different structure comparing to thepullObjects
as a resulte.GetNamespace()
call return an empty string.another option would be to add
namespace
to theattributes
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.112.0/receiver/k8sobjectsreceiver/unstructured_to_logdata.go#L36-L40, would it be a preferable way?Steps to Reproduce
enable k8sobjects:
Expected Result
I expect to see Resource Attribute
k8s.namespace.name
addedActual Result
Collector version
0.112.0
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: