Skip to content

Commit

Permalink
Updated debug messages when ignoring values
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorik van der Werf committed Sep 2, 2020
1 parent 136c9ed commit 3fddbbd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/integration/harvester_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ func (ha harvesterDecorator) HarvestNow(ctx context.Context) {
}

func (ha harvesterDecorator) processMetric(f float64, m telemetry.Metric) {
if isNaNOrInfinity(f) {
if math.IsNaN(f) {
logrus.Debugf("Ignoring NaN float value for metric: %v", m)
return
}

ha.innerHarvester.RecordMetric(m)
}
if math.IsInf(f, 0) {
logrus.Debugf("Ignoring Infinite float value for metric: %v", m)
return
}

func isNaNOrInfinity(f float64) bool {
return math.IsInf(f, 0) || math.IsNaN(f)
ha.innerHarvester.RecordMetric(m)
}

0 comments on commit 3fddbbd

Please sign in to comment.