Make replication controller metrics consistent with resource attributes (#1848)

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
This commit is contained in:
Christos Markou 2025-02-03 09:56:55 +02:00 committed by GitHub
parent 3e83e60957
commit 360499a5fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 74 additions and 24 deletions

22
.chloggen/fix_k8s_metrics.yaml Executable file
View File

@ -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: breaking
# 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: Change k8s.replication_controller metrics to k8s.replicationcontroller
# 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: [1848]
# (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:

View File

@ -129,10 +129,10 @@ The changes in their metric names and types are the following:
<!-- prettier-ignore-start -->
| 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`) |
| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New |
|------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| `k8s.replication_controller.desired` (type: `gauge`) | `k8s.replicationcontroller.desired_pods` (type: `updowncounter`) |
| `k8s.replication_controller.available` (type: `gauge`) | `k8s.replicationcontroller.available_pods` (type: `updowncounter`) |
<!-- prettier-ignore-end -->

View File

@ -38,8 +38,8 @@ and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`.
- [Metric: `k8s.replicaset.desired_pods`](#metric-k8sreplicasetdesired_pods)
- [Metric: `k8s.replicaset.available_pods`](#metric-k8sreplicasetavailable_pods)
- [ReplicationController Metrics](#replicationcontroller-metrics)
- [Metric: `k8s.replication_controller.desired_pods`](#metric-k8sreplication_controllerdesired_pods)
- [Metric: `k8s.replication_controller.available_pods`](#metric-k8sreplication_controlleravailable_pods)
- [Metric: `k8s.replicationcontroller.desired_pods`](#metric-k8sreplicationcontrollerdesired_pods)
- [Metric: `k8s.replicationcontroller.available_pods`](#metric-k8sreplicationcontrolleravailable_pods)
- [StatefulSet Metrics](#statefulset-metrics)
- [Metric: `k8s.statefulset.desired_pods`](#metric-k8sstatefulsetdesired_pods)
- [Metric: `k8s.statefulset.ready_pods`](#metric-k8sstatefulsetready_pods)
@ -504,13 +504,13 @@ This metric SHOULD, at a minimum, be reported against a
## ReplicationController Metrics
**Description:** ReplicationController level metrics captured under the namespace `k8s.replication_controller`.
**Description:** ReplicationController level metrics captured under the namespace `k8s.replicationcontroller`.
### Metric: `k8s.replication_controller.desired_pods`
### Metric: `k8s.replicationcontroller.desired_pods`
This metric is [recommended][MetricRecommended].
<!-- semconv metric.k8s.replication_controller.desired_pods -->
<!-- semconv metric.k8s.replicationcontroller.desired_pods -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
@ -519,7 +519,7 @@ This metric is [recommended][MetricRecommended].
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `k8s.replication_controller.desired_pods` | UpDownCounter | `{pod}` | Number of desired replica pods in this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.replicationcontroller.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)
@ -532,11 +532,11 @@ This metric SHOULD, at a minimum, be reported against a
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->
### Metric: `k8s.replication_controller.available_pods`
### Metric: `k8s.replicationcontroller.available_pods`
This metric is [recommended][MetricRecommended].
<!-- semconv metric.k8s.replication_controller.available_pods -->
<!-- semconv metric.k8s.replicationcontroller.available_pods -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
@ -545,7 +545,7 @@ This metric is [recommended][MetricRecommended].
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `k8s.replication_controller.available_pods` | UpDownCounter | `{pod}` | Total number of available replica pods (ready for at least minReadySeconds) targeted by this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.replicationcontroller.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)

View File

@ -0,0 +1,29 @@
groups:
- id: metric.k8s.replication_controller.desired_pods
type: metric
metric_name: k8s.replication_controller.desired_pods
stability: experimental
deprecated: "Replaced by `k8s.replicationcontroller.desired_pods`."
brief: "Deprecated, use `k8s.replicationcontroller.desired_pods` instead."
note: |
This metric aligns with the `replicas` field of the
[K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core)
This metric SHOULD, at a minimum, be reported against a
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.
instrument: updowncounter
unit: "{pod}"
- id: metric.k8s.replication_controller.available_pods
type: metric
metric_name: k8s.replication_controller.available_pods
stability: experimental
deprecated: "Replaced by `k8s.replicationcontroller.available_pods`."
brief: "Deprecated, use `k8s.replicationcontroller.available_pods` instead."
note: |
This metric aligns with the `availableReplicas` field of the
[K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core)
This metric SHOULD, at a minimum, be reported against a
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.
instrument: updowncounter
unit: "{pod}"

View File

@ -183,13 +183,12 @@ groups:
instrument: updowncounter
unit: "{pod}"
# k8s.replication_controller.* metrics
- id: metric.k8s.replication_controller.desired_pods
# k8s.replicationcontroller.* metrics
- id: metric.k8s.replicationcontroller.desired_pods
type: metric
metric_name: k8s.replication_controller.desired_pods
metric_name: k8s.replicationcontroller.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)
@ -198,12 +197,11 @@ groups:
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.
instrument: updowncounter
unit: "{pod}"
- id: metric.k8s.replication_controller.available_pods
- id: metric.k8s.replicationcontroller.available_pods
type: metric
metric_name: k8s.replication_controller.available_pods
metric_name: k8s.replicationcontroller.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)
@ -273,7 +271,6 @@ 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)
@ -287,7 +284,6 @@ 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)
@ -301,7 +297,6 @@ 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)
@ -315,7 +310,6 @@ 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)

View File

@ -2,6 +2,11 @@ file_format: 1.1.0
schema_url: https://opentelemetry.io/schemas/next
versions:
next:
metrics:
changes:
- rename_metrics:
k8s.replication_controller.desired_pods: k8s.replicationcontroller.desired_pods
k8s.replication_controller.available_pods: k8s.replicationcontroller.available_pods
1.30.0:
all:
changes: