Skip to content

Commit

Permalink
Add more logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhlogin committed Nov 7, 2024
1 parent aa26b31 commit 1b8ca06
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion exporter/awsemfexporter/datapoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ func (dps exponentialHistogramDataPointSlice) CalculateDeltaDatapoints(idx int,
expectedSplitNumber := (totalBucketLen + splitThreshold - 1) / splitThreshold
if len(datapoints) != expectedSplitNumber {
logger.Warn("The number of splits does not match the expected number",
zap.Int("datapoints", len(datapoints)),
zap.Int("totalBucketLen", totalBucketLen),
zap.Int("splitThreshold", splitThreshold),
zap.Int("expectedSplitNumber", expectedSplitNumber),
zap.Int("datapoints", len(datapoints)),
)
}
expectedCount := metric.Count()
Expand All @@ -327,10 +329,17 @@ func (dps exponentialHistogramDataPointSlice) CalculateDeltaDatapoints(idx int,
zap.Float64("metricMin", metric.Min()),
)
}

var maxValues []float64
for _, dp := range datapoints {
maxValues = append(maxValues, dp.value.(*cWMetricHistogram).Max)
}

if metric.Max() != datapoints[0].value.(*cWMetricHistogram).Max {
logger.Warn("The max value of the first split does not match the max value of the metric",
zap.Float64("maxValue", datapoints[0].value.(*cWMetricHistogram).Max),
zap.Float64("metricMax", metric.Max()),
zap.Float64s("maxValues", maxValues),
)
}
return datapoints, true
Expand Down

0 comments on commit 1b8ca06

Please sign in to comment.