Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Loc Mai <locmai0201@gmail.com>
  • Loading branch information
locmai committed Mar 31, 2023
1 parent f21cc65 commit 3c69be1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exporter/prometheusexporter/accumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (a *lastValueAccumulator) accumulateHistogram(metric pmetric.Metric, il pco
mv := v.(*accumulatedValue)

m := copyMetricMetadata(metric)
m.Histogram().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
m.SetEmptyHistogram().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)

switch histogram.AggregationTemporality() {
case pmetric.AggregationTemporalityDelta:
Expand Down
2 changes: 1 addition & 1 deletion exporter/prometheusexporter/accumulator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestAccumulateHistogram(t *testing.T) {
appendHistogram := func(ts time.Time, count uint64, sum float64, counts []uint64, bounds []float64, metrics pmetric.MetricSlice) {
metric := metrics.AppendEmpty()
metric.SetName("test_metric")
metric.Histogram().SetAggregationTemporality(pmetric.AggregationTemporalityDelta)
metric.SetEmptyHistogram().SetAggregationTemporality(pmetric.AggregationTemporalityDelta)
metric.SetDescription("test description")
dp := metric.Histogram().DataPoints().AppendEmpty()
dp.SetCount(count)
Expand Down

0 comments on commit 3c69be1

Please sign in to comment.