diff --git a/.chloggen/add_k8s_resources.yaml b/.chloggen/add_k8s_resources.yaml new file mode 100755 index 000000000..298d568bd --- /dev/null +++ b/.chloggen/add_k8s_resources.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: Add `k8s.hpa`, `k8s.resourcequota` and `k8s.replicationcontroller` attributes and resources + +# 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: [1656] + +# (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 cfaf8809c..7054ae191 100644 --- a/docs/attributes-registry/k8s.md +++ b/docs/attributes-registry/k8s.md @@ -23,6 +23,8 @@ Kubernetes resource attributes. | `k8s.daemonset.uid` | string | The UID of the DaemonSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.deployment.name` | string | The name of the Deployment. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.deployment.uid` | string | The UID of the Deployment. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.hpa.name` | string | The name of the horizontal pod autoscaler. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.hpa.uid` | string | The UID of the horizontal pod autoscaler. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.job.name` | string | The name of the Job. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.job.uid` | string | The UID of the Job. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.namespace.name` | string | The name of the namespace that the pod is running in. | `default` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -35,6 +37,10 @@ Kubernetes resource attributes. | `k8s.pod.uid` | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.replicaset.name` | string | The name of the ReplicaSet. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.replicaset.uid` | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.replicationcontroller.name` | string | The name of the replication controller. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.replicationcontroller.uid` | string | The UID of the replication controller. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.resourcequota.name` | string | The name of the resource quota. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.resourcequota.uid` | string | The UID of the resource quota. | `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) | diff --git a/docs/resource/k8s.md b/docs/resource/k8s.md index c06e68065..9cf66d0ed 100644 --- a/docs/resource/k8s.md +++ b/docs/resource/k8s.md @@ -353,4 +353,89 @@ A CronJob creates Jobs on a repeating schedule. +## ReplicationController + +A ReplicationController ensures that a specified number of pod replicas are running at any one time. + + + + + + + + + +**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue) + +**type:** `k8s.replicationcontroller` + +**Description:** A Kubernetes ReplicationController object. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`k8s.replicationcontroller.name`](/docs/attributes-registry/k8s.md) | string | The name of the replication controller. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`k8s.replicationcontroller.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the replication controller. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +## HorizontalPodAutoscaler + +A HorizontalPodAutoscaler (HPA for short) automatically updates a workload resource +(such as a Deployment or StatefulSet), with the aim of automatically scaling the workload to match demand. + + + + + + + + + +**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue) + +**type:** `k8s.hpa` + +**Description:** A Kubernetes HorizontalPodAutoscaler object. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`k8s.hpa.name`](/docs/attributes-registry/k8s.md) | string | The name of the horizontal pod autoscaler. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`k8s.hpa.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the horizontal pod autoscaler. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +## ResourceQuota + +A ResourceQuota provides constraints that limit aggregate resource consumption per namespace. + + + + + + + + + +**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue) + +**type:** `k8s.resourcequota` + +**Description:** A Kubernetes ResourceQuota object. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`k8s.resourcequota.name`](/docs/attributes-registry/k8s.md) | string | The name of the resource quota. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`k8s.resourcequota.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the resource quota. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 528eca056..c38ea67c2 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -524,6 +524,9 @@ This metric is [recommended][MetricRecommended]. **[1]:** This metric aligns with the `replicas` field of the [K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core) +This metric SHOULD, at a minimum, be reported against a +[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource. + @@ -547,6 +550,9 @@ This metric is [recommended][MetricRecommended]. **[1]:** This metric aligns with the `availableReplicas` field of the [K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core) +This metric SHOULD, at a minimum, be reported against a +[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource. + @@ -682,6 +688,9 @@ This metric is [recommended][MetricRecommended]. **[1]:** This metric aligns with the `desiredReplicas` field of the [K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling) +This metric SHOULD, at a minimum, be reported against a +[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource. + @@ -705,6 +714,9 @@ This metric is [recommended][MetricRecommended]. **[1]:** This metric aligns with the `currentReplicas` field of the [K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling) +This metric SHOULD, at a minimum, be reported against a +[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource. + @@ -728,6 +740,9 @@ This metric is [recommended][MetricRecommended]. **[1]:** This metric aligns with the `maxReplicas` field of the [K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling) +This metric SHOULD, at a minimum, be reported against a +[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource. + @@ -751,6 +766,9 @@ This metric is [recommended][MetricRecommended]. **[1]:** This metric aligns with the `minReplicas` field of the [K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling) +This metric SHOULD, at a minimum, be reported against a +[`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource. + diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index eb4fe19c9..d60e89328 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -193,6 +193,9 @@ groups: note: | This metric aligns with the `replicas` field of the [K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core) + + This metric SHOULD, at a minimum, be reported against a + [`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource. instrument: updowncounter unit: "{pod}" - id: metric.k8s.replication_controller.available_pods @@ -204,6 +207,9 @@ groups: note: | This metric aligns with the `availableReplicas` field of the [K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core) + + This metric SHOULD, at a minimum, be reported against a + [`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource. instrument: updowncounter unit: "{pod}" @@ -271,6 +277,9 @@ groups: note: | This metric aligns with the `desiredReplicas` field of the [K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling) + + This metric SHOULD, at a minimum, be reported against a + [`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource. instrument: updowncounter unit: "{pod}" - id: metric.k8s.hpa.current_pods @@ -282,6 +291,9 @@ groups: note: | This metric aligns with the `currentReplicas` field of the [K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling) + + This metric SHOULD, at a minimum, be reported against a + [`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource. instrument: updowncounter unit: "{pod}" - id: metric.k8s.hpa.max_pods @@ -293,6 +305,9 @@ groups: note: | This metric aligns with the `maxReplicas` field of the [K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling) + + This metric SHOULD, at a minimum, be reported against a + [`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource. instrument: updowncounter unit: "{pod}" - id: metric.k8s.hpa.min_pods @@ -304,6 +319,9 @@ groups: note: | This metric aligns with the `minReplicas` field of the [K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling) + + This metric SHOULD, at a minimum, be reported against a + [`k8s.hpa`](../resource/k8s.md#horizontalpodautoscaler) resource. instrument: updowncounter unit: "{pod}" diff --git a/model/k8s/registry.yaml b/model/k8s/registry.yaml index c9b639b69..4ec017fdc 100644 --- a/model/k8s/registry.yaml +++ b/model/k8s/registry.yaml @@ -117,6 +117,30 @@ groups: brief: > The name of the ReplicaSet. examples: ['opentelemetry'] + - id: k8s.replicationcontroller.uid + type: string + stability: experimental + brief: > + The UID of the replication controller. + examples: [ '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' ] + - id: k8s.replicationcontroller.name + type: string + stability: experimental + brief: > + The name of the replication controller. + examples: [ 'opentelemetry' ] + - id: k8s.resourcequota.uid + type: string + stability: experimental + brief: > + The UID of the resource quota. + examples: [ '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' ] + - id: k8s.resourcequota.name + type: string + stability: experimental + brief: > + The name of the resource quota. + examples: [ 'opentelemetry' ] - id: k8s.deployment.uid type: string stability: experimental @@ -153,6 +177,18 @@ groups: brief: > The name of the DaemonSet. examples: ['opentelemetry'] + - id: k8s.hpa.uid + type: string + stability: experimental + brief: > + The UID of the horizontal pod autoscaler. + examples: ['275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'] + - id: k8s.hpa.name + type: string + stability: experimental + brief: > + The name of the horizontal pod autoscaler. + examples: ['opentelemetry'] - id: k8s.job.uid type: string stability: experimental diff --git a/model/k8s/resources.yaml b/model/k8s/resources.yaml index 5448985ba..fe7145108 100644 --- a/model/k8s/resources.yaml +++ b/model/k8s/resources.yaml @@ -111,3 +111,33 @@ groups: attributes: - ref: k8s.cronjob.uid - ref: k8s.cronjob.name + + - id: resource.k8s.replicationcontroller + type: resource + stability: experimental + name: k8s.replicationcontroller + brief: > + A Kubernetes ReplicationController object. + attributes: + - ref: k8s.replicationcontroller.uid + - ref: k8s.replicationcontroller.name + + - id: resource.k8s.hpa + type: resource + stability: experimental + name: k8s.hpa + brief: > + A Kubernetes HorizontalPodAutoscaler object. + attributes: + - ref: k8s.hpa.uid + - ref: k8s.hpa.name + + - id: resource.k8s.resourcequota + type: resource + stability: experimental + name: k8s.resourcequota + brief: > + A Kubernetes ResourceQuota object. + attributes: + - ref: k8s.resourcequota.uid + - ref: k8s.resourcequota.name