1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-29 23:07:45 +02:00

Implement WithExplicitBucketBoundaries option in the metric SDK (#4605)

This commit is contained in:
David Ashpole
2023-10-31 03:41:27 -04:00
committed by GitHub
parent 5ec67e83df
commit b2bb2ad00f
6 changed files with 229 additions and 34 deletions

View File

@@ -146,7 +146,8 @@ func testDefaultViewImplicit[N int64 | float64]() func(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
var c cache[string, instID]
i := newInserter[N](test.pipe, &c)
got, err := i.Instrument(inst)
readerAggregation := i.readerDefaultAggregation(inst.Kind)
got, err := i.Instrument(inst, readerAggregation)
require.NoError(t, err)
assert.Len(t, got, 1, "default view not applied")
for _, in := range got {
@@ -372,7 +373,8 @@ func TestInserterCachedAggregatorNameConflict(t *testing.T) {
pipe := newPipeline(nil, NewManualReader(), nil)
i := newInserter[int64](pipe, &vc)
_, origID, err := i.cachedAggregator(scope, kind, stream)
readerAggregation := i.readerDefaultAggregation(kind)
_, origID, err := i.cachedAggregator(scope, kind, stream, readerAggregation)
require.NoError(t, err)
require.Len(t, pipe.aggregations, 1)
@@ -382,7 +384,7 @@ func TestInserterCachedAggregatorNameConflict(t *testing.T) {
require.Equal(t, name, iSync[0].name)
stream.Name = "RequestCount"
_, id, err := i.cachedAggregator(scope, kind, stream)
_, id, err := i.cachedAggregator(scope, kind, stream, readerAggregation)
require.NoError(t, err)
assert.Equal(t, origID, id, "multiple aggregators for equivalent name")