From 1fcc1109edd2233f73dd6467e9bceec29f4c2466 Mon Sep 17 00:00:00 2001 From: Brandon Johnson Date: Mon, 11 Apr 2022 12:38:12 -0400 Subject: [PATCH 1/4] emit double values instead of integral values --- .../windowsperfcounters_scraper.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/receiver/windowsperfcountersreceiver/windowsperfcounters_scraper.go b/receiver/windowsperfcountersreceiver/windowsperfcounters_scraper.go index 0390da65d91b..828986666d1a 100644 --- a/receiver/windowsperfcountersreceiver/windowsperfcounters_scraper.go +++ b/receiver/windowsperfcountersreceiver/windowsperfcounters_scraper.go @@ -165,15 +165,6 @@ func (s *scraper) scrape(context.Context) (pdata.Metrics, error) { return md, errs } -func initializeNumberDataPointAsDouble(dataPoint pdata.NumberDataPoint, now pdata.Timestamp, instanceLabel string, value float64) { - if instanceLabel != "" { - dataPoint.Attributes().InsertString(instanceLabelName, instanceLabel) - } - - dataPoint.SetTimestamp(now) - dataPoint.SetDoubleVal(value) -} - func initializeMetricDps(metric pdata.Metric, now pdata.Timestamp, counterValues []win_perf_counters.CounterValue, attributes map[string]string) { var dps pdata.NumberDataPointSlice @@ -197,6 +188,6 @@ func initializeMetricDps(metric pdata.Metric, now pdata.Timestamp, counterValues } dp.SetTimestamp(now) - dp.SetIntVal(int64(counterValue.Value)) + dp.SetDoubleVal(counterValue.Value) } } From 10aec23ac9e751159d0b921b976507c9f86f4654 Mon Sep 17 00:00:00 2001 From: Brandon Johnson Date: Mon, 11 Apr 2022 12:42:43 -0400 Subject: [PATCH 2/4] sum metric should also emit double --- .../testdata/scraper/sum_metric.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/windowsperfcountersreceiver/testdata/scraper/sum_metric.json b/receiver/windowsperfcountersreceiver/testdata/scraper/sum_metric.json index 518db2dfa87b..28a5a81fd75f 100644 --- a/receiver/windowsperfcountersreceiver/testdata/scraper/sum_metric.json +++ b/receiver/windowsperfcountersreceiver/testdata/scraper/sum_metric.json @@ -12,7 +12,7 @@ "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", "dataPoints": [ { - "asInt": "19446169600", + "asDouble": "19446169600", "timeUnixNano": "1646862225775600200" } ] From 261b66759294f7e82d2c23143c3c23e01ab7607e Mon Sep 17 00:00:00 2001 From: Brandon Johnson Date: Mon, 11 Apr 2022 12:54:02 -0400 Subject: [PATCH 3/4] add changelog entry --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a4250687cf3..96c6614eae80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ - `hostmetricsreceiver`: Use cpu times for time delta in cpu.utilization calculation (#8857) - `dynatraceexporter`: Remove overly verbose stacktrace from certain logs (#8989) - `googlecloudexporter`: fix the `exporter.googlecloud.OTLPDirect` fature-gate, which was not applied when the flag was provided (#9116) - +- `windowsperfcountersreceiver`: fix exported values being integers instead of doubles (#9138) ### 🚩 Deprecations 🚩 - `datadogexporter`: Deprecate `service` setting in favor of `service.name` semantic convention (#8784) @@ -2007,4 +2007,4 @@ First release of OpenTelemetry Collector Contrib. [v0.2.7]: https://github.com/open-telemetry/opentelemetry-collector-contrib/compare/v0.2.6...v0.2.7 [v0.2.6]: https://github.com/open-telemetry/opentelemetry-collector-contrib/compare/v0.0.5...v0.2.6 [v0.0.5]: https://github.com/open-telemetry/opentelemetry-collector-contrib/compare/v0.0.1...v0.0.5 -[v0.0.1]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.0.1 \ No newline at end of file +[v0.0.1]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.0.1 From 3add3be945119120badbfb0296c7b8e2d86f111f Mon Sep 17 00:00:00 2001 From: Brandon Johnson Date: Mon, 11 Apr 2022 13:38:31 -0400 Subject: [PATCH 4/4] add back removed newline in changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96c6614eae80..16064ed6fcf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - `dynatraceexporter`: Remove overly verbose stacktrace from certain logs (#8989) - `googlecloudexporter`: fix the `exporter.googlecloud.OTLPDirect` fature-gate, which was not applied when the flag was provided (#9116) - `windowsperfcountersreceiver`: fix exported values being integers instead of doubles (#9138) + ### 🚩 Deprecations 🚩 - `datadogexporter`: Deprecate `service` setting in favor of `service.name` semantic convention (#8784)