Skip to content

Commit

Permalink
Undo bucket boundaries change to preserve BC
Browse files Browse the repository at this point in the history
"SDKs SHOULD use the default value when boundaries are not explicitly provided, unless they have good reasons to use something different (e.g. for backward compatibility reasons in a stable SDK release)."
  • Loading branch information
Nevay committed Dec 9, 2023
1 parent 8691a1e commit f06d75d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SDK/Metrics/DefaultAggregationProviderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function defaultAggregation($instrumentType, array $advisory = []): ?Aggr
case InstrumentType::ASYNCHRONOUS_UP_DOWN_COUNTER:
return new Aggregation\SumAggregation();
case InstrumentType::HISTOGRAM:
return new Aggregation\ExplicitBucketHistogramAggregation($advisory['ExplicitBucketBoundaries'] ?? [0, 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500, 5000, 7500, 10000]);
return new Aggregation\ExplicitBucketHistogramAggregation($advisory['ExplicitBucketBoundaries'] ?? [0, 5, 10, 25, 50, 75, 100, 250, 500, 1000]);
case InstrumentType::ASYNCHRONOUS_GAUGE:
return new Aggregation\LastValueAggregation();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function test_default_aggregation_returns_default_aggregation(): void
$this->assertEquals(new SumAggregation(true), $reader->defaultAggregation(InstrumentType::ASYNCHRONOUS_COUNTER));
$this->assertEquals(new SumAggregation(), $reader->defaultAggregation(InstrumentType::UP_DOWN_COUNTER));
$this->assertEquals(new SumAggregation(), $reader->defaultAggregation(InstrumentType::ASYNCHRONOUS_UP_DOWN_COUNTER));
$this->assertEquals(new ExplicitBucketHistogramAggregation([0, 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500, 5000, 7500, 10000]), $reader->defaultAggregation(InstrumentType::HISTOGRAM));
$this->assertEquals(new ExplicitBucketHistogramAggregation([0, 5, 10, 25, 50, 75, 100, 250, 500, 1000]), $reader->defaultAggregation(InstrumentType::HISTOGRAM));
$this->assertEquals(new LastValueAggregation(), $reader->defaultAggregation(InstrumentType::ASYNCHRONOUS_GAUGE));
}

Expand Down

0 comments on commit f06d75d

Please sign in to comment.