Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container: add CSI attributes #1337

Merged
merged 21 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .chloggen/add_k8s_csi_attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
change_type: enhancement
component: k8s
note: Add `csi.driver` and `csi.volume.handle` attributes.
issues: [1119]
subtext:
10 changes: 8 additions & 2 deletions docs/attributes-registry/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ Kubernetes resource attributes.

| Attribute | Type | Description | Examples | Stability |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `csi.driver` | string | The name of the CSI driver used by the volume. [1] | `pd.csi.storage.gke.io` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
| `csi.volume.handle` | string | The unique volume name returned by the CSI volume plugin's CreateVolume. [2] | `projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.cluster.name` | string | The name of the cluster. | `opentelemetry-cluster` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.cluster.uid` | string | A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.cluster.uid` | string | A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. [3] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.container.name` | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.container.restart_count` | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.container.status.last_terminated_reason` | string | Last terminated reason of the Container. | `Evicted`; `Error` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand All @@ -42,7 +44,11 @@ Kubernetes resource attributes.
| `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
**[1]:** This maps 1:1 to [CSIPersistentVolumeSource.driver](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#csipersistentvolumesource-v1-core).

**[2]:** This maps 1:1 to [CSIPersistentVolumeSource.volumeHandle](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#csipersistentvolumesource-v1-core).

**[3]:** 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
Expand Down
18 changes: 18 additions & 0 deletions model/registry/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,21 @@ groups:
value: 'local'
brief: "A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume"
stability: experimental
- id: csi.driver
type: string
stability: experimental
brief: >
The name of the Container Storage Interface (CSI) driver used by the volume.
note: >
This maps 1:1 to [CSIPersistentVolumeSource.driver](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#csipersistentvolumesource-v1-core).
examples:
- "pd.csi.storage.gke.io"
- id: csi.volume.handle
type: string
stability: experimental
brief: >
The unique volume name returned by the Container Storage Interface (CSI) volume plugin's CreateVolume.
note: >
This maps 1:1 to [CSIPersistentVolumeSource.volumeHandle](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#csipersistentvolumesource-v1-core).
examples:
- "projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk"
Loading