From 71e1a8ded5dfec2d96fb8d07b6cdc306cd071b6e Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Mon, 15 Jul 2024 13:30:10 +0300 Subject: [PATCH 1/5] Add k8s.volume.{name,type} attributes Signed-off-by: ChrsMark --- .chloggen/add_k8s_volume_type.yaml | 22 +++++++++++++ docs/attributes-registry/k8s.md | 16 ++++++++++ model/registry/k8s.yaml | 50 ++++++++++++++++++++++++++++++ model/resource/k8s.yaml | 9 ++++++ 4 files changed, 97 insertions(+) create mode 100755 .chloggen/add_k8s_volume_type.yaml diff --git a/.chloggen/add_k8s_volume_type.yaml b/.chloggen/add_k8s_volume_type.yaml new file mode 100755 index 0000000000..0e3c71bfeb --- /dev/null +++ b/.chloggen/add_k8s_volume_type.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: k8s + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Adds k8s.volume.name and k8s.volume.type + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [1164] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/attributes-registry/k8s.md b/docs/attributes-registry/k8s.md index 34d2e64c88..829c5bf0d0 100644 --- a/docs/attributes-registry/k8s.md +++ b/docs/attributes-registry/k8s.md @@ -39,6 +39,8 @@ Kubernetes resource attributes. | `k8s.replicaset.uid` | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.statefulset.name` | string | The name of the StatefulSet. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.statefulset.uid` | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.volume.name` | string | The name of the K8s volume. | `volume0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.volume.type` | string | The type of the K8s volume. | `emptyDir`; `persistentVolumeClaim` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** 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 @@ -63,6 +65,20 @@ Which states: Therefore, UIDs between clusters should be extremely unlikely to conflict. +`k8s.volume.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| `awsElasticBlockStore` | An [awsElasticBlockStore](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#awselasticblockstore) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `configMap` | A [configMap](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `downwardAPI` | A [downwardAPI](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `emptyDir` | An [emptyDir](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gcePersistentDisk` | A [gcePersistentDisk](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `glusterfs` | A [glusterfs](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#glusterfs) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `local` | A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `persistentVolumeClaim` | A [persistentVolumeClaim](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `secret` | A [secret](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#secret) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + ## Deprecated Kubernetes Attributes Describes deprecated k8s attributes. diff --git a/model/registry/k8s.yaml b/model/registry/k8s.yaml index 42da6ab238..635b444d6b 100644 --- a/model/registry/k8s.yaml +++ b/model/registry/k8s.yaml @@ -177,3 +177,53 @@ groups: brief: > The name of the CronJob. examples: ['opentelemetry'] + - id: volume.name + type: string + stability: experimental + brief: > + The name of the K8s volume. + examples: [ 'volume0' ] + - id: volume.type + stability: experimental + brief: > + The type of the K8s volume. + examples: [ "emptyDir", "persistentVolumeClaim" ] + type: + allow_custom_values: true + members: + - id: persistentvolumeclaim + value: 'persistentVolumeClaim' + brief: "A [persistentVolumeClaim](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim) volume" + stability: experimental + - id: configmap + value: 'configMap' + brief: "A [configMap](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap) volume" + stability: experimental + - id: downwardapi + value: 'downwardAPI' + brief: "A [downwardAPI](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi) volume" + stability: experimental + - id: emptydir + value: 'emptyDir' + brief: "An [emptyDir](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume" + stability: experimental + - id: secret + value: 'secret' + brief: "A [secret](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#secret) volume" + stability: experimental + - id: local + value: 'local' + brief: "A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume" + stability: experimental + - id: awselasticblockstore + value: 'awsElasticBlockStore' + brief: "An [awsElasticBlockStore](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#awselasticblockstore) volume" + stability: experimental + - id: gcepersistentdisk + value: 'gcePersistentDisk' + brief: "A [gcePersistentDisk](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk) volume" + stability: experimental + - id: glusterfs + value: 'glusterfs' + brief: "A [glusterfs](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#glusterfs) volume" + stability: experimental diff --git a/model/resource/k8s.yaml b/model/resource/k8s.yaml index 46522ca7d9..f7d38d8c84 100644 --- a/model/resource/k8s.yaml +++ b/model/resource/k8s.yaml @@ -89,3 +89,12 @@ groups: attributes: - ref: k8s.cronjob.uid - ref: k8s.cronjob.name + + - id: k8s.volume + prefix: k8s.volume + type: resource + brief: > + A Kubernetes Volume. + attributes: + - ref: k8s.volume.name + - ref: k8s.volume.type From 291b857938c9148e3af31173bbbd20be9b3c833d Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 19 Jul 2024 09:34:26 +0300 Subject: [PATCH 2/5] remove attributes from resource Signed-off-by: ChrsMark --- .chloggen/add_k8s_volume_type.yaml | 2 +- model/resource/k8s.yaml | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.chloggen/add_k8s_volume_type.yaml b/.chloggen/add_k8s_volume_type.yaml index 0e3c71bfeb..99f3aed702 100755 --- a/.chloggen/add_k8s_volume_type.yaml +++ b/.chloggen/add_k8s_volume_type.yaml @@ -10,7 +10,7 @@ change_type: enhancement component: k8s # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Adds k8s.volume.name and k8s.volume.type +note: Adds k8s.volume.name and k8s.volume.type in the registry # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. # The values here must be integers. diff --git a/model/resource/k8s.yaml b/model/resource/k8s.yaml index f7d38d8c84..46522ca7d9 100644 --- a/model/resource/k8s.yaml +++ b/model/resource/k8s.yaml @@ -89,12 +89,3 @@ groups: attributes: - ref: k8s.cronjob.uid - ref: k8s.cronjob.name - - - id: k8s.volume - prefix: k8s.volume - type: resource - brief: > - A Kubernetes Volume. - attributes: - - ref: k8s.volume.name - - ref: k8s.volume.type From 908ae1862f5b052409c1a6080211cadef2e1be01 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 2 Aug 2024 13:43:10 +0300 Subject: [PATCH 3/5] update schema Signed-off-by: ChrsMark --- model/registry/k8s.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/registry/k8s.yaml b/model/registry/k8s.yaml index 635b444d6b..a72a0965fe 100644 --- a/model/registry/k8s.yaml +++ b/model/registry/k8s.yaml @@ -177,13 +177,13 @@ groups: brief: > The name of the CronJob. examples: ['opentelemetry'] - - id: volume.name + - id: k8s.volume.name type: string stability: experimental brief: > The name of the K8s volume. examples: [ 'volume0' ] - - id: volume.type + - id: k8s.volume.type stability: experimental brief: > The type of the K8s volume. From 5648d44bcddc73a51324a16374112aeeebeb9099 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Mon, 5 Aug 2024 09:19:09 +0300 Subject: [PATCH 4/5] address review comments Signed-off-by: ChrsMark --- .chloggen/add_k8s_volume_type.yaml | 2 +- docs/attributes-registry/k8s.md | 1 - model/registry/k8s.yaml | 15 +++++---------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.chloggen/add_k8s_volume_type.yaml b/.chloggen/add_k8s_volume_type.yaml index 99f3aed702..c9be5f9027 100755 --- a/.chloggen/add_k8s_volume_type.yaml +++ b/.chloggen/add_k8s_volume_type.yaml @@ -10,7 +10,7 @@ change_type: enhancement component: k8s # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Adds k8s.volume.name and k8s.volume.type in the registry +note: Adds `k8s.volume.name` and `k8s.volume.type` attributes to the registry # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. # The values here must be integers. diff --git a/docs/attributes-registry/k8s.md b/docs/attributes-registry/k8s.md index 829c5bf0d0..a885ed4da8 100644 --- a/docs/attributes-registry/k8s.md +++ b/docs/attributes-registry/k8s.md @@ -69,7 +69,6 @@ conflict. | Value | Description | Stability | | ----------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | -| `awsElasticBlockStore` | An [awsElasticBlockStore](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#awselasticblockstore) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `configMap` | A [configMap](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `downwardAPI` | A [downwardAPI](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `emptyDir` | An [emptyDir](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/registry/k8s.yaml b/model/registry/k8s.yaml index a72a0965fe..8d63e3fc83 100644 --- a/model/registry/k8s.yaml +++ b/model/registry/k8s.yaml @@ -189,21 +189,20 @@ groups: The type of the K8s volume. examples: [ "emptyDir", "persistentVolumeClaim" ] type: - allow_custom_values: true members: - - id: persistentvolumeclaim + - id: persistent_volume_claim value: 'persistentVolumeClaim' brief: "A [persistentVolumeClaim](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim) volume" stability: experimental - - id: configmap + - id: config_map value: 'configMap' brief: "A [configMap](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap) volume" stability: experimental - - id: downwardapi + - id: downward_api value: 'downwardAPI' brief: "A [downwardAPI](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi) volume" stability: experimental - - id: emptydir + - id: empty_dir value: 'emptyDir' brief: "An [emptyDir](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume" stability: experimental @@ -215,11 +214,7 @@ groups: value: 'local' brief: "A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume" stability: experimental - - id: awselasticblockstore - value: 'awsElasticBlockStore' - brief: "An [awsElasticBlockStore](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#awselasticblockstore) volume" - stability: experimental - - id: gcepersistentdisk + - id: gce_persistent_disk value: 'gcePersistentDisk' brief: "A [gcePersistentDisk](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk) volume" stability: experimental From 013e44897562284b8c07b731fe1a428b4431ba53 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 6 Aug 2024 09:56:47 +0300 Subject: [PATCH 5/5] remove deprecated types Signed-off-by: ChrsMark --- docs/attributes-registry/k8s.md | 2 -- model/registry/k8s.yaml | 8 -------- 2 files changed, 10 deletions(-) diff --git a/docs/attributes-registry/k8s.md b/docs/attributes-registry/k8s.md index a885ed4da8..6f4bf8cafe 100644 --- a/docs/attributes-registry/k8s.md +++ b/docs/attributes-registry/k8s.md @@ -72,8 +72,6 @@ conflict. | `configMap` | A [configMap](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `downwardAPI` | A [downwardAPI](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `emptyDir` | An [emptyDir](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gcePersistentDisk` | A [gcePersistentDisk](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `glusterfs` | A [glusterfs](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#glusterfs) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `local` | A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `persistentVolumeClaim` | A [persistentVolumeClaim](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `secret` | A [secret](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#secret) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/registry/k8s.yaml b/model/registry/k8s.yaml index 8d63e3fc83..6767f3575e 100644 --- a/model/registry/k8s.yaml +++ b/model/registry/k8s.yaml @@ -214,11 +214,3 @@ groups: value: 'local' brief: "A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume" stability: experimental - - id: gce_persistent_disk - value: 'gcePersistentDisk' - brief: "A [gcePersistentDisk](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk) volume" - stability: experimental - - id: glusterfs - value: 'glusterfs' - brief: "A [glusterfs](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#glusterfs) volume" - stability: experimental