Add tests to validate spatial aggregation #1416
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added tests to validate SDK is doing "spatial aggregation" correctly. That term is no longer used explicitly in the spec, but the expected behavior is not currently implemented. Based on my experience, many implementations had/have this bug.
eg: .NET had this bug from day1 and not fixed as of today. https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/test/OpenTelemetry.Tests/Metrics/MetricApiTestsBase.cs#L883-L886
Related discussions on this topic:
open-telemetry/opentelemetry-specification#2905
open-telemetry/opentelemetry-specification#1874
The tests are ignored now (they won't pass today!), but I think its worth while to have them, while we work on Metrics SDK, to help us keep in mind some edge scenarios.
I'll dig more into fixing these. The shared discussions above only affected Observable instruments, but we are failing for Non-observable as well here, so there are likely more changes required.