From 39ea64b866646d5f718bcb02b239875c070059aa Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 13 Dec 2024 10:28:05 +0200 Subject: [PATCH] change types to updowncounter Signed-off-by: ChrsMark --- docs/non-normative/k8s-migration.md | 35 ++++++++++++++++++++++++----- docs/system/k8s-metrics.md | 8 +++---- model/k8s/metrics.yaml | 8 +++---- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/docs/non-normative/k8s-migration.md b/docs/non-normative/k8s-migration.md index 8a8f305dac..3194d2a8c7 100644 --- a/docs/non-normative/k8s-migration.md +++ b/docs/non-normative/k8s-migration.md @@ -43,6 +43,7 @@ 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 DaemonSet metrics](#k8s-daemonset-metrics) @@ -56,13 +57,37 @@ 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 DaemonSet metrics + +The K8s DaemonSet 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 +[#1649](https://github.com/open-telemetry/semantic-conventions/pull/1649) (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.daemonset.current_scheduled_nodes` (type: `gauge`) | `k8s.daemonset.current_scheduled_nodes` (type: `updowncounter`) | +| `k8s.daemonset.desired_scheduled_nodes` (type: `gauge`) | `k8s.daemonset.desired_scheduled_nodes` (type: `updowncounter`) | +| `k8s.daemonset.misscheduled_nodes` (type: `gauge`) | `k8s.daemonset.misscheduled_nodes` (type: `updowncounter`) | +| `k8s.daemonset.ready_nodes` (type: `gauge`) | `k8s.daemonset.ready_nodes` (type: `updowncounter`) | + diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 709629148d..2aa24c9f0e 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -342,7 +342,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.daemonset.current_scheduled_nodes` | Gauge | `{node}` | Number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.daemonset.current_scheduled_nodes` | UpDownCounter | `{node}` | Number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** This metric aligns with the `currentNumberScheduled` field of the [K8s DaemonSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#daemonsetstatus-v1-apps) @@ -365,7 +365,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.daemonset.desired_scheduled_nodes` | Gauge | `{node}` | Number of nodes that should be running the daemon pod (including nodes currently running the daemon pod) [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.daemonset.desired_scheduled_nodes` | UpDownCounter | `{node}` | Number of nodes that should be running the daemon pod (including nodes currently running the daemon pod) [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** This metric aligns with the `desiredNumberScheduled` field of the [K8s DaemonSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#daemonsetstatus-v1-apps) @@ -388,7 +388,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.daemonset.misscheduled_nodes` | Gauge | `{node}` | Number of nodes that are running the daemon pod, but are not supposed to run the daemon pod [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.daemonset.misscheduled_nodes` | UpDownCounter | `{node}` | Number of nodes that are running the daemon pod, but are not supposed to run the daemon pod [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** This metric aligns with the `numberMisscheduled` field of the [K8s DaemonSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#daemonsetstatus-v1-apps) @@ -411,7 +411,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `k8s.daemonset.ready_nodes` | Gauge | `{node}` | Number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.daemonset.ready_nodes` | UpDownCounter | `{node}` | Number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** This metric aligns with the `numberReady` field of the [K8s DaemonSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#daemonsetstatus-v1-apps) diff --git a/model/k8s/metrics.yaml b/model/k8s/metrics.yaml index 5b4f7287b8..600cbc0970 100644 --- a/model/k8s/metrics.yaml +++ b/model/k8s/metrics.yaml @@ -136,7 +136,7 @@ groups: note: | This metric aligns with the `currentNumberScheduled` field of the [K8s DaemonSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#daemonsetstatus-v1-apps) - instrument: gauge + instrument: updowncounter unit: "{node}" - id: metric.k8s.daemonset.desired_scheduled_nodes type: metric @@ -146,7 +146,7 @@ groups: note: | This metric aligns with the `desiredNumberScheduled` field of the [K8s DaemonSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#daemonsetstatus-v1-apps) - instrument: gauge + instrument: updowncounter unit: "{node}" - id: metric.k8s.daemonset.misscheduled_nodes type: metric @@ -156,7 +156,7 @@ groups: note: | This metric aligns with the `numberMisscheduled` field of the [K8s DaemonSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#daemonsetstatus-v1-apps) - instrument: gauge + instrument: updowncounter unit: "{node}" - id: metric.k8s.daemonset.ready_nodes type: metric @@ -166,5 +166,5 @@ groups: note: | This metric aligns with the `numberReady` field of the [K8s DaemonSetStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#daemonsetstatus-v1-apps) - instrument: gauge + instrument: updowncounter unit: "{node}"