Skip to content

[k8sattributes] Extract the label attributes from the semconv package directly #45718

@ChrsMark

Description

@ChrsMark

We should extract the label attributes from the semconv package directly (conventions "go.opentelemetry.io/otel/semconv/v1.38.0" ->

conventions "go.opentelemetry.io/otel/semconv/v1.38.0"
).

That goes for all of

K8sPodLabelsKey = "k8s.pod.labels.%s"
K8sPodLabelKey = "k8s.pod.label.%s"
K8sPodAnnotationsKey = "k8s.pod.annotations.%s"
K8sPodAnnotationKey = "k8s.pod.annotation.%s"
K8sNodeLabelsKey = "k8s.node.labels.%s"
K8sNodeLabelKey = "k8s.node.label.%s"
K8sNodeAnnotationsKey = "k8s.node.annotations.%s"
K8sNodeAnnotationKey = "k8s.node.annotation.%s"
K8sNamespaceLabelsKey = "k8s.namespace.labels.%s"
K8sNamespaceLabelKey = "k8s.namespace.label.%s"
K8sNamespaceAnnotationsKey = "k8s.namespace.annotations.%s"
K8sNamespaceAnnotationKey = "k8s.namespace.annotation.%s"
// Semconv attributes https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/k8s.md#deployment
K8sDeploymentLabel = "k8s.deployment.label.%s"
K8sDeploymentAnnotation = "k8s.deployment.annotation.%s"
// Semconv attributes https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/k8s.md#statefulset
K8sStatefulSetLabel = "k8s.statefulset.label.%s"
K8sStatefulSetAnnotation = "k8s.statefulset.annotation.%s"
// Semconv attributes https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/k8s.md#daemonset
K8sDaemonSetLabel = "k8s.daemonset.label.%s"
K8sDaemonSetAnnotation = "k8s.daemonset.annotation.%s"
// Semconv attributes https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/k8s.md#job
K8sJobLabel = "k8s.job.label.%s"
K8sJobAnnotation = "k8s.job.annotation.%s"
.

Originally posted by @ChrsMark in #45307 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions