Skip to content

Commit

Permalink
[k8sclusterreceiver] refactor state metrics to use empty units (#27091)
Browse files Browse the repository at this point in the history
**Description:** 

Change k8s.container.ready, k8s.pod.phase, k8s.pod.status_reason,
k8s.namespace.phase units to empty

**Link to tracking Issue:** #10553
  • Loading branch information
povilasv committed Oct 10, 2023
1 parent 91643ba commit bed78f3
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 47 deletions.
27 changes: 27 additions & 0 deletions .chloggen/k8sclusterreceiver-empty-units.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: k8sclusterreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "change k8s.container.ready, k8s.pod.phase, k8s.pod.status_reason, k8s.namespace.phase units to empty"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [10553]

# (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:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
8 changes: 4 additions & 4 deletions receiver/k8sclusterreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Whether a container has passed its readiness probe (0 for no, 1 for yes)
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Int |
| | Gauge | Int |
### k8s.container.restarts
Expand Down Expand Up @@ -226,15 +226,15 @@ The current phase of namespaces (1 for active and 0 for terminating)
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Int |
| | Gauge | Int |
### k8s.pod.phase
Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown)
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Int |
| | Gauge | Int |
### k8s.replicaset.available
Expand Down Expand Up @@ -402,7 +402,7 @@ Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Int |
| | Gauge | Int |

## Resource Attributes

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resourceMetrics:
dataPoints:
- asInt: "0"
name: k8s.namespace.phase
unit: "1"
unit: ""
scope:
name: otelcol/k8sclusterreceiver
version: latest
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resourceMetrics:
dataPoints:
- asInt: "3"
name: k8s.pod.phase
unit: "1"
unit: ""
scope:
name: otelcol/k8sclusterreceiver
version: latest
Expand Down Expand Up @@ -71,7 +71,7 @@ resourceMetrics:
dataPoints:
- asInt: "1"
name: k8s.container.ready
unit: "1"
unit: ""
- description: Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
gauge:
dataPoints:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ resourceMetrics:
dataPoints:
- asInt: "4"
name: k8s.pod.phase
unit: "1"
unit: ""
- description: Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4 - Shutdown, 5 - UnexpectedAdmissionError, 6 - Unknown)
gauge:
dataPoints:
- asInt: "1"
name: k8s.pod.status_reason
unit: "1"
unit: ""
scope:
name: otelcol/k8sclusterreceiver
version: latest
Expand Down Expand Up @@ -77,7 +77,7 @@ resourceMetrics:
dataPoints:
- asInt: "1"
name: k8s.container.ready
unit: "1"
unit: ""
- description: Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
gauge:
dataPoints:
Expand Down
8 changes: 4 additions & 4 deletions receiver/k8sclusterreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,20 @@ metrics:
k8s.container.ready:
enabled: true
description: Whether a container has passed its readiness probe (0 for no, 1 for yes)
unit: 1
unit: ""
gauge:
value_type: int

k8s.pod.phase:
enabled: true
description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown)
unit: 1
unit: ""
gauge:
value_type: int
k8s.pod.status_reason:
enabled: false
description: Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4 - Shutdown, 5 - UnexpectedAdmissionError, 6 - Unknown)
unit: 1
unit: ""
gauge:
value_type: int

Expand Down Expand Up @@ -369,7 +369,7 @@ metrics:
k8s.namespace.phase:
enabled: true
description: The current phase of namespaces (1 for active and 0 for terminating)
unit: 1
unit: ""
gauge:
value_type: int

Expand Down
Loading

0 comments on commit bed78f3

Please sign in to comment.