Skip to content

Commit 360499a

Browse files
authored
Make replication controller metrics consistent with resource attributes (#1848)
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
1 parent 3e83e60 commit 360499a

File tree

6 files changed

+74
-24
lines changed

6 files changed

+74
-24
lines changed

.chloggen/fix_k8s_metrics.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: breaking
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: k8s
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: Change k8s.replication_controller metrics to k8s.replicationcontroller
14+
15+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
16+
# The values here must be integers.
17+
issues: [1848]
18+
19+
# (Optional) One or more lines of additional information to render under the primary note.
20+
# These lines will be padded with 2 spaces and then inserted directly into the document.
21+
# Use pipe (|) for multiline entries.
22+
subtext:

docs/non-normative/k8s-migration.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ The changes in their metric names and types are the following:
129129

130130
<!-- prettier-ignore-start -->
131131

132-
| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New |
133-
|------------------------------------------------------------------------------------|---------------------------------------------------------------------|
134-
| `k8s.replication_controller.desired` (type: `gauge`) | `k8s.replication_controller.desired_pods` (type: `updowncounter`) |
135-
| `k8s.replication_controller.available` (type: `gauge`) | `k8s.replication_controller.available_pods` (type: `updowncounter`) |
132+
| Old (Collector) ![changed](https://img.shields.io/badge/changed-orange?style=flat) | New |
133+
|------------------------------------------------------------------------------------|--------------------------------------------------------------------|
134+
| `k8s.replication_controller.desired` (type: `gauge`) | `k8s.replicationcontroller.desired_pods` (type: `updowncounter`) |
135+
| `k8s.replication_controller.available` (type: `gauge`) | `k8s.replicationcontroller.available_pods` (type: `updowncounter`) |
136136

137137
<!-- prettier-ignore-end -->
138138

docs/system/k8s-metrics.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`.
3838
- [Metric: `k8s.replicaset.desired_pods`](#metric-k8sreplicasetdesired_pods)
3939
- [Metric: `k8s.replicaset.available_pods`](#metric-k8sreplicasetavailable_pods)
4040
- [ReplicationController Metrics](#replicationcontroller-metrics)
41-
- [Metric: `k8s.replication_controller.desired_pods`](#metric-k8sreplication_controllerdesired_pods)
42-
- [Metric: `k8s.replication_controller.available_pods`](#metric-k8sreplication_controlleravailable_pods)
41+
- [Metric: `k8s.replicationcontroller.desired_pods`](#metric-k8sreplicationcontrollerdesired_pods)
42+
- [Metric: `k8s.replicationcontroller.available_pods`](#metric-k8sreplicationcontrolleravailable_pods)
4343
- [StatefulSet Metrics](#statefulset-metrics)
4444
- [Metric: `k8s.statefulset.desired_pods`](#metric-k8sstatefulsetdesired_pods)
4545
- [Metric: `k8s.statefulset.ready_pods`](#metric-k8sstatefulsetready_pods)
@@ -504,13 +504,13 @@ This metric SHOULD, at a minimum, be reported against a
504504

505505
## ReplicationController Metrics
506506

507-
**Description:** ReplicationController level metrics captured under the namespace `k8s.replication_controller`.
507+
**Description:** ReplicationController level metrics captured under the namespace `k8s.replicationcontroller`.
508508

509-
### Metric: `k8s.replication_controller.desired_pods`
509+
### Metric: `k8s.replicationcontroller.desired_pods`
510510

511511
This metric is [recommended][MetricRecommended].
512512

513-
<!-- semconv metric.k8s.replication_controller.desired_pods -->
513+
<!-- semconv metric.k8s.replicationcontroller.desired_pods -->
514514
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
515515
<!-- see templates/registry/markdown/snippet.md.j2 -->
516516
<!-- prettier-ignore-start -->
@@ -519,7 +519,7 @@ This metric is [recommended][MetricRecommended].
519519

520520
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
521521
| -------- | --------------- | ----------- | -------------- | --------- |
522-
| `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) |
522+
| `k8s.replicationcontroller.desired_pods` | UpDownCounter | `{pod}` | Number of desired replica pods in this replication controller [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
523523

524524
**[1]:** This metric aligns with the `replicas` field of the
525525
[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
532532
<!-- END AUTOGENERATED TEXT -->
533533
<!-- endsemconv -->
534534

535-
### Metric: `k8s.replication_controller.available_pods`
535+
### Metric: `k8s.replicationcontroller.available_pods`
536536

537537
This metric is [recommended][MetricRecommended].
538538

539-
<!-- semconv metric.k8s.replication_controller.available_pods -->
539+
<!-- semconv metric.k8s.replicationcontroller.available_pods -->
540540
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
541541
<!-- see templates/registry/markdown/snippet.md.j2 -->
542542
<!-- prettier-ignore-start -->
@@ -545,7 +545,7 @@ This metric is [recommended][MetricRecommended].
545545

546546
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
547547
| -------- | --------------- | ----------- | -------------- | --------- |
548-
| `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) |
548+
| `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) |
549549

550550
**[1]:** This metric aligns with the `availableReplicas` field of the
551551
[K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
groups:
2+
- id: metric.k8s.replication_controller.desired_pods
3+
type: metric
4+
metric_name: k8s.replication_controller.desired_pods
5+
stability: experimental
6+
deprecated: "Replaced by `k8s.replicationcontroller.desired_pods`."
7+
brief: "Deprecated, use `k8s.replicationcontroller.desired_pods` instead."
8+
note: |
9+
This metric aligns with the `replicas` field of the
10+
[K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core)
11+
12+
This metric SHOULD, at a minimum, be reported against a
13+
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.
14+
instrument: updowncounter
15+
unit: "{pod}"
16+
- id: metric.k8s.replication_controller.available_pods
17+
type: metric
18+
metric_name: k8s.replication_controller.available_pods
19+
stability: experimental
20+
deprecated: "Replaced by `k8s.replicationcontroller.available_pods`."
21+
brief: "Deprecated, use `k8s.replicationcontroller.available_pods` instead."
22+
note: |
23+
This metric aligns with the `availableReplicas` field of the
24+
[K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core)
25+
26+
This metric SHOULD, at a minimum, be reported against a
27+
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.
28+
instrument: updowncounter
29+
unit: "{pod}"

model/k8s/metrics.yaml

+5-11
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,12 @@ groups:
183183
instrument: updowncounter
184184
unit: "{pod}"
185185

186-
# k8s.replication_controller.* metrics
187-
- id: metric.k8s.replication_controller.desired_pods
186+
# k8s.replicationcontroller.* metrics
187+
- id: metric.k8s.replicationcontroller.desired_pods
188188
type: metric
189-
metric_name: k8s.replication_controller.desired_pods
189+
metric_name: k8s.replicationcontroller.desired_pods
190190
stability: experimental
191191
brief: "Number of desired replica pods in this replication controller"
192-
# TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented
193192
note: |
194193
This metric aligns with the `replicas` field of the
195194
[K8s ReplicationControllerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerspec-v1-core)
@@ -198,12 +197,11 @@ groups:
198197
[`k8s.replicationcontroller`](../resource/k8s.md#replicationcontroller) resource.
199198
instrument: updowncounter
200199
unit: "{pod}"
201-
- id: metric.k8s.replication_controller.available_pods
200+
- id: metric.k8s.replicationcontroller.available_pods
202201
type: metric
203-
metric_name: k8s.replication_controller.available_pods
202+
metric_name: k8s.replicationcontroller.available_pods
204203
stability: experimental
205204
brief: "Total number of available replica pods (ready for at least minReadySeconds) targeted by this replication controller"
206-
# TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented
207205
note: |
208206
This metric aligns with the `availableReplicas` field of the
209207
[K8s ReplicationControllerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#replicationcontrollerstatus-v1-core)
@@ -273,7 +271,6 @@ groups:
273271
metric_name: k8s.hpa.desired_pods
274272
stability: experimental
275273
brief: "Desired number of replica pods managed by this horizontal pod autoscaler, as last calculated by the autoscaler"
276-
# TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented
277274
note: |
278275
This metric aligns with the `desiredReplicas` field of the
279276
[K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling)
@@ -287,7 +284,6 @@ groups:
287284
metric_name: k8s.hpa.current_pods
288285
stability: experimental
289286
brief: "Current number of replica pods managed by this horizontal pod autoscaler, as last seen by the autoscaler"
290-
# TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented
291287
note: |
292288
This metric aligns with the `currentReplicas` field of the
293289
[K8s HorizontalPodAutoscalerStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerstatus-v2-autoscaling)
@@ -301,7 +297,6 @@ groups:
301297
metric_name: k8s.hpa.max_pods
302298
stability: experimental
303299
brief: "The upper limit for the number of replica pods to which the autoscaler can scale up"
304-
# TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented
305300
note: |
306301
This metric aligns with the `maxReplicas` field of the
307302
[K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling)
@@ -315,7 +310,6 @@ groups:
315310
metric_name: k8s.hpa.min_pods
316311
stability: experimental
317312
brief: "The lower limit for the number of replica pods to which the autoscaler can scale down"
318-
# TODO: Add note for resource correlation once https://github.com/open-telemetry/semantic-conventions/issues/1656 is implemented
319313
note: |
320314
This metric aligns with the `minReplicas` field of the
321315
[K8s HorizontalPodAutoscalerSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#horizontalpodautoscalerspec-v2-autoscaling)

schema-next.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ file_format: 1.1.0
22
schema_url: https://opentelemetry.io/schemas/next
33
versions:
44
next:
5+
metrics:
6+
changes:
7+
- rename_metrics:
8+
k8s.replication_controller.desired_pods: k8s.replicationcontroller.desired_pods
9+
k8s.replication_controller.available_pods: k8s.replicationcontroller.available_pods
510
1.30.0:
611
all:
712
changes:

0 commit comments

Comments
 (0)