Compatible aggregators should not error instrument creation #3240
Labels
area:metrics
Part of OpenTelemetry Metrics
bug
Something isn't working
pkg:SDK
Related to an SDK package
Milestone
The OTel spec says:
If a view translates an instrument into the exact same as another instrument the same aggregators from the already registered instrument should be updated and pulled from.
Currently, we do not check compatibility:
opentelemetry-go/sdk/metric/pipeline.go
Lines 107 to 109 in aca054b
Instead, we just return an error saying the instrument was already registered.
To make matters worse, with the error we return an
internal.Aggregator
that will never be pulled from:opentelemetry-go/sdk/metric/pipeline.go
Lines 229 to 238 in aca054b
Environment
Steps To Reproduce
Change this line to check for
NoError
opentelemetry-go/sdk/metric/pipeline_registry_test.go
Line 415 in aca054b
Run the tests
Expected behavior
Test should pass with that modification and the returned
internal.Aggregator
should update the existing registered on.eThe text was updated successfully, but these errors were encountered: