Skip to content

Commit 960a474

Browse files
povilasvjmsnll
authored andcommitted
[k8sclusterreceiver] refactor state metrics to use empty units (open-telemetry#27091)
**Description:** Change k8s.container.ready, k8s.pod.phase, k8s.pod.status_reason, k8s.namespace.phase units to empty **Link to tracking Issue:** open-telemetry#10553
1 parent 910493d commit 960a474

File tree

9 files changed

+74
-47
lines changed

9 files changed

+74
-47
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: k8sclusterreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "change k8s.container.ready, k8s.pod.phase, k8s.pod.status_reason, k8s.namespace.phase units to empty"
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [10553]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

receiver/k8sclusterreceiver/documentation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Whether a container has passed its readiness probe (0 for no, 1 for yes)
6666
6767
| Unit | Metric Type | Value Type |
6868
| ---- | ----------- | ---------- |
69-
| 1 | Gauge | Int |
69+
| | Gauge | Int |
7070
7171
### k8s.container.restarts
7272
@@ -226,15 +226,15 @@ The current phase of namespaces (1 for active and 0 for terminating)
226226
227227
| Unit | Metric Type | Value Type |
228228
| ---- | ----------- | ---------- |
229-
| 1 | Gauge | Int |
229+
| | Gauge | Int |
230230
231231
### k8s.pod.phase
232232
233233
Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown)
234234
235235
| Unit | Metric Type | Value Type |
236236
| ---- | ----------- | ---------- |
237-
| 1 | Gauge | Int |
237+
| | Gauge | Int |
238238
239239
### k8s.replicaset.available
240240
@@ -402,7 +402,7 @@ Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4
402402

403403
| Unit | Metric Type | Value Type |
404404
| ---- | ----------- | ---------- |
405-
| 1 | Gauge | Int |
405+
| | Gauge | Int |
406406

407407
## Resource Attributes
408408

receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ resourceMetrics:
1818
dataPoints:
1919
- asInt: "0"
2020
name: k8s.namespace.phase
21-
unit: "1"
21+
unit: ""
2222
scope:
2323
name: otelcol/k8sclusterreceiver
2424
version: latest

receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resourceMetrics:
2424
dataPoints:
2525
- asInt: "3"
2626
name: k8s.pod.phase
27-
unit: "1"
27+
unit: ""
2828
scope:
2929
name: otelcol/k8sclusterreceiver
3030
version: latest
@@ -71,7 +71,7 @@ resourceMetrics:
7171
dataPoints:
7272
- asInt: "1"
7373
name: k8s.container.ready
74-
unit: "1"
74+
unit: ""
7575
- description: Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
7676
gauge:
7777
dataPoints:

receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ resourceMetrics:
2424
dataPoints:
2525
- asInt: "4"
2626
name: k8s.pod.phase
27-
unit: "1"
27+
unit: ""
2828
- description: Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4 - Shutdown, 5 - UnexpectedAdmissionError, 6 - Unknown)
2929
gauge:
3030
dataPoints:
3131
- asInt: "1"
3232
name: k8s.pod.status_reason
33-
unit: "1"
33+
unit: ""
3434
scope:
3535
name: otelcol/k8sclusterreceiver
3636
version: latest
@@ -77,7 +77,7 @@ resourceMetrics:
7777
dataPoints:
7878
- asInt: "1"
7979
name: k8s.container.ready
80-
unit: "1"
80+
unit: ""
8181
- description: Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
8282
gauge:
8383
dataPoints:

receiver/k8sclusterreceiver/metadata.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,20 +245,20 @@ metrics:
245245
k8s.container.ready:
246246
enabled: true
247247
description: Whether a container has passed its readiness probe (0 for no, 1 for yes)
248-
unit: 1
248+
unit: ""
249249
gauge:
250250
value_type: int
251251

252252
k8s.pod.phase:
253253
enabled: true
254254
description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown)
255-
unit: 1
255+
unit: ""
256256
gauge:
257257
value_type: int
258258
k8s.pod.status_reason:
259259
enabled: false
260260
description: Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4 - Shutdown, 5 - UnexpectedAdmissionError, 6 - Unknown)
261-
unit: 1
261+
unit: ""
262262
gauge:
263263
value_type: int
264264

@@ -369,7 +369,7 @@ metrics:
369369
k8s.namespace.phase:
370370
enabled: true
371371
description: The current phase of namespaces (1 for active and 0 for terminating)
372-
unit: 1
372+
unit: ""
373373
gauge:
374374
value_type: int
375375

0 commit comments

Comments
 (0)