Skip to content

Commit

Permalink
Add k8s.volume.{name,type} attributes
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <[email protected]>
  • Loading branch information
ChrsMark committed Jul 16, 2024
1 parent 4e7c42e commit c27b687
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .chloggen/add_k8s_volume_type.yaml
Original file line number Diff line number Diff line change
@@ -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:
16 changes: 16 additions & 0 deletions docs/attributes-registry/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
50 changes: 50 additions & 0 deletions model/registry/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,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
9 changes: 9 additions & 0 deletions model/resource/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,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

0 comments on commit c27b687

Please sign in to comment.