opentelemetry-js
opentelemetry-js copied to clipboard
feat(sdk-metrics)!: drop View and Aggregation for options
Which problem is this PR solving?
Drops Aggregation and View for options (AggregationOption and ViewOptions, respectively). This means we will have two less classes exported from the @opentelemetry/sdk-metrics package. This has a few benefits:
Aggregationis not user-implementable, so having only options makes this clearer.Aggregationwas supposed to be used in exporters, however its type does reference SDK internal types as well. This means that if these supposedly internal types change, the exporter may break too if it pins an older version of@opentelemetry/sdk-metrics(which is a valid approach for writing an exporter).Viewis really only used internally and not directly by the user, so writingnew View({...})for each view is just additional work vs{...}.- making these internal opens up the possibility of non-breaking bundle size improvements in the future
Fixes #4654
Type of change
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
How Has This Been Tested?
- [x] Updated tests