diff --git a/.chloggen/add_deploy_replica_metrics.yaml b/.chloggen/add_deploy_replica_metrics.yaml new file mode 100755 index 0000000000..09a9bea9c8 --- /dev/null +++ b/.chloggen/add_deploy_replica_metrics.yaml @@ -0,0 +1,25 @@ +# 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 metrics for k8s deployment, replicaset, replication_controller, statefulset and hpa. + +# 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: [1636, 1637, 1644] + +# (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: | + This addition focused on providing consistency between these metrics, while + also ensuring alignment with recommendations from Kubernetes. + More details in https://github.com/open-telemetry/semantic-conventions/issues/1637 diff --git a/docs/non-normative/k8s-migration.md b/docs/non-normative/k8s-migration.md index 8a8f305dac..6d55cdfdc6 100644 --- a/docs/non-normative/k8s-migration.md +++ b/docs/non-normative/k8s-migration.md @@ -43,6 +43,11 @@ and one for disabling the old schema called `semconv.k8s.disableLegacy`. Then: - [Summary of changes](#summary-of-changes) - [K8s network metrics](#k8s-network-metrics) + - [K8s Deployment metrics](#k8s-deployment-metrics) + - [K8s ReplicaSet metrics](#k8s-replicaset-metrics) + - [K8s ReplicationController metrics](#k8s-replicationcontroller-metrics) + - [K8s StatefulsSet metrics](#k8s-statefulsset-metrics) + - [K8s HorizontalPodAutoscaler metrics](#k8s-horizontalpodautoscaler-metrics) @@ -56,13 +61,115 @@ to bring the conventions to stable (TODO: link to specific version once it exist The K8s network metrics implemented by the Collector and specifically the [kubeletstats](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.112.0/receiver/kubeletstatsreceiver/documentation.md) -receiver were introduced as semantic conventions in [v1.29.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/system/k8s-metrics.md). +receiver were introduced as semantic conventions +in [v1.29.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/system/k8s-metrics.md). The changes in their attributes are the following: -| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | -|------------------------------------------------------------------------------------|---------------------------| -| `interface` | `network.interface.name` | -| `direction` | `network.io.direction` | + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|--------------------------| +| `interface` | `network.interface.name` | +| `direction` | `network.io.direction` | + + + +### K8s Deployment metrics + +The K8s Deployment metrics implemented by the Collector and specifically the +[k8scluster](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.115.0/receiver/k8sclusterreceiver/documentation.md) +receiver were introduced as semantic conventions in +[#1636](https://github.com/open-telemetry/semantic-conventions/pull/1636) (TODO: replace with SemConv version once +available). + +The changes in their metric names and types are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|--------------------------------------------------------------| +| `k8s.deployment.desired` (type: `gauge`) | `k8s.deployment.desired_pods` (type: `updowncounter`) | +| `k8s.deployment.available` (type: `gauge`) | `k8s.deployment.available_pods` (type: `updowncounter`) | + + + +### K8s ReplicaSet metrics + +The K8s ReplicaSet metrics implemented by the Collector and specifically the +[k8scluster](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.115.0/receiver/k8sclusterreceiver/documentation.md) +receiver were introduced as semantic conventions in +[#1636](https://github.com/open-telemetry/semantic-conventions/pull/1636) (TODO: replace with SemConv version once +available). + +The changes in their metric names and types are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|---------------------------------------------------------| +| `k8s.replicaset.desired` (type: `gauge`) | `k8s.replicaset.desired_pods` (type: `updowncounter`) | +| `k8s.replicaset.available` (type: `gauge`) | `k8s.replicaset.available_pods` (type: `updowncounter`) | + + + +### K8s ReplicationController metrics + +The K8s ReplicationController metrics implemented by the Collector and specifically the +[k8scluster](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.115.0/receiver/k8sclusterreceiver/documentation.md) +receiver were introduced as semantic conventions in +[#1636](https://github.com/open-telemetry/semantic-conventions/pull/1636) (TODO: replace with SemConv version once +available). + +The changes in their metric names and types are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|---------------------------------------------------------------------| +| `k8s.replication_controller.desired` (type: `gauge`) | `k8s.replication_controller.desired_pods` (type: `updowncounter`) | +| `k8s.replication_controller.available` (type: `gauge`) | `k8s.replication_controller.available_pods` (type: `updowncounter`) | + + + +### K8s StatefulsSet metrics + +The K8s StatefulsSet metrics implemented by the Collector and specifically the +[k8scluster](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.115.0/receiver/k8sclusterreceiver/documentation.md) +receiver were introduced as semantic conventions in +[#1636](https://github.com/open-telemetry/semantic-conventions/pull/1636) (TODO: replace with SemConv version once +available). + +The changes in their metric types are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|----------------------------------------------------------| +| `k8s.statefulset.desired_pods` (type: `gauge`) | `k8s.statefulset.desired_pods` (type: `updowncounter`) | +| `k8s.statefulset.ready_pods` (type: `gauge`) | `k8s.statefulset.ready_pods` (type: `updowncounter`) | +| `k8s.statefulset.current_pods` (type: `gauge`) | `k8s.statefulset.current_pods` (type: `updowncounter`) | +| `k8s.statefulset.updated_pods` (type: `gauge`) | `k8s.statefulset.updated_pods` (type: `updowncounter`) | + + + +### K8s HorizontalPodAutoscaler metrics + +The K8s HorizontalPodAutoscaler metrics implemented by the Collector and specifically the +[k8scluster](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.115.0/receiver/k8sclusterreceiver/documentation.md) +receiver were introduced as semantic conventions in +[#1636](https://github.com/open-telemetry/semantic-conventions/pull/1636) (TODO: replace with SemConv version once +available). + +The changes in their metric names and types are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|------------------------------------------------| +| `k8s.hpa.desired_replicas` (type: `gauge`) | `k8s.hpa.desired_pods` (type: `updowncounter`) | +| `k8s.hpa.current_replicas` (type: `gauge`) | `k8s.hpa.current_pods` (type: `updowncounter`) | +| `k8s.hpa.max_replicas` (type: `gauge`) | `k8s.hpa.max_pods` (type: `updowncounter`) | +| `k8s.hpa.min_replicas` (type: `gauge`) | `k8s.hpa.min_pods` (type: `updowncounter`) | + diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 9187ddf2db..cd15ca5e98 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -15,6 +15,50 @@ well-defined APIs (e.g. Kubelet's API). Metrics in `k8s.` instruments SHOULD be attached to a [K8s Resource](/docs/resource/k8s.md) and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`. + + + + +- [Pod Metrics](#pod-metrics) + - [Metric: `k8s.pod.uptime`](#metric-k8spoduptime) + - [Metric: `k8s.pod.cpu.time`](#metric-k8spodcputime) + - [Metric: `k8s.pod.cpu.usage`](#metric-k8spodcpuusage) + - [Metric: `k8s.pod.memory.usage`](#metric-k8spodmemoryusage) + - [Metric: `k8s.pod.network.io`](#metric-k8spodnetworkio) + - [Metric: `k8s.pod.network.errors`](#metric-k8spodnetworkerrors) +- [Node Metrics](#node-metrics) + - [Metric: `k8s.node.uptime`](#metric-k8snodeuptime) + - [Metric: `k8s.node.cpu.time`](#metric-k8snodecputime) + - [Metric: `k8s.node.cpu.usage`](#metric-k8snodecpuusage) + - [Metric: `k8s.node.memory.usage`](#metric-k8snodememoryusage) + - [Metric: `k8s.node.network.io`](#metric-k8snodenetworkio) + - [Metric: `k8s.node.network.errors`](#metric-k8snodenetworkerrors) +- [Deployment Metrics](#deployment-metrics) + - [Metric: `k8s.deployment.desired_pods`](#metric-k8sdeploymentdesired_pods) + - [Metric: `k8s.deployment.available_pods`](#metric-k8sdeploymentavailable_pods) +- [ReplicaSet Metrics](#replicaset-metrics) + - [Metric: `k8s.replicaset.desired_pods`](#metric-k8sreplicasetdesired_pods) + - [Metric: `k8s.replicaset.available_pods`](#metric-k8sreplicasetavailable_pods) +- [ReplicationController Metrics](#replicationcontroller-metrics) + - [Metric: `k8s.replication_controller.desired_pods`](#metric-k8sreplication_controllerdesired_pods) + - [Metric: `k8s.replication_controller.available_pods`](#metric-k8sreplication_controlleravailable_pods) +- [StatefulSet Metrics](#statefulset-metrics) + - [Metric: `k8s.statefulset.desired_pods`](#metric-k8sstatefulsetdesired_pods) + - [Metric: `k8s.statefulset.ready_pods`](#metric-k8sstatefulsetready_pods) + - [Metric: `k8s.statefulset.current_pods`](#metric-k8sstatefulsetcurrent_pods) + - [Metric: `k8s.statefulset.updated_pods`](#metric-k8sstatefulsetupdated_pods) +- [HorizontalPodAutoscaler Metrics](#horizontalpodautoscaler-metrics) + - [Metric: `k8s.hpa.desired_pods`](#metric-k8shpadesired_pods) + - [Metric: `k8s.hpa.current_pods`](#metric-k8shpacurrent_pods) + - [Metric: `k8s.hpa.max_pods`](#metric-k8shpamax_pods) + - [Metric: `k8s.hpa.min_pods`](#metric-k8shpamin_pods) + + + +## Pod Metrics + +**Description:** Pod level metrics captured under the namespace `k8s.pod`. + ### Metric: `k8s.pod.uptime` This metric is [recommended][MetricRecommended]. @@ -172,6 +216,10 @@ This metric is [recommended][MetricRecommended]. +## Node Metrics + +**Description:** Node level metrics captured under the namespace `k8s.node`. + ### Metric: `k8s.node.uptime` This metric is [recommended][MetricRecommended]. @@ -329,5 +377,371 @@ This metric is [recommended][MetricRecommended]. +## Deployment Metrics + +**Description:** Deployment level metrics captured under the namespace `k8s.deployment`. + +### Metric: `k8s.deployment.desired_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.deployment.desired_pods` | UpDownCounter | `{pod}` | Number of desired replica pods in this deployment [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `replicas` field of the +[K8s DeploymentSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentspec-v1-apps). + +This metric SHOULD, at a minimum, be reported against a +[`k8s.deployment`](../resource/k8s.md#deployment) resource. + + + + + + +### Metric: `k8s.deployment.available_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.deployment.available_pods` | UpDownCounter | `{pod}` | Total number of available replica pods (ready for at least minReadySeconds) targeted by this deployment [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `availableReplicas` field of the +[K8s DeploymentStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps). + +This metric SHOULD, at a minimum, be reported against a +[`k8s.deployment`](../resource/k8s.md#deployment) resource. + + + + + + +## ReplicaSet Metrics + +**Description:** ReplicaSet level metrics captured under the namespace `k8s.replicaset`. + +### Metric: `k8s.replicaset.desired_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.replicaset.desired_pods` | UpDownCounter | `{pod}` | Number of desired replica pods in this replicaset [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `replicas` field of the +[K8s ReplicaSetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetspec-v1-apps). + +This metric SHOULD, at a minimum, be reported against a +[`k8s.replicaset`](../resource/k8s.md#replicaset) resource. + + + + + + +### Metric: `k8s.replicaset.available_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.replicaset.available_pods` | UpDownCounter | `{pod}` | Total number of available replica pods (ready for at least minReadySeconds) targeted by this replicaset [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `availableReplicas` field of the +[K8s ReplicaSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps). + +This metric SHOULD, at a minimum, be reported against a +[`k8s.replicaset`](../resource/k8s.md#replicaset) resource. + + + + + + +## ReplicationController Metrics + +**Description:** ReplicationController level metrics captured under the namespace `k8s.replication_controller`. + +### Metric: `k8s.replication_controller.desired_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.replication_controller.desired_pods` | UpDownCounter | `{pod}` | Number of desired replica pods in this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[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) + + + + + + +### Metric: `k8s.replication_controller.available_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.replication_controller.available_pods` | UpDownCounter | `{pod}` | Total number of available replica pods (ready for at least minReadySeconds) targeted by this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[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) + + + + + + +## StatefulSet Metrics + +**Description:** StatefulSet level metrics captured under the namespace `k8s.statefulset`. + +### Metric: `k8s.statefulset.desired_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.statefulset.desired_pods` | UpDownCounter | `{pod}` | Number of desired replica pods in this statefulset [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `replicas` field of the +[K8s StatefulSetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetspec-v1-apps). + +This metric SHOULD, at a minimum, be reported against a +[`k8s.statefulset`](../resource/k8s.md#statefulset) resource. + + + + + + +### Metric: `k8s.statefulset.ready_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.statefulset.ready_pods` | UpDownCounter | `{pod}` | The number of replica pods created for this statefulset with a Ready Condition [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `readyReplicas` field of the +[K8s StatefulSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetstatus-v1-apps). + +This metric SHOULD, at a minimum, be reported against a +[`k8s.statefulset`](../resource/k8s.md#statefulset) resource. + + + + + + +### Metric: `k8s.statefulset.current_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.statefulset.current_pods` | UpDownCounter | `{pod}` | The number of replica pods created by the statefulset controller from the statefulset version indicated by currentRevision [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `currentReplicas` field of the +[K8s StatefulSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetstatus-v1-apps). + +This metric SHOULD, at a minimum, be reported against a +[`k8s.statefulset`](../resource/k8s.md#statefulset) resource. + + + + + + +### Metric: `k8s.statefulset.updated_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.statefulset.updated_pods` | UpDownCounter | `{pod}` | Number of replica pods created by the statefulset controller from the statefulset version indicated by updateRevision [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `updatedReplicas` field of the +[K8s StatefulSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetstatus-v1-apps). + +This metric SHOULD, at a minimum, be reported against a +[`k8s.statefulset`](../resource/k8s.md#statefulset) resource. + + + + + + +## HorizontalPodAutoscaler Metrics + +**Description:** HorizontalPodAutoscaler level metrics captured under the namespace `k8s.hpa`. + +### Metric: `k8s.hpa.desired_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.hpa.desired_pods` | UpDownCounter | `{pod}` | Desired number of replica pods managed by this horizontal pod autoscaler, as last calculated by the autoscaler [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[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) + + + + + + +### Metric: `k8s.hpa.current_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.hpa.current_pods` | UpDownCounter | `{pod}` | Current number of replica pods managed by this horizontal pod autoscaler, as last seen by the autoscaler [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[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) + + + + + + +### Metric: `k8s.hpa.max_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.hpa.max_pods` | UpDownCounter | `{pod}` | The upper limit for the number of replica pods to which the autoscaler can scale up [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[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) + + + + + + +### Metric: `k8s.hpa.min_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.hpa.min_pods` | UpDownCounter | `{pod}` | The lower limit for the number of replica pods to which the autoscaler can scale down [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[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) + + + + + + [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status [MetricRecommended]: /docs/general/metric-requirement-level.md#recommended diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index 7afd7ec20d..6d954230e1 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -126,3 +126,183 @@ groups: attributes: - ref: network.interface.name - ref: network.io.direction + + # k8s.deployment.* metrics + - id: metric.k8s.deployment.desired_pods + type: metric + metric_name: k8s.deployment.desired_pods + stability: experimental + brief: "Number of desired replica pods in this deployment" + note: | + This metric aligns with the `replicas` field of the + [K8s DeploymentSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentspec-v1-apps). + + This metric SHOULD, at a minimum, be reported against a + [`k8s.deployment`](../resource/k8s.md#deployment) resource. + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.deployment.available_pods + type: metric + metric_name: k8s.deployment.available_pods + stability: experimental + brief: "Total number of available replica pods (ready for at least minReadySeconds) targeted by this deployment" + note: | + This metric aligns with the `availableReplicas` field of the + [K8s DeploymentStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps). + + This metric SHOULD, at a minimum, be reported against a + [`k8s.deployment`](../resource/k8s.md#deployment) resource. + instrument: updowncounter + unit: "{pod}" + + # k8s.replicaset.* metrics + - id: metric.k8s.replicaset.desired_pods + type: metric + metric_name: k8s.replicaset.desired_pods + stability: experimental + brief: "Number of desired replica pods in this replicaset" + note: | + This metric aligns with the `replicas` field of the + [K8s ReplicaSetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetspec-v1-apps). + + This metric SHOULD, at a minimum, be reported against a + [`k8s.replicaset`](../resource/k8s.md#replicaset) resource. + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.replicaset.available_pods + type: metric + metric_name: k8s.replicaset.available_pods + stability: experimental + brief: "Total number of available replica pods (ready for at least minReadySeconds) targeted by this replicaset" + note: | + This metric aligns with the `availableReplicas` field of the + [K8s ReplicaSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps). + + This metric SHOULD, at a minimum, be reported against a + [`k8s.replicaset`](../resource/k8s.md#replicaset) resource. + instrument: updowncounter + unit: "{pod}" + + # k8s.replication_controller.* metrics + - id: metric.k8s.replication_controller.desired_pods + type: metric + metric_name: k8s.replication_controller.desired_pods + stability: experimental + brief: "Number of desired replica pods in this replication controller" + # TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented + 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) + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.replication_controller.available_pods + type: metric + metric_name: k8s.replication_controller.available_pods + stability: experimental + brief: "Total number of available replica pods (ready for at least minReadySeconds) targeted by this replication controller" + # TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented + 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) + instrument: updowncounter + unit: "{pod}" + + # k8s.statefulset.* metrics + - id: metric.k8s.statefulset.desired_pods + type: metric + metric_name: k8s.statefulset.desired_pods + stability: experimental + brief: "Number of desired replica pods in this statefulset" + note: | + This metric aligns with the `replicas` field of the + [K8s StatefulSetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetspec-v1-apps). + + This metric SHOULD, at a minimum, be reported against a + [`k8s.statefulset`](../resource/k8s.md#statefulset) resource. + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.statefulset.ready_pods + type: metric + metric_name: k8s.statefulset.ready_pods + stability: experimental + brief: "The number of replica pods created for this statefulset with a Ready Condition" + note: | + This metric aligns with the `readyReplicas` field of the + [K8s StatefulSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetstatus-v1-apps). + + This metric SHOULD, at a minimum, be reported against a + [`k8s.statefulset`](../resource/k8s.md#statefulset) resource. + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.statefulset.current_pods + type: metric + metric_name: k8s.statefulset.current_pods + stability: experimental + brief: "The number of replica pods created by the statefulset controller from the statefulset version indicated by currentRevision" + note: | + This metric aligns with the `currentReplicas` field of the + [K8s StatefulSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetstatus-v1-apps). + + This metric SHOULD, at a minimum, be reported against a + [`k8s.statefulset`](../resource/k8s.md#statefulset) resource. + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.statefulset.updated_pods + type: metric + metric_name: k8s.statefulset.updated_pods + stability: experimental + brief: "Number of replica pods created by the statefulset controller from the statefulset version indicated by updateRevision" + note: | + This metric aligns with the `updatedReplicas` field of the + [K8s StatefulSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#statefulsetstatus-v1-apps). + + This metric SHOULD, at a minimum, be reported against a + [`k8s.statefulset`](../resource/k8s.md#statefulset) resource. + instrument: updowncounter + unit: "{pod}" + + # k8s.hpa.* metrics + - id: metric.k8s.hpa.desired_pods + type: metric + metric_name: k8s.hpa.desired_pods + stability: experimental + brief: "Desired number of replica pods managed by this horizontal pod autoscaler, as last calculated by the autoscaler" + # TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented + 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) + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.hpa.current_pods + type: metric + metric_name: k8s.hpa.current_pods + stability: experimental + brief: "Current number of replica pods managed by this horizontal pod autoscaler, as last seen by the autoscaler" + # TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented + 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) + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.hpa.max_pods + type: metric + metric_name: k8s.hpa.max_pods + stability: experimental + brief: "The upper limit for the number of replica pods to which the autoscaler can scale up" + # TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented + 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) + instrument: updowncounter + unit: "{pod}" + - id: metric.k8s.hpa.min_pods + type: metric + metric_name: k8s.hpa.min_pods + stability: experimental + brief: "The lower limit for the number of replica pods to which the autoscaler can scale down" + # TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented + 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) + instrument: updowncounter + unit: "{pod}"