Metrics SDK should provide testing library that can construct instances of SDK data interfaces.
Right now, we are hiding all the concrete class (but also the constructors) for SDK data, which means either:
- Downstream users need to create their own data hierarchy for testing.
- Downstream users need to depend on internal construction mechanisms.
We should definitely provide constructors of these data points at a MINIMUM for users to test their own SDK extensions.
Originally posted by @jsuereth in https://github.com/open-telemetry/opentelemetry-java/pull/4242#discussion_r852306662
Copying in comment here for tracking
Yeah we still need to introduce a testing version of data construction similar to what we have for SpanData, probably with builders to avoid the long factory methods. For most cases though do the assertj helpers work?
Realized though that for exporters the assertj helpers don't apply. Still I'd generally expect the tests to use the API+SDK itself in many cases - not a reason to avoid the testing builders, just a potential way with the current code.