Skip to content

Commit

Permalink
[receiver/windowsperfcountersreceiver] Emit double values instead of …
Browse files Browse the repository at this point in the history
…integer values (open-telemetry#9138)

* emit double values instead of integral values
  • Loading branch information
BinaryFissionGames committed Apr 11, 2022
1 parent 83d292c commit 69fe795
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,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
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)
}
}

0 comments on commit 69fe795

Please sign in to comment.