From ae260154f73ef4796731454799fc763fd9dc0199 Mon Sep 17 00:00:00 2001 From: Sam DeHaan Date: Wed, 5 Oct 2022 14:11:23 -0400 Subject: [PATCH] [receiver/saphana] Fix units on saphana licenses metrics (#14695) Fix issue with units for two saphana metrics. --- .chloggen/saphana-fix-units.yaml | 11 +++++++++++ receiver/saphanareceiver/documentation.md | 4 ++-- .../internal/metadata/generated_metrics.go | 4 ++-- receiver/saphanareceiver/metadata.yaml | 4 ++-- .../testdata/expected_metrics/full.json | 4 ++-- 5 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 .chloggen/saphana-fix-units.yaml diff --git a/.chloggen/saphana-fix-units.yaml b/.chloggen/saphana-fix-units.yaml new file mode 100644 index 0000000000000..a82e996def32f --- /dev/null +++ b/.chloggen/saphana-fix-units.yaml @@ -0,0 +1,11 @@ +# 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: saphanareceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix incorrect use of units for saphana licenses metrics + +# One or more tracking issues related to the change +issues: [10565] diff --git a/receiver/saphanareceiver/documentation.md b/receiver/saphanareceiver/documentation.md index fc116c6e38b29..60ffc80909876 100644 --- a/receiver/saphanareceiver/documentation.md +++ b/receiver/saphanareceiver/documentation.md @@ -22,8 +22,8 @@ These are the metrics available for this scraper. | **saphana.instance.memory.shared.allocated** | The shared memory size of SAP HANA processes. | By | Sum(Int) | | | **saphana.instance.memory.used.peak** | The peak memory from the memory pool used by SAP HANA processes since the instance started (this is a sample-based value). | By | Sum(Int) | | | **saphana.license.expiration.time** | The amount of time remaining before license expiration. | s | Gauge(Int) | | -| **saphana.license.limit** | The allowed product usage as specified by the license (for example, main memory). | 1 | Sum(Int) | | -| **saphana.license.peak** | The peak product usage value during last 13 months, measured periodically. | 1 | Sum(Int) | | +| **saphana.license.limit** | The allowed product usage as specified by the license (for example, main memory). | {licenses} | Sum(Int) | | +| **saphana.license.peak** | The peak product usage value during last 13 months, measured periodically. | {licenses} | Sum(Int) | | | **saphana.network.request.average_time** | The average response time calculated over recent requests | ms | Gauge(Double) | | | **saphana.network.request.count** | The number of active and pending service requests. | {requests} | Sum(Int) | | | **saphana.network.request.finished.count** | The number of service requests that have completed. | {requests} | Sum(Int) | | diff --git a/receiver/saphanareceiver/internal/metadata/generated_metrics.go b/receiver/saphanareceiver/internal/metadata/generated_metrics.go index c288681b17928..22f677f379199 100644 --- a/receiver/saphanareceiver/internal/metadata/generated_metrics.go +++ b/receiver/saphanareceiver/internal/metadata/generated_metrics.go @@ -1462,7 +1462,7 @@ type metricSaphanaLicenseLimit struct { func (m *metricSaphanaLicenseLimit) init() { m.data.SetName("saphana.license.limit") m.data.SetDescription("The allowed product usage as specified by the license (for example, main memory).") - m.data.SetUnit("1") + m.data.SetUnit("{licenses}") m.data.SetEmptySum() m.data.Sum().SetIsMonotonic(false) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) @@ -1516,7 +1516,7 @@ type metricSaphanaLicensePeak struct { func (m *metricSaphanaLicensePeak) init() { m.data.SetName("saphana.license.peak") m.data.SetDescription("The peak product usage value during last 13 months, measured periodically.") - m.data.SetUnit("1") + m.data.SetUnit("{licenses}") m.data.SetEmptySum() m.data.Sum().SetIsMonotonic(false) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) diff --git a/receiver/saphanareceiver/metadata.yaml b/receiver/saphanareceiver/metadata.yaml index eb5be85f90890..b056cfae0fa8f 100644 --- a/receiver/saphanareceiver/metadata.yaml +++ b/receiver/saphanareceiver/metadata.yaml @@ -266,7 +266,7 @@ metrics: enabled: true saphana.license.limit: description: The allowed product usage as specified by the license (for example, main memory). - unit: '1' + unit: '{licenses}' sum: monotonic: false aggregation: cumulative @@ -276,7 +276,7 @@ metrics: enabled: true saphana.license.peak: description: The peak product usage value during last 13 months, measured periodically. - unit: '1' + unit: '{licenses}' sum: monotonic: false aggregation: cumulative diff --git a/receiver/saphanareceiver/testdata/expected_metrics/full.json b/receiver/saphanareceiver/testdata/expected_metrics/full.json index acf3d6f95b99b..f704e0919b7af 100644 --- a/receiver/saphanareceiver/testdata/expected_metrics/full.json +++ b/receiver/saphanareceiver/testdata/expected_metrics/full.json @@ -3289,7 +3289,7 @@ } ] }, - "unit": "1" + "unit": "{licenses}" }, { "description": "The peak product usage value during last 13 months, measured periodically.", @@ -3337,7 +3337,7 @@ } ] }, - "unit": "1" + "unit": "{licenses}" }, { "description": "The average amount of time consumed replicating a log.",