View Source OpenTelemetry.SemConv.Incubating.K8SAttributes (OpenTelemetry.SemConv v1.27.0)

OpenTelemetry Semantic Conventions for K8S attributes.

Summary

Functions

The name of the cluster.

A pseudo-ID for the cluster, set to the UID of the kube-system namespace.

The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (container.name).

Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.

Last terminated reason of the Container.

The name of the CronJob.

The UID of the CronJob.

The name of the DaemonSet.

The UID of the DaemonSet.

The name of the Deployment.

The UID of the Deployment.

The name of the Job.

The UID of the Job.

The name of the namespace that the pod is running in.

The name of the Node.

The UID of the Node.

The annotation key-value pairs placed on the Pod, the <key> being the annotation name, the value being the annotation value.

The label key-value pairs placed on the Pod, the <key> being the label name, the value being the label value.

k8s_pod_labels() deprecated

The name of the Pod.

The UID of the Pod.

The name of the ReplicaSet.

The UID of the ReplicaSet.

The name of the StatefulSet.

The UID of the StatefulSet.

Functions

@spec k8s_cluster_name() :: :"k8s.cluster.name"

The name of the cluster.

Value type

Value must be of type atom() | String.t().

Examples

["opentelemetry-cluster"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_cluster_name()
:"k8s.cluster.name"
@spec k8s_cluster_uid() :: :"k8s.cluster.uid"

A pseudo-ID for the cluster, set to the UID of the kube-system namespace.

Value type

Value must be of type atom() | String.t().

Notes

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.

Examples

["218fc5a9-a5f1-4b54-aa05-46717d0ab26d"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_cluster_uid()
:"k8s.cluster.uid"
@spec k8s_container_name() :: :"k8s.container.name"

The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (container.name).

Value type

Value must be of type atom() | String.t().

Examples

["redis"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_container_name()
:"k8s.container.name"
Link to this function

k8s_container_restart_count()

View Source
@spec k8s_container_restart_count() :: :"k8s.container.restart_count"

Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.

Value type

Value must be of type integer().

iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_container_restart_count()
:"k8s.container.restart_count"
Link to this function

k8s_container_status_last_terminated_reason()

View Source
@spec k8s_container_status_last_terminated_reason() ::
  :"k8s.container.status.last_terminated_reason"

Last terminated reason of the Container.

Value type

Value must be of type atom() | String.t().

Examples

["Evicted", "Error"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_container_status_last_terminated_reason()
:"k8s.container.status.last_terminated_reason"
@spec k8s_cronjob_name() :: :"k8s.cronjob.name"

The name of the CronJob.

Value type

Value must be of type atom() | String.t().

Examples

["opentelemetry"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_cronjob_name()
:"k8s.cronjob.name"
@spec k8s_cronjob_uid() :: :"k8s.cronjob.uid"

The UID of the CronJob.

Value type

Value must be of type atom() | String.t().

Examples

["275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_cronjob_uid()
:"k8s.cronjob.uid"
@spec k8s_daemonset_name() :: :"k8s.daemonset.name"

The name of the DaemonSet.

Value type

Value must be of type atom() | String.t().

Examples

["opentelemetry"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_daemonset_name()
:"k8s.daemonset.name"
@spec k8s_daemonset_uid() :: :"k8s.daemonset.uid"

The UID of the DaemonSet.

Value type

Value must be of type atom() | String.t().

Examples

["275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_daemonset_uid()
:"k8s.daemonset.uid"
@spec k8s_deployment_name() :: :"k8s.deployment.name"

The name of the Deployment.

Value type

Value must be of type atom() | String.t().

Examples

["opentelemetry"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_deployment_name()
:"k8s.deployment.name"
@spec k8s_deployment_uid() :: :"k8s.deployment.uid"

The UID of the Deployment.

Value type

Value must be of type atom() | String.t().

Examples

["275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_deployment_uid()
:"k8s.deployment.uid"
@spec k8s_job_name() :: :"k8s.job.name"

The name of the Job.

Value type

Value must be of type atom() | String.t().

Examples

["opentelemetry"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_job_name()
:"k8s.job.name"
@spec k8s_job_uid() :: :"k8s.job.uid"

The UID of the Job.

Value type

Value must be of type atom() | String.t().

Examples

["275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_job_uid()
:"k8s.job.uid"
@spec k8s_namespace_name() :: :"k8s.namespace.name"

The name of the namespace that the pod is running in.

Value type

Value must be of type atom() | String.t().

Examples

["default"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_namespace_name()
:"k8s.namespace.name"
@spec k8s_node_name() :: :"k8s.node.name"

The name of the Node.

Value type

Value must be of type atom() | String.t().

Examples

["node-1"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_node_name()
:"k8s.node.name"
@spec k8s_node_uid() :: :"k8s.node.uid"

The UID of the Node.

Value type

Value must be of type atom() | String.t().

Examples

["1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_node_uid()
:"k8s.node.uid"
@spec k8s_pod_annotation() :: :"k8s.pod.annotation"

The annotation key-value pairs placed on the Pod, the <key> being the annotation name, the value being the annotation value.

Value type

Value must be of type atom() | String.t().

Examples

["k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets=true", "k8s.pod.annotation.mycompany.io/arch=x64", "k8s.pod.annotation.data="]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_pod_annotation()
:"k8s.pod.annotation"
@spec k8s_pod_label() :: :"k8s.pod.label"

The label key-value pairs placed on the Pod, the <key> being the label name, the value being the label value.

Value type

Value must be of type atom() | String.t().

Examples

["k8s.pod.label.app=my-app", "k8s.pod.label.mycompany.io/arch=x64", "k8s.pod.label.data="]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_pod_label()
:"k8s.pod.label"
This function is deprecated. Replaced by `k8s.pod.label`. .
@spec k8s_pod_labels() :: :"k8s.pod.labels"
@spec k8s_pod_name() :: :"k8s.pod.name"

The name of the Pod.

Value type

Value must be of type atom() | String.t().

Examples

["opentelemetry-pod-autoconf"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_pod_name()
:"k8s.pod.name"
@spec k8s_pod_uid() :: :"k8s.pod.uid"

The UID of the Pod.

Value type

Value must be of type atom() | String.t().

Examples

["275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_pod_uid()
:"k8s.pod.uid"
@spec k8s_replicaset_name() :: :"k8s.replicaset.name"

The name of the ReplicaSet.

Value type

Value must be of type atom() | String.t().

Examples

["opentelemetry"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_replicaset_name()
:"k8s.replicaset.name"
@spec k8s_replicaset_uid() :: :"k8s.replicaset.uid"

The UID of the ReplicaSet.

Value type

Value must be of type atom() | String.t().

Examples

["275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_replicaset_uid()
:"k8s.replicaset.uid"
@spec k8s_statefulset_name() :: :"k8s.statefulset.name"

The name of the StatefulSet.

Value type

Value must be of type atom() | String.t().

Examples

["opentelemetry"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_statefulset_name()
:"k8s.statefulset.name"
@spec k8s_statefulset_uid() :: :"k8s.statefulset.uid"

The UID of the StatefulSet.

Value type

Value must be of type atom() | String.t().

Examples

["275ecb36-5aa8-4c2a-9c47-d8bb681b9aff"]
iex> OpenTelemetry.SemConv.Incubating.K8SAttributes.k8s_statefulset_uid()
:"k8s.statefulset.uid"