[sdk-metrics] clarify interface to show that Aggregation
is not user-implementable
#4654
Labels
never-stale
pkg:sdk-metrics
target:next-major-release
This PR targets the next major release (`next` branch)
type:feature
A feature with no sub-issues to address
Milestone
Description
For users the nature of the
Aggregation
class can be confusing, as it seems like it should be user-implementable but it actually is not as the needed types are not exported (see #4616). The concept of user-implementableAggregation
s is called anAggregator
and this term is currently reserved for a future spec:To avoid confusion we should change the public interface of
View
to take an aggregation descriptor. Instead of creating and referencing anAggregation
instance directly, we can replace it with aenum
that designates the type, as well as the options which can be part of the aggregation descriptor passed to theView
. We can then use these descriptors to instantiateAggregation
s internally.Example: Drop Aggregation
Before:
After:
Example: Explicit Bucket Histogram Aggregation
Before:
After:
Tasks:
ViewOptions.aggregation
property's type with a type similar to what's described in the examples above, instantiate allAggregation
s internallyAggregation
from the public interface, ensure thatAggregation
is not exported from the@opentelemtry/sdk-metrics
package.The text was updated successfully, but these errors were encountered: