Open ChrsMark opened 3 weeks ago
I prefer the existing k8s.<object>.label.*
convention. As you point out, the unified approach introduces the potential for conflicts, but it also loses information that is important.
For example, suppose you want to filter metrics based on whether it comes from a pod in a particular k8s service. K8s services use label selectors on the pod object, so I would want to be able to filter on k8s.pod.label.foo
, as k8s.label.foo
could include metrics from pods which are not actually part of the service.
I agree with @dashpole. In addition, the existing namespaces does not restrict searching for more than one object type with a particular label since you could use an OR clause to find multiple.
Area(s)
area:k8s
Is your change request related to a problem? Please describe.
At the moment the
k8s
semantic conventions define thek8s.pod.label.*
andk8s.pod.annotation.*
attributes: https://github.com/open-telemetry/semantic-conventions/blob/v1.26.0/model/registry/k8s.yaml#L74-L85This implies that if we want to add the labels for additions for other kind of objects we need to define the
k8s.node.label.*
,k8s.deployment.label.*
etc.However, I wonder if this distinction really make sense and if we should instead have unified
k8s.label.*
andk8s.annotation.*
attributes to cover for all.On a k8s environment we can search for all types of objects using the same label. For example:
So an equivalent query to a backend should provide similar experience without the need to scope the search for each of the different resource types.
The only drawback I see here is that there is potentially a case to be made where for a signal we would to like to enrich with both the Pod's labels and the Node's label, for example, but those have different values for the same keys. This would result into conflict/overlap so the question of which is the one that should be used occurs. However, I'm not sure if having sth like this is a good practice from k8s ops perspective 🤔.
Describe the solution you'd like
The purpose of the issue is to clarify if k8s labels/annotation should be scoped under each specific resource.
@open-telemetry/semconv-k8s-approvers I would love to hear your thoughts on this.
Describe alternatives you've considered
No response
Additional context
Related to https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27909 No response