diff --git a/.chloggen/k8sclusterreceiver-empty-units.yaml b/.chloggen/k8sclusterreceiver-empty-units.yaml new file mode 100755 index 000000000000..b71073226f5c --- /dev/null +++ b/.chloggen/k8sclusterreceiver-empty-units.yaml @@ -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] diff --git a/receiver/k8sclusterreceiver/documentation.md b/receiver/k8sclusterreceiver/documentation.md index eec98dc83653..cd992767034c 100644 --- a/receiver/k8sclusterreceiver/documentation.md +++ b/receiver/k8sclusterreceiver/documentation.md @@ -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 @@ -226,7 +226,7 @@ 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 @@ -234,7 +234,7 @@ Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 | Unit | Metric Type | Value Type | | ---- | ----------- | ---------- | -| 1 | Gauge | Int | +| | Gauge | Int | ### k8s.replicaset.available @@ -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 diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go index 29d33cfbf195..1f1eea8778fb 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go @@ -316,7 +316,7 @@ type metricK8sContainerReady struct { func (m *metricK8sContainerReady) init() { m.data.SetName("k8s.container.ready") m.data.SetDescription("Whether a container has passed its readiness probe (0 for no, 1 for yes)") - m.data.SetUnit("1") + m.data.SetUnit("") m.data.SetEmptyGauge() } @@ -1296,7 +1296,7 @@ type metricK8sNamespacePhase struct { func (m *metricK8sNamespacePhase) init() { m.data.SetName("k8s.namespace.phase") m.data.SetDescription("The current phase of namespaces (1 for active and 0 for terminating)") - m.data.SetUnit("1") + m.data.SetUnit("") m.data.SetEmptyGauge() } @@ -1345,7 +1345,7 @@ type metricK8sPodPhase struct { func (m *metricK8sPodPhase) init() { m.data.SetName("k8s.pod.phase") m.data.SetDescription("Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown)") - m.data.SetUnit("1") + m.data.SetUnit("") m.data.SetEmptyGauge() } @@ -1394,7 +1394,7 @@ type metricK8sPodStatusReason struct { func (m *metricK8sPodStatusReason) init() { m.data.SetName("k8s.pod.status_reason") m.data.SetDescription("Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4 - Shutdown, 5 - UnexpectedAdmissionError, 6 - Unknown)") - m.data.SetUnit("1") + m.data.SetUnit("") m.data.SetEmptyGauge() } diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go index ab50cd55b370..2f99fa686c44 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go @@ -360,7 +360,7 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) assert.Equal(t, "Whether a container has passed its readiness probe (0 for no, 1 for yes)", ms.At(i).Description()) - assert.Equal(t, "1", ms.At(i).Unit()) + assert.Equal(t, "", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) assert.Equal(t, ts, dp.Timestamp()) @@ -600,7 +600,7 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) assert.Equal(t, "The current phase of namespaces (1 for active and 0 for terminating)", ms.At(i).Description()) - assert.Equal(t, "1", ms.At(i).Unit()) + assert.Equal(t, "", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) assert.Equal(t, ts, dp.Timestamp()) @@ -612,7 +612,7 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) assert.Equal(t, "Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown)", ms.At(i).Description()) - assert.Equal(t, "1", ms.At(i).Unit()) + assert.Equal(t, "", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) assert.Equal(t, ts, dp.Timestamp()) @@ -624,7 +624,7 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) assert.Equal(t, "Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4 - Shutdown, 5 - UnexpectedAdmissionError, 6 - Unknown)", ms.At(i).Description()) - assert.Equal(t, "1", ms.At(i).Unit()) + assert.Equal(t, "", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) assert.Equal(t, ts, dp.Timestamp()) diff --git a/receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml index 5956e840ce49..4771bd14f819 100644 --- a/receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml @@ -18,7 +18,7 @@ resourceMetrics: dataPoints: - asInt: "0" name: k8s.namespace.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest diff --git a/receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml index 00b6375da336..cb9a83700cb5 100644 --- a/receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml @@ -24,7 +24,7 @@ resourceMetrics: dataPoints: - asInt: "3" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -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: diff --git a/receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml b/receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml index cf170fcc7d8c..f70a396e747a 100644 --- a/receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml +++ b/receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml @@ -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 @@ -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: diff --git a/receiver/k8sclusterreceiver/metadata.yaml b/receiver/k8sclusterreceiver/metadata.yaml index 304346fd87c1..880bde3375fa 100644 --- a/receiver/k8sclusterreceiver/metadata.yaml +++ b/receiver/k8sclusterreceiver/metadata.yaml @@ -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 @@ -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 diff --git a/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml b/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml index d3e2809d84db..734f36a76fac 100644 --- a/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml +++ b/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml @@ -19,7 +19,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" name: k8s.namespace.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -43,7 +43,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" name: k8s.namespace.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -67,7 +67,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" name: k8s.namespace.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -91,7 +91,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" name: k8s.namespace.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -115,7 +115,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" name: k8s.namespace.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -469,7 +469,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -499,7 +499,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -529,7 +529,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -559,7 +559,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -589,7 +589,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -619,7 +619,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -649,7 +649,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -679,7 +679,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -709,7 +709,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -739,7 +739,7 @@ resourceMetrics: - asInt: "2" timeUnixNano: "1686772769034865545" name: k8s.pod.phase - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -788,7 +788,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" 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: @@ -851,7 +851,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" 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: @@ -928,7 +928,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" 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: @@ -984,7 +984,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" 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: @@ -1040,7 +1040,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" 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: @@ -1096,7 +1096,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" name: k8s.container.ready - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -1145,7 +1145,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" 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: @@ -1215,7 +1215,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" 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: @@ -1292,7 +1292,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" name: k8s.container.ready - unit: "1" + unit: "" scope: name: otelcol/k8sclusterreceiver version: latest @@ -1341,7 +1341,7 @@ resourceMetrics: - asInt: "1" timeUnixNano: "1686772769034865545" 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: