-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added labels and annotations to all the entities #718
base: master
Are you sure you want to change the base?
Added labels and annotations to all the entities #718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the two comments, I don't see how this code can set labels like k8s.pod.labels.label_name=123
. It just sets the object to k8s.pod.labels
object. Have you considered flatten function? It seems that it could do the job
- context: log | ||
statements: | ||
# set entity annotations for the resource | ||
- set(resource.attributes["k8s.pod.annotations"], body["metadata"]["annotations"]) where body["kind"] == "Pod" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why transform/manifest
do not set resource attributes, but normal attributes followed by groupbyattrs/manifest
is that setting resource attributes was not setting correctly in this case. Since all manifest events are in the same resource group they were overriding resource attributes of each other, so for example you have pod1
and pod2
, they change both in the same time so collector is processing both in the same batch, pod1
set k8s.pod.annotations
and pod2
override it. If we set standard attributes and then create resource groups by unique combinations of the attributes it worked.
Have you tested this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with data overriding was there, so I added annotations and labels to the groupbyattr processor as we discussed, and it seems to be working as expected now
…-and-annotations-to-all-the-entities
This PR adds labels and annotations to all the kubernetes entities.