From 08585128e365d49ebcd1eb11df0cb9384bd23fc1 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 29 Nov 2024 17:02:20 +0200 Subject: [PATCH 01/11] add desired and available metrics for deployment and replicaset Signed-off-by: ChrsMark --- .chloggen/add_deploy_replica_metrics.yaml | 22 ++++ docs/system/k8s-metrics.md | 123 ++++++++++++++++++++++ model/k8s/metrics.yaml | 32 ++++++ 3 files changed, 177 insertions(+) create mode 100755 .chloggen/add_deploy_replica_metrics.yaml diff --git a/.chloggen/add_deploy_replica_metrics.yaml b/.chloggen/add_deploy_replica_metrics.yaml new file mode 100755 index 0000000000..568b2e2ac7 --- /dev/null +++ b/.chloggen/add_deploy_replica_metrics.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 desired and available metrics for k8s deployment and replicaset + +# 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] + +# (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/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 9187ddf2db..54b5434335 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -15,6 +15,37 @@ 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`](#metric-k8sdeploymentdesired) + - [Metric: `k8s.deployment.available`](#metric-k8sdeploymentavailable) +- [ReplicaSet Metrics](#replicaset-metrics) + - [Metric: `k8s.replicaset.desired`](#metric-k8sreplicasetdesired) + - [Metric: `k8s.replicaset.available`](#metric-k8sreplicasetavailable) + + + +## Pod Metrics + +**Description:** Pod level metrics captured under the namespace `k8s.pod`. + ### Metric: `k8s.pod.uptime` This metric is [recommended][MetricRecommended]. @@ -172,6 +203,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 +364,93 @@ This metric is [recommended][MetricRecommended]. +## Deployment Metrics + +**Description:** Deployment level metrics captured under the namespace `k8s.deployment`. + +### Metric: `k8s.deployment.desired` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.deployment.desired` | Gauge | `{pod}` | Number of desired pods in this deployment | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +### Metric: `k8s.deployment.available` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.deployment.available` | Gauge | `{pod}` | Total number of available pods (ready for at least minReadySeconds) targeted by this deployment | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +## ReplicaSet Metrics + +**Description:** ReplicaSet level metrics captured under the namespace `k8s.replicaset`. + +### Metric: `k8s.replicaset.desired` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.replicaset.desired` | Gauge | `{pod}` | Number of desired pods in this replicaset | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +### Metric: `k8s.replicaset.available` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.replicaset.available` | Gauge | `{pod}` | Total number of available pods (ready for at least minReadySeconds) targeted by this replicaset | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + [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..37e46f7d36 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -126,3 +126,35 @@ groups: attributes: - ref: network.interface.name - ref: network.io.direction + + # k8s.deployment.* metrics + - id: metric.k8s.deployment.desired + type: metric + metric_name: k8s.deployment.desired + stability: experimental + brief: "Number of desired pods in this deployment" + instrument: gauge + unit: "{pod}" + - id: metric.k8s.deployment.available + type: metric + metric_name: k8s.deployment.available + stability: experimental + brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment" + instrument: gauge + unit: "{pod}" + + # k8s.replicaset.* metrics + - id: metric.k8s.replicaset.desired + type: metric + metric_name: k8s.replicaset.desired + stability: experimental + brief: "Number of desired pods in this replicaset" + instrument: gauge + unit: "{pod}" + - id: metric.k8s.replicaset.available + type: metric + metric_name: k8s.replicaset.available + stability: experimental + brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this replicaset" + instrument: gauge + unit: "{pod}" From e78c68378fa53cfa91c270e627d08be107a688d2 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 3 Dec 2024 14:55:01 +0200 Subject: [PATCH 02/11] add refs to k8s api Signed-off-by: ChrsMark --- docs/system/k8s-metrics.md | 20 ++++++++++++++++---- model/k8s/metrics.yaml | 12 ++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 54b5434335..1da56bb2da 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -381,7 +381,10 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.deployment.desired` | Gauge | `{pod}` | Number of desired pods in this deployment | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.deployment.desired` | Gauge | `{pod}` | Number of desired pods in this deployment [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `replicas` field of the +[K8s Deployment Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentspec-v1-apps) @@ -401,7 +404,10 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.deployment.available` | Gauge | `{pod}` | Total number of available pods (ready for at least minReadySeconds) targeted by this deployment | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.deployment.available` | Gauge | `{pod}` | Total number of available 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 `readyReplicas` field of the +[K8s Deployment Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps) @@ -425,7 +431,10 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replicaset.desired` | Gauge | `{pod}` | Number of desired pods in this replicaset | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.replicaset.desired` | Gauge | `{pod}` | Number of desired pods in this replicaset [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This metric aligns with the `replicas` field of the +[K8s ReplicaSet Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetspec-v1-apps) @@ -445,7 +454,10 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replicaset.available` | Gauge | `{pod}` | Total number of available pods (ready for at least minReadySeconds) targeted by this replicaset | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.replicaset.available` | Gauge | `{pod}` | Total number of available 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 `readyReplicas` field of the +[K8s ReplicaSet Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index 37e46f7d36..ef39984dfc 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -133,6 +133,9 @@ groups: metric_name: k8s.deployment.desired stability: experimental brief: "Number of desired pods in this deployment" + note: | + This metric aligns with the `replicas` field of the + [K8s Deployment Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentspec-v1-apps) instrument: gauge unit: "{pod}" - id: metric.k8s.deployment.available @@ -140,6 +143,9 @@ groups: metric_name: k8s.deployment.available stability: experimental brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment" + note: | + This metric aligns with the `readyReplicas` field of the + [K8s Deployment Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps) instrument: gauge unit: "{pod}" @@ -149,6 +155,9 @@ groups: metric_name: k8s.replicaset.desired stability: experimental brief: "Number of desired pods in this replicaset" + note: | + This metric aligns with the `replicas` field of the + [K8s ReplicaSet Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetspec-v1-apps) instrument: gauge unit: "{pod}" - id: metric.k8s.replicaset.available @@ -156,5 +165,8 @@ groups: metric_name: k8s.replicaset.available stability: experimental brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this replicaset" + note: | + This metric aligns with the `readyReplicas` field of the + [K8s ReplicaSet Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) instrument: gauge unit: "{pod}" From 6b7981098e738b1d6d535d8f8145d85921361fbb Mon Sep 17 00:00:00 2001 From: Christos Markou Date: Tue, 3 Dec 2024 15:22:54 +0200 Subject: [PATCH 03/11] Update model/k8s/metrics.yaml Co-authored-by: Tetiana Kravchenko --- model/k8s/metrics.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index ef39984dfc..1ca9e972f5 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -166,7 +166,7 @@ groups: stability: experimental brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this replicaset" note: | - This metric aligns with the `readyReplicas` field of the + This metric aligns with the `availableReplicas` field of the [K8s ReplicaSet Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) instrument: gauge unit: "{pod}" From b20bee7e151902f5eb2f51858b84d6a3a87a6cb2 Mon Sep 17 00:00:00 2001 From: Christos Markou Date: Tue, 3 Dec 2024 15:23:07 +0200 Subject: [PATCH 04/11] Update model/k8s/metrics.yaml Co-authored-by: Tetiana Kravchenko --- model/k8s/metrics.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index 1ca9e972f5..6c8ccd162c 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -144,7 +144,7 @@ groups: stability: experimental brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment" note: | - This metric aligns with the `readyReplicas` field of the + This metric aligns with the `availableReplicas` field of the [K8s Deployment Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps) instrument: gauge unit: "{pod}" From c3c4cd35922213196e24888998beec9c6ed1185a Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 3 Dec 2024 15:44:41 +0200 Subject: [PATCH 05/11] update md files Signed-off-by: ChrsMark --- docs/system/k8s-metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 1da56bb2da..3f33085a29 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -406,7 +406,7 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `k8s.deployment.available` | Gauge | `{pod}` | Total number of available 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 `readyReplicas` field of the +**[1]:** This metric aligns with the `availableReplicas` field of the [K8s Deployment Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps) @@ -456,7 +456,7 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `k8s.replicaset.available` | Gauge | `{pod}` | Total number of available 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 `readyReplicas` field of the +**[1]:** This metric aligns with the `availableReplicas` field of the [K8s ReplicaSet Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) From ec7ce4e854bd87a928e0a0a6ff072772181acdb2 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 3 Dec 2024 16:49:27 +0200 Subject: [PATCH 06/11] add replication_controller metrics Signed-off-by: ChrsMark --- .chloggen/add_deploy_replica_metrics.yaml | 2 +- docs/system/k8s-metrics.md | 53 +++++++++++++++++++++++ model/k8s/metrics.yaml | 22 ++++++++++ 3 files changed, 76 insertions(+), 1 deletion(-) diff --git a/.chloggen/add_deploy_replica_metrics.yaml b/.chloggen/add_deploy_replica_metrics.yaml index 568b2e2ac7..da8cb10914 100755 --- a/.chloggen/add_deploy_replica_metrics.yaml +++ b/.chloggen/add_deploy_replica_metrics.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: Add desired and available metrics for k8s deployment and replicaset +note: Add desired and available metrics for k8s deployment, replicaset and replication_controller # 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/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 3f33085a29..92e2c5dbf5 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -39,6 +39,9 @@ and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`. - [ReplicaSet Metrics](#replicaset-metrics) - [Metric: `k8s.replicaset.desired`](#metric-k8sreplicasetdesired) - [Metric: `k8s.replicaset.available`](#metric-k8sreplicasetavailable) +- [ReplicationController Metrics](#replicationcontroller-metrics) + - [Metric: `k8s.replication_controller.desired`](#metric-k8sreplication_controllerdesired) + - [Metric: `k8s.replication_controller.available`](#metric-k8sreplication_controlleravailable) @@ -464,5 +467,55 @@ This metric is [recommended][MetricRecommended]. +## ReplicationController Metrics + +**Description:** ReplicationController level metrics captured under the namespace `k8s.replication_controller`. + +### Metric: `k8s.replication_controller.desired` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.replication_controller.desired` | Gauge | `{pod}` | Number of desired 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 ReplicationController Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core) + + + + + + +### Metric: `k8s.replication_controller.available` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.replication_controller.available` | Gauge | `{pod}` | Total number of available 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 ReplicationController Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core) + + + + + + [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 6c8ccd162c..94060976f6 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -170,3 +170,25 @@ groups: [K8s ReplicaSet Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) instrument: gauge unit: "{pod}" + + # k8s.replication_controller.* metrics + - id: metric.k8s.replication_controller.desired + type: metric + metric_name: k8s.replication_controller.desired + stability: experimental + brief: "Number of desired pods in this replication controller" + note: | + This metric aligns with the `replicas` field of the + [K8s ReplicationController Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core) + instrument: gauge + unit: "{pod}" + - id: metric.k8s.replication_controller.available + type: metric + metric_name: k8s.replication_controller.available + stability: experimental + brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this replication controller" + note: | + This metric aligns with the `availableReplicas` field of the + [K8s ReplicationController Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core) + instrument: gauge + unit: "{pod}" From aa85c2b29b60f1bc15c15d60f2f7c4cb99e97904 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Wed, 4 Dec 2024 12:45:19 +0200 Subject: [PATCH 07/11] add more replica related metrics & add _pod suffix Signed-off-by: ChrsMark --- .chloggen/add_deploy_replica_metrics.yaml | 2 +- docs/system/k8s-metrics.md | 262 +++++++++++++++++++--- model/k8s/metrics.yaml | 132 +++++++++-- 3 files changed, 341 insertions(+), 55 deletions(-) diff --git a/.chloggen/add_deploy_replica_metrics.yaml b/.chloggen/add_deploy_replica_metrics.yaml index da8cb10914..2ddd380a7a 100755 --- a/.chloggen/add_deploy_replica_metrics.yaml +++ b/.chloggen/add_deploy_replica_metrics.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: Add desired and available metrics for k8s deployment, replicaset and replication_controller +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. diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 92e2c5dbf5..a180edd2b9 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -34,14 +34,24 @@ and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`. - [Metric: `k8s.node.network.io`](#metric-k8snodenetworkio) - [Metric: `k8s.node.network.errors`](#metric-k8snodenetworkerrors) - [Deployment Metrics](#deployment-metrics) - - [Metric: `k8s.deployment.desired`](#metric-k8sdeploymentdesired) - - [Metric: `k8s.deployment.available`](#metric-k8sdeploymentavailable) + - [Metric: `k8s.deployment.desired_pods`](#metric-k8sdeploymentdesired_pods) + - [Metric: `k8s.deployment.available_pods`](#metric-k8sdeploymentavailable_pods) - [ReplicaSet Metrics](#replicaset-metrics) - - [Metric: `k8s.replicaset.desired`](#metric-k8sreplicasetdesired) - - [Metric: `k8s.replicaset.available`](#metric-k8sreplicasetavailable) + - [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`](#metric-k8sreplication_controllerdesired) - - [Metric: `k8s.replication_controller.available`](#metric-k8sreplication_controlleravailable) + - [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) @@ -371,11 +381,11 @@ This metric is [recommended][MetricRecommended]. **Description:** Deployment level metrics captured under the namespace `k8s.deployment`. -### Metric: `k8s.deployment.desired` +### Metric: `k8s.deployment.desired_pods` This metric is [recommended][MetricRecommended]. - + @@ -384,21 +394,21 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.deployment.desired` | Gauge | `{pod}` | Number of desired pods in this deployment [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.deployment.desired_pods` | Gauge | `{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 Deployment Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentspec-v1-apps) +[K8s DeploymentSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentspec-v1-apps) -### Metric: `k8s.deployment.available` +### Metric: `k8s.deployment.available_pods` This metric is [recommended][MetricRecommended]. - + @@ -407,10 +417,10 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.deployment.available` | Gauge | `{pod}` | Total number of available pods (ready for at least minReadySeconds) targeted by this deployment [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.deployment.available_pods` | Gauge | `{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 Deployment Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps) +[K8s DeploymentStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps) @@ -421,11 +431,11 @@ This metric is [recommended][MetricRecommended]. **Description:** ReplicaSet level metrics captured under the namespace `k8s.replicaset`. -### Metric: `k8s.replicaset.desired` +### Metric: `k8s.replicaset.desired_pods` This metric is [recommended][MetricRecommended]. - + @@ -434,21 +444,21 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replicaset.desired` | Gauge | `{pod}` | Number of desired pods in this replicaset [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.replicaset.desired_pods` | Gauge | `{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 ReplicaSet Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetspec-v1-apps) +[K8s ReplicaSetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetspec-v1-apps) -### Metric: `k8s.replicaset.available` +### Metric: `k8s.replicaset.available_pods` This metric is [recommended][MetricRecommended]. - + @@ -457,10 +467,10 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replicaset.available` | Gauge | `{pod}` | Total number of available pods (ready for at least minReadySeconds) targeted by this replicaset [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.replicaset.available_pods` | Gauge | `{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 ReplicaSet Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) +[K8s ReplicaSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) @@ -471,11 +481,11 @@ This metric is [recommended][MetricRecommended]. **Description:** ReplicationController level metrics captured under the namespace `k8s.replication_controller`. -### Metric: `k8s.replication_controller.desired` +### Metric: `k8s.replication_controller.desired_pods` This metric is [recommended][MetricRecommended]. - + @@ -484,21 +494,21 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replication_controller.desired` | Gauge | `{pod}` | Number of desired pods in this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.replication_controller.desired_pods` | Gauge | `{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 ReplicationController Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core) +[K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core) -### Metric: `k8s.replication_controller.available` +### Metric: `k8s.replication_controller.available_pods` This metric is [recommended][MetricRecommended]. - + @@ -507,10 +517,202 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replication_controller.available` | Gauge | `{pod}` | Total number of available pods (ready for at least minReadySeconds) targeted by this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.replication_controller.available_pods` | Gauge | `{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 ReplicationController Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core) +[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` | Gauge | `{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) + + + + + + +### Metric: `k8s.statefulset.ready_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.statefulset.ready_pods` | Gauge | `{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) + + + + + + +### Metric: `k8s.statefulset.current_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.statefulset.current_pods` | Gauge | `{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) + + + + + + +### Metric: `k8s.statefulset.updated_pods` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.statefulset.updated_pods` | Gauge | `{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) + + + + + + +## 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` | Gauge | `{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` | Gauge | `{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` | Gauge | `{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` | Gauge | `{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) diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index 94060976f6..b621bb1973 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -128,67 +128,151 @@ groups: - ref: network.io.direction # k8s.deployment.* metrics - - id: metric.k8s.deployment.desired + - id: metric.k8s.deployment.desired_pods type: metric - metric_name: k8s.deployment.desired + metric_name: k8s.deployment.desired_pods stability: experimental - brief: "Number of desired pods in this deployment" + brief: "Number of desired replica pods in this deployment" note: | This metric aligns with the `replicas` field of the - [K8s Deployment Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentspec-v1-apps) + [K8s DeploymentSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentspec-v1-apps) instrument: gauge unit: "{pod}" - - id: metric.k8s.deployment.available + - id: metric.k8s.deployment.available_pods type: metric - metric_name: k8s.deployment.available + metric_name: k8s.deployment.available_pods stability: experimental - brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment" + 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 Deployment Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps) + [K8s DeploymentStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstatus-v1-apps) instrument: gauge unit: "{pod}" # k8s.replicaset.* metrics - - id: metric.k8s.replicaset.desired + - id: metric.k8s.replicaset.desired_pods type: metric - metric_name: k8s.replicaset.desired + metric_name: k8s.replicaset.desired_pods stability: experimental - brief: "Number of desired pods in this replicaset" + brief: "Number of desired replica pods in this replicaset" note: | This metric aligns with the `replicas` field of the - [K8s ReplicaSet Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetspec-v1-apps) + [K8s ReplicaSetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetspec-v1-apps) instrument: gauge unit: "{pod}" - - id: metric.k8s.replicaset.available + - id: metric.k8s.replicaset.available_pods type: metric - metric_name: k8s.replicaset.available + metric_name: k8s.replicaset.available_pods stability: experimental - brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this replicaset" + 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 ReplicaSet Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) + [K8s ReplicaSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicasetstatus-v1-apps) instrument: gauge unit: "{pod}" # k8s.replication_controller.* metrics - - id: metric.k8s.replication_controller.desired + - id: metric.k8s.replication_controller.desired_pods type: metric - metric_name: k8s.replication_controller.desired + metric_name: k8s.replication_controller.desired_pods stability: experimental - brief: "Number of desired pods in this replication controller" + brief: "Number of desired replica pods in this replication controller" note: | This metric aligns with the `replicas` field of the - [K8s ReplicationController Spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core) + [K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core) instrument: gauge unit: "{pod}" - - id: metric.k8s.replication_controller.available + - id: metric.k8s.replication_controller.available_pods type: metric - metric_name: k8s.replication_controller.available + metric_name: k8s.replication_controller.available_pods stability: experimental - brief: "Total number of available pods (ready for at least minReadySeconds) targeted by this replication controller" + brief: "Total number of available replica pods (ready for at least minReadySeconds) targeted by this replication controller" note: | This metric aligns with the `availableReplicas` field of the - [K8s ReplicationController Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core) + [K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core) + instrument: gauge + 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) + instrument: gauge + 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) + instrument: gauge + 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) + instrument: gauge + 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) + instrument: gauge + 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" + 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: gauge + 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" + 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: gauge + 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" + 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: gauge + 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" + 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: gauge unit: "{pod}" From 63d3e9b9520f2567bd95cc244bd0c4ced6ff685d Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 5 Dec 2024 19:01:12 +0200 Subject: [PATCH 08/11] Add Collector breaking changes in migration guide Signed-off-by: ChrsMark --- docs/non-normative/k8s-migration.md | 95 +++++++++++++++++++++++++++-- 1 file changed, 90 insertions(+), 5 deletions(-) diff --git a/docs/non-normative/k8s-migration.md b/docs/non-normative/k8s-migration.md index 8a8f305dac..aaf68df43f 100644 --- a/docs/non-normative/k8s-migration.md +++ b/docs/non-normative/k8s-migration.md @@ -43,6 +43,10 @@ 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 HorizontalPodAutoscaler metrics](#k8s-horizontalpodautoscaler-metrics) @@ -56,13 +60,94 @@ 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 are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|---------------------------------| +| `k8s.deployment.desired` | `k8s.deployment.desired_pods` | +| `k8s.deployment.available` | `k8s.deployment.available_pods` | + + + +### 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 are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|---------------------------------| +| `k8s.replicaset.desired` | `k8s.replicaset.desired_pods` | +| `k8s.replicaset.available` | `k8s.replicaset.available_pods` | + + + +### 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 are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|---------------------------------------------| +| `k8s.replication_controller.desired` | `k8s.replication_controller.desired_pods` | +| `k8s.replication_controller.available` | `k8s.replication_controller.available_pods` | + + + +### 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 are the following: + + + +| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New | +|------------------------------------------------------------------------------------|------------------------| +| `k8s.hpa.desired_replicas` | `k8s.hpa.desired_pods` | +| `k8s.hpa.current_replicas` | `k8s.hpa.current_pods` | +| `k8s.hpa.max_replicas` | `k8s.hpa.max_pods` | +| `k8s.hpa.min_replicas` | `k8s.hpa.min_pods` | + From ea07ce8acfc6fc7ea02add6165114db73ffc0801 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 6 Dec 2024 18:00:15 +0200 Subject: [PATCH 09/11] add extra note about the rationale of this change Signed-off-by: ChrsMark --- .chloggen/add_deploy_replica_metrics.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.chloggen/add_deploy_replica_metrics.yaml b/.chloggen/add_deploy_replica_metrics.yaml index 2ddd380a7a..09a9bea9c8 100755 --- a/.chloggen/add_deploy_replica_metrics.yaml +++ b/.chloggen/add_deploy_replica_metrics.yaml @@ -14,9 +14,12 @@ note: Add metrics for k8s deployment, replicaset, replication_controller, statef # 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] +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: +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 From 11e412e22d66f5be773301d92f199ac68d75acdc Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 12 Dec 2024 10:54:51 +0200 Subject: [PATCH 10/11] switch types to updowncounter Signed-off-by: ChrsMark --- docs/non-normative/k8s-migration.md | 66 +++++++++++++++++++---------- docs/system/k8s-metrics.md | 28 ++++++------ model/k8s/metrics.yaml | 28 ++++++------ 3 files changed, 72 insertions(+), 50 deletions(-) diff --git a/docs/non-normative/k8s-migration.md b/docs/non-normative/k8s-migration.md index aaf68df43f..6d55cdfdc6 100644 --- a/docs/non-normative/k8s-migration.md +++ b/docs/non-normative/k8s-migration.md @@ -46,6 +46,7 @@ and one for disabling the old schema called `semconv.k8s.disableLegacy`. Then: - [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) @@ -82,14 +83,14 @@ 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 are the following: +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` | `k8s.deployment.desired_pods` | -| `k8s.deployment.available` | `k8s.deployment.available_pods` | +| 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`) | @@ -101,14 +102,14 @@ 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 are the following: +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` | `k8s.replicaset.desired_pods` | -| `k8s.replicaset.available` | `k8s.replicaset.available_pods` | +| 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`) | @@ -120,14 +121,35 @@ 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 are the following: +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` | `k8s.replication_controller.desired_pods` | -| `k8s.replication_controller.available` | `k8s.replication_controller.available_pods` | +| 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`) | @@ -139,15 +161,15 @@ 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 are the following: +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` | `k8s.hpa.desired_pods` | -| `k8s.hpa.current_replicas` | `k8s.hpa.current_pods` | -| `k8s.hpa.max_replicas` | `k8s.hpa.max_pods` | -| `k8s.hpa.min_replicas` | `k8s.hpa.min_pods` | +| 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 a180edd2b9..d84c73db05 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -394,7 +394,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.deployment.desired_pods` | Gauge | `{pod}` | Number of desired replica pods in this deployment [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `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) @@ -417,7 +417,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.deployment.available_pods` | Gauge | `{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) | +| `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) @@ -444,7 +444,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replicaset.desired_pods` | Gauge | `{pod}` | Number of desired replica pods in this replicaset [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `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) @@ -467,7 +467,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replicaset.available_pods` | Gauge | `{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) | +| `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) @@ -494,7 +494,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replication_controller.desired_pods` | Gauge | `{pod}` | Number of desired replica pods in this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `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) @@ -517,7 +517,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.replication_controller.available_pods` | Gauge | `{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) | +| `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) @@ -544,7 +544,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.statefulset.desired_pods` | Gauge | `{pod}` | Number of desired replica pods in this statefulset [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `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) @@ -567,7 +567,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.statefulset.ready_pods` | Gauge | `{pod}` | The number of replica pods created for this statefulset with a Ready Condition [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `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) @@ -590,7 +590,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.statefulset.current_pods` | Gauge | `{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) | +| `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) @@ -613,7 +613,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.statefulset.updated_pods` | Gauge | `{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) | +| `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) @@ -640,7 +640,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.hpa.desired_pods` | Gauge | `{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) | +| `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) @@ -663,7 +663,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.hpa.current_pods` | Gauge | `{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) | +| `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) @@ -686,7 +686,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.hpa.max_pods` | Gauge | `{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) | +| `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) @@ -709,7 +709,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.hpa.min_pods` | Gauge | `{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) | +| `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) diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index b621bb1973..c928c9dbaf 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -136,7 +136,7 @@ groups: 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.deployment.available_pods type: metric @@ -146,7 +146,7 @@ groups: 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" # k8s.replicaset.* metrics @@ -158,7 +158,7 @@ groups: 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.replicaset.available_pods type: metric @@ -168,7 +168,7 @@ groups: 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" # k8s.replication_controller.* metrics @@ -180,7 +180,7 @@ 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.replication_controller.available_pods type: metric @@ -190,7 +190,7 @@ 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" # k8s.statefulset.* metrics @@ -202,7 +202,7 @@ groups: 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.statefulset.ready_pods type: metric @@ -212,7 +212,7 @@ groups: 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.statefulset.current_pods type: metric @@ -222,7 +222,7 @@ groups: 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.statefulset.updated_pods type: metric @@ -232,7 +232,7 @@ groups: 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" # k8s.hpa.* metrics @@ -244,7 +244,7 @@ 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.hpa.current_pods type: metric @@ -254,7 +254,7 @@ 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.hpa.max_pods type: metric @@ -264,7 +264,7 @@ 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" - id: metric.k8s.hpa.min_pods type: metric @@ -274,5 +274,5 @@ 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) - instrument: gauge + instrument: updowncounter unit: "{pod}" From 1f91666efc43454add1628f6b49da43efb7dd6b4 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Sat, 14 Dec 2024 16:06:40 +0200 Subject: [PATCH 11/11] Add notes about resource correlation Signed-off-by: ChrsMark --- docs/system/k8s-metrics.md | 40 ++++++++++++++++++++++++++------- model/k8s/metrics.yaml | 46 +++++++++++++++++++++++++++++++------- 2 files changed, 70 insertions(+), 16 deletions(-) diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index d84c73db05..cd15ca5e98 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -397,7 +397,10 @@ This metric is [recommended][MetricRecommended]. | `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) +[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. @@ -420,7 +423,10 @@ This metric is [recommended][MetricRecommended]. | `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) +[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. @@ -447,7 +453,10 @@ This metric is [recommended][MetricRecommended]. | `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) +[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. @@ -470,7 +479,10 @@ This metric is [recommended][MetricRecommended]. | `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) +[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. @@ -547,7 +559,10 @@ This metric is [recommended][MetricRecommended]. | `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) +[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. @@ -570,7 +585,10 @@ This metric is [recommended][MetricRecommended]. | `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) +[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. @@ -593,7 +611,10 @@ This metric is [recommended][MetricRecommended]. | `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) +[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. @@ -616,7 +637,10 @@ This metric is [recommended][MetricRecommended]. | `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) +[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. diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index c928c9dbaf..6d954230e1 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -135,7 +135,10 @@ groups: 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) + [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 @@ -145,7 +148,10 @@ groups: 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) + [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}" @@ -157,7 +163,10 @@ groups: 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) + [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 @@ -167,7 +176,10 @@ groups: 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) + [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}" @@ -177,6 +189,7 @@ groups: 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) @@ -187,6 +200,7 @@ groups: 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) @@ -201,7 +215,10 @@ groups: 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) + [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 @@ -211,7 +228,10 @@ groups: 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) + [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 @@ -221,7 +241,10 @@ groups: 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) + [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 @@ -231,7 +254,10 @@ groups: 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) + [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}" @@ -241,6 +267,7 @@ groups: 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) @@ -251,6 +278,7 @@ groups: 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) @@ -261,6 +289,7 @@ groups: 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) @@ -271,6 +300,7 @@ groups: 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)