Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResourceAttributes.php

ResourceAttributes::K8S_CLUSTER_UID

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

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:<blockquote> If generated according to one of the mechanisms defined in Rec.</blockquote> 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.

@example 218fc5a9-a5f1-4b54-aa05-46717d0ab26d

File

vendor/open-telemetry/sem-conv/ResourceAttributes.php, line 617

Class

ResourceAttributes

Namespace

OpenTelemetry\SemConv

Code

public const K8S_CLUSTER_UID = 'k8s.cluster.uid';

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal