K8s

K8s Cluster

Status: Development

type: k8s.cluster

Description: A Kubernetes Cluster.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.cluster.uidDevelopmentRecommendedstringA pseudo-ID for the cluster, set to the UID of the kube-system namespace. [1]218fc5a9-a5f1-4b54-aa05-46717d0ab26d
Descriptionk8s.cluster.nameDevelopmentRecommendedstringThe name of the cluster.opentelemetry-cluster

[1] k8s.cluster.uid: K8s doesn’t have support for obtaining a cluster ID. If this is ever added, we will recommend collecting the k8s.cluster.uid through the official APIs. In the meantime, we are able to use the uid of the kube-system namespace as a proxy for cluster ID. Read on for the rationale.

Every object created in a K8s cluster is assigned a distinct UID. The kube-system namespace is used by Kubernetes itself and will exist for the lifetime of the cluster. Using the uid of the kube-system namespace is a reasonable proxy for the K8s ClusterID as it will only change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are UUIDs as standardized by ISO/IEC 9834-8 and ITU-T X.667. Which states:

If generated according to one of the mechanisms defined in Rec. ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be different from all other UUIDs generated before 3603 A.D., or is extremely likely to be different (depending on the mechanism chosen).

Therefore, UIDs between clusters should be extremely unlikely to conflict.

K8s Container

Status: Development

type: k8s.container

Description: A container in a PodTemplate.

⚠️ This entity definition contains attributes without a role. Stable Entities MUST NOT have attributes without a defined role.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Otherk8s.container.nameDevelopmentRecommendedstringThe name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (container.name).redis
Otherk8s.container.restart_countDevelopmentRecommendedintNumber of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.
Otherk8s.container.status.last_terminated_reasonDevelopmentRecommendedstringLast terminated reason of the Container.Evicted; Error

K8s Cronjob

Status: Development

type: k8s.cronjob

Description: A Kubernetes CronJob object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.cronjob.uidDevelopmentRecommendedstringThe UID of the CronJob.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.cronjob.nameDevelopmentRecommendedstringThe name of the CronJob.opentelemetry
Descriptionk8s.cronjob.annotation.<key>DevelopmentOpt-InstringThe cronjob annotation placed on the CronJob, the <key> being the annotation name, the value being the annotation value. [2]4; ``
Descriptionk8s.cronjob.label.<key>DevelopmentOpt-InstringThe label placed on the CronJob, the <key> being the label name, the value being the label value. [3]weekly; ``

[2] k8s.cronjob.annotation.<key>: Examples:

  • An annotation retries with value 4 SHOULD be recorded as the k8s.cronjob.annotation.retries attribute with value "4".
  • An annotation data with empty string value SHOULD be recorded as the k8s.cronjob.annotation.data attribute with value "".

[3] k8s.cronjob.label.<key>: Examples:

  • A label type with value weekly SHOULD be recorded as the k8s.cronjob.label.type attribute with value "weekly".
  • A label automated with empty string value SHOULD be recorded as the k8s.cronjob.label.automated attribute with value "".

K8s Daemonset

Status: Development

type: k8s.daemonset

Description: A Kubernetes DaemonSet object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.daemonset.uidDevelopmentRecommendedstringThe UID of the DaemonSet.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.daemonset.nameDevelopmentRecommendedstringThe name of the DaemonSet.opentelemetry
Descriptionk8s.daemonset.annotation.<key>DevelopmentOpt-InstringThe annotation placed on the DaemonSet, the <key> being the annotation name, the value being the annotation value, even if the value is empty. [4]1; ``
Descriptionk8s.daemonset.label.<key>DevelopmentOpt-InstringThe label placed on the DaemonSet, the <key> being the label name, the value being the label value, even if the value is empty. [5]guestbook; ``

[4] k8s.daemonset.annotation.<key>: Examples:

  • A label replicas with value 1 SHOULD be recorded as the k8s.daemonset.annotation.replicas attribute with value "1".
  • A label data with empty string value SHOULD be recorded as the k8s.daemonset.annotation.data attribute with value "".

[5] k8s.daemonset.label.<key>: Examples:

  • A label app with value guestbook SHOULD be recorded as the k8s.daemonset.label.app attribute with value "guestbook".
  • A label data with empty string value SHOULD be recorded as the k8s.daemonset.label.injected attribute with value "".

K8s Deployment

Status: Development

type: k8s.deployment

Description: A Kubernetes Deployment object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.deployment.uidDevelopmentRecommendedstringThe UID of the Deployment.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.deployment.nameDevelopmentRecommendedstringThe name of the Deployment.opentelemetry
Descriptionk8s.deployment.annotation.<key>DevelopmentOpt-InstringThe annotation placed on the Deployment, the <key> being the annotation name, the value being the annotation value, even if the value is empty. [6]1; ``
Descriptionk8s.deployment.label.<key>DevelopmentOpt-InstringThe label placed on the Deployment, the <key> being the label name, the value being the label value, even if the value is empty. [7]guestbook; ``

[6] k8s.deployment.annotation.<key>: Examples:

  • A label replicas with value 1 SHOULD be recorded as the k8s.deployment.annotation.replicas attribute with value "1".
  • A label data with empty string value SHOULD be recorded as the k8s.deployment.annotation.data attribute with value "".

[7] k8s.deployment.label.<key>: Examples:

  • A label replicas with value 0 SHOULD be recorded as the k8s.deployment.label.app attribute with value "guestbook".
  • A label injected with empty string value SHOULD be recorded as the k8s.deployment.label.injected attribute with value "".

K8s Hpa

Status: Development

type: k8s.hpa

Description: A Kubernetes HorizontalPodAutoscaler object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.hpa.uidDevelopmentRecommendedstringThe UID of the horizontal pod autoscaler.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.hpa.nameDevelopmentRecommendedstringThe name of the horizontal pod autoscaler.opentelemetry
Descriptionk8s.hpa.scaletargetref.api_versionDevelopmentRecommendedstringThe API version of the target resource to scale for the HorizontalPodAutoscaler. [8]apps/v1; autoscaling/v2
Descriptionk8s.hpa.scaletargetref.kindDevelopmentRecommendedstringThe kind of the target resource to scale for the HorizontalPodAutoscaler. [9]Deployment; StatefulSet
Descriptionk8s.hpa.scaletargetref.nameDevelopmentRecommendedstringThe name of the target resource to scale for the HorizontalPodAutoscaler. [10]my-deployment; my-statefulset

[8] k8s.hpa.scaletargetref.api_version: This maps to the apiVersion field in the scaleTargetRef of the HPA spec.

[9] k8s.hpa.scaletargetref.kind: This maps to the kind field in the scaleTargetRef of the HPA spec.

[10] k8s.hpa.scaletargetref.name: This maps to the name field in the scaleTargetRef of the HPA spec.

K8s Job

Status: Development

type: k8s.job

Description: A Kubernetes Job object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.job.uidDevelopmentRecommendedstringThe UID of the Job.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.job.nameDevelopmentRecommendedstringThe name of the Job.opentelemetry
Descriptionk8s.job.annotation.<key>DevelopmentOpt-InstringThe annotation placed on the Job, the <key> being the annotation name, the value being the annotation value, even if the value is empty. [11]1; ``
Descriptionk8s.job.label.<key>DevelopmentOpt-InstringThe label placed on the Job, the <key> being the label name, the value being the label value, even if the value is empty. [12]ci; ``

[11] k8s.job.annotation.<key>: Examples:

  • A label number with value 1 SHOULD be recorded as the k8s.job.annotation.number attribute with value "1".
  • A label data with empty string value SHOULD be recorded as the k8s.job.annotation.data attribute with value "".

[12] k8s.job.label.<key>: Examples:

  • A label jobtype with value ci SHOULD be recorded as the k8s.job.label.jobtype attribute with value "ci".
  • A label data with empty string value SHOULD be recorded as the k8s.job.label.automated attribute with value "".

K8s Namespace

Status: Development

type: k8s.namespace

Description: A Kubernetes Namespace.

⚠️ This entity definition contains attributes without a role. Stable Entities MUST NOT have attributes without a defined role.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Otherk8s.namespace.nameDevelopmentRecommendedstringThe name of the namespace that the pod is running in.default
Otherk8s.namespace.annotation.<key>DevelopmentOpt-InstringThe annotation placed on the Namespace, the <key> being the annotation name, the value being the annotation value, even if the value is empty. [13]0; ``
Otherk8s.namespace.label.<key>DevelopmentOpt-InstringThe label placed on the Namespace, the <key> being the label name, the value being the label value, even if the value is empty. [14]default; ``

[13] k8s.namespace.annotation.<key>: Examples:

  • A label ttl with value 0 SHOULD be recorded as the k8s.namespace.annotation.ttl attribute with value "0".
  • A label data with empty string value SHOULD be recorded as the k8s.namespace.annotation.data attribute with value "".

[14] k8s.namespace.label.<key>: Examples:

  • A label kubernetes.io/metadata.name with value default SHOULD be recorded as the k8s.namespace.label.kubernetes.io/metadata.name attribute with value "default".
  • A label data with empty string value SHOULD be recorded as the k8s.namespace.label.data attribute with value "".

K8s Node

Status: Development

type: k8s.node

Description: A Kubernetes Node object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.node.uidDevelopmentRecommendedstringThe UID of the Node.1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2
Descriptionk8s.node.nameDevelopmentRecommendedstringThe name of the Node.node-1
Descriptionk8s.node.annotation.<key>DevelopmentOpt-InstringThe annotation placed on the Node, the <key> being the annotation name, the value being the annotation value, even if the value is empty. [15]0; ``
Descriptionk8s.node.label.<key>DevelopmentOpt-InstringThe label placed on the Node, the <key> being the label name, the value being the label value, even if the value is empty. [16]arm64; ``

[15] k8s.node.annotation.<key>: Examples:

  • An annotation node.alpha.kubernetes.io/ttl with value 0 SHOULD be recorded as the k8s.node.annotation.node.alpha.kubernetes.io/ttl attribute with value "0".
  • An annotation data with empty string value SHOULD be recorded as the k8s.node.annotation.data attribute with value "".

[16] k8s.node.label.<key>: Examples:

  • A label kubernetes.io/arch with value arm64 SHOULD be recorded as the k8s.node.label.kubernetes.io/arch attribute with value "arm64".
  • A label data with empty string value SHOULD be recorded as the k8s.node.label.data attribute with value "".

K8s Pod

Status: Development

type: k8s.pod

Description: A Kubernetes Pod object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.pod.uidDevelopmentRecommendedstringThe UID of the Pod.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.pod.nameDevelopmentRecommendedstringThe name of the Pod.opentelemetry-pod-autoconf
Descriptionk8s.pod.annotation.<key>DevelopmentOpt-InstringThe annotation placed on the Pod, the <key> being the annotation name, the value being the annotation value. [17]true; x64; ``
Descriptionk8s.pod.label.<key>DevelopmentOpt-InstringThe label placed on the Pod, the <key> being the label name, the value being the label value. [18]my-app; x64; ``

[17] k8s.pod.annotation.<key>: Examples:

  • An annotation kubernetes.io/enforce-mountable-secrets with value true SHOULD be recorded as the k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets attribute with value "true".
  • An annotation mycompany.io/arch with value x64 SHOULD be recorded as the k8s.pod.annotation.mycompany.io/arch attribute with value "x64".
  • An annotation data with empty string value SHOULD be recorded as the k8s.pod.annotation.data attribute with value "".

[18] k8s.pod.label.<key>: Examples:

  • A label app with value my-app SHOULD be recorded as the k8s.pod.label.app attribute with value "my-app".
  • A label mycompany.io/arch with value x64 SHOULD be recorded as the k8s.pod.label.mycompany.io/arch attribute with value "x64".
  • A label data with empty string value SHOULD be recorded as the k8s.pod.label.data attribute with value "".

K8s Replicaset

Status: Development

type: k8s.replicaset

Description: A Kubernetes ReplicaSet object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.replicaset.uidDevelopmentRecommendedstringThe UID of the ReplicaSet.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.replicaset.nameDevelopmentRecommendedstringThe name of the ReplicaSet.opentelemetry
Descriptionk8s.replicaset.annotation.<key>DevelopmentOpt-InstringThe annotation placed on the ReplicaSet, the <key> being the annotation name, the value being the annotation value, even if the value is empty. [19]0; ``
Descriptionk8s.replicaset.label.<key>DevelopmentOpt-InstringThe label placed on the ReplicaSet, the <key> being the label name, the value being the label value, even if the value is empty. [20]guestbook; ``

[19] k8s.replicaset.annotation.<key>: Examples:

  • A label replicas with value 0 SHOULD be recorded as the k8s.replicaset.annotation.replicas attribute with value "0".
  • A label data with empty string value SHOULD be recorded as the k8s.replicaset.annotation.data attribute with value "".

[20] k8s.replicaset.label.<key>: Examples:

  • A label app with value guestbook SHOULD be recorded as the k8s.replicaset.label.app attribute with value "guestbook".
  • A label injected with empty string value SHOULD be recorded as the k8s.replicaset.label.injected attribute with value "".

K8s Replicationcontroller

Status: Development

type: k8s.replicationcontroller

Description: A Kubernetes ReplicationController object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.replicationcontroller.uidDevelopmentRecommendedstringThe UID of the replication controller.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.replicationcontroller.nameDevelopmentRecommendedstringThe name of the replication controller.opentelemetry

K8s Resourcequota

Status: Development

type: k8s.resourcequota

Description: A Kubernetes ResourceQuota object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.resourcequota.uidDevelopmentRecommendedstringThe UID of the resource quota.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.resourcequota.nameDevelopmentRecommendedstringThe name of the resource quota.opentelemetry

K8s Statefulset

Status: Development

type: k8s.statefulset

Description: A Kubernetes StatefulSet object.

Attributes:

RoleKeyStabilityRequirement LevelValue TypeDescriptionExample Values
Identityk8s.statefulset.uidDevelopmentRecommendedstringThe UID of the StatefulSet.275ecb36-5aa8-4c2a-9c47-d8bb681b9aff
Descriptionk8s.statefulset.nameDevelopmentRecommendedstringThe name of the StatefulSet.opentelemetry
Descriptionk8s.statefulset.annotation.<key>DevelopmentOpt-InstringThe annotation placed on the StatefulSet, the <key> being the annotation name, the value being the annotation value, even if the value is empty. [21]1; ``
Descriptionk8s.statefulset.label.<key>DevelopmentOpt-InstringThe label placed on the StatefulSet, the <key> being the label name, the value being the label value, even if the value is empty. [22]guestbook; ``

[21] k8s.statefulset.annotation.<key>: Examples:

  • A label replicas with value 1 SHOULD be recorded as the k8s.statefulset.annotation.replicas attribute with value "1".
  • A label data with empty string value SHOULD be recorded as the k8s.statefulset.annotation.data attribute with value "".

[22] k8s.statefulset.label.<key>: Examples:

  • A label replicas with value 0 SHOULD be recorded as the k8s.statefulset.label.app attribute with value "guestbook".
  • A label injected with empty string value SHOULD be recorded as the k8s.statefulset.label.injected attribute with value "".