Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/windowsperfcountersreceiver] Emit double values instead of integer values #9138

Merged
merged 4 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +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 🚩

Expand Down Expand Up @@ -2007,4 +2008,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
[v0.0.1]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE",
"dataPoints": [
{
"asInt": "19446169600",
"asDouble": "19446169600",
"timeUnixNano": "1646862225775600200"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
}
}