export Metrics classes and types#265
export Metrics classes and types#265mayurkale22 merged 1 commit intocensus-instrumentation:masterfrom
Conversation
c542988 to
0cd2b8d
Compare
| export * from './metrics/gauges/types'; | ||
| import {Metric, MetricDescriptor, TimeSeries, MetricDescriptorType, LabelKey, LabelValue, Point as TimeSeriesPoint, DistributionValue, BucketOptions, Bucket as DistributionBucket, SummaryValue, Explicit, Exemplar, Timestamp, Snapshot, ValueAtPercentile, MetricProducerManager, MetricProducer} from './metrics/export/types'; | ||
|
|
||
| export { |
There was a problem hiding this comment.
Would it be equivalent to use export {Metric, ...} from './metrics/export/types' rather than importing them and then exporting them? If so, that feels a little more compact to me.
There was a problem hiding this comment.
The only reason I did this way is to resolve ambiguity. The Bucket and Point are already exported under stats module. Both the members are there for metrics module also, I have added alias for Point -> TimeSeriesPoint and Bucket -> DistributionBucket before exporting it.
There was a problem hiding this comment.
OK, makes sense. Would it work to use export .. from ... for the things that aren't renamed and then a separate import and export for the things that get renamed?
Really a nit though so feel free to leave as is.
| export * from './metrics/gauges/types'; | ||
| import {Metric, MetricDescriptor, TimeSeries, MetricDescriptorType, LabelKey, LabelValue, Point as TimeSeriesPoint, DistributionValue, BucketOptions, Bucket as DistributionBucket, SummaryValue, Explicit, Exemplar, Timestamp, Snapshot, ValueAtPercentile, MetricProducerManager, MetricProducer} from './metrics/export/types'; | ||
|
|
||
| export { |
There was a problem hiding this comment.
OK, makes sense. Would it work to use export .. from ... for the things that aren't renamed and then a separate import and export for the things that get renamed?
Really a nit though so feel free to leave as is.
No description provided.