open-telemetry / opentelemetry-js

OpenTelemetry JavaScript Client
https://opentelemetry.io
Apache License 2.0
2.75k stars 808 forks source link

refactor(sdk-metrics): replace `MetricsAttributes` with `Attributes` #5021

Closed david-luna closed 1 month ago

david-luna commented 1 month ago

Which problem is this PR solving?

Replaces MetricsAttributes with Attributes

Refs #4175

Short description of the changes

Replace the interfaces in sources & tests.

How Has This Been Tested?

at the root folder

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.92%. Comparing base (f8ab559) to head (fa06e47). Report is 21 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5021 +/- ## ========================================== + Coverage 93.39% 93.92% +0.53% ========================================== Files 46 310 +264 Lines 712 8138 +7426 Branches 120 1633 +1513 ========================================== + Hits 665 7644 +6979 - Misses 47 494 +447 ``` | [Files with missing lines](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [packages/sdk-metrics/src/Instruments.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2FInstruments.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL0luc3RydW1lbnRzLnRz) | `96.00% <100.00%> (ø)` | | | [packages/sdk-metrics/src/ObservableResult.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2FObservableResult.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL09ic2VydmFibGVSZXN1bHQudHM=) | `100.00% <100.00%> (ø)` | | | [packages/sdk-metrics/src/aggregator/types.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2Faggregator%2Ftypes.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL2FnZ3JlZ2F0b3IvdHlwZXMudHM=) | `100.00% <ø> (ø)` | | | [...xemplar/AlignedHistogramBucketExemplarReservoir.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2Fexemplar%2FAlignedHistogramBucketExemplarReservoir.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL2V4ZW1wbGFyL0FsaWduZWRIaXN0b2dyYW1CdWNrZXRFeGVtcGxhclJlc2Vydm9pci50cw==) | `92.30% <ø> (ø)` | | | [...metrics/src/exemplar/AlwaysSampleExemplarFilter.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2Fexemplar%2FAlwaysSampleExemplarFilter.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL2V4ZW1wbGFyL0Fsd2F5c1NhbXBsZUV4ZW1wbGFyRmlsdGVyLnRz) | `100.00% <ø> (ø)` | | | [...ages/sdk-metrics/src/exemplar/ExemplarReservoir.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2Fexemplar%2FExemplarReservoir.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL2V4ZW1wbGFyL0V4ZW1wbGFyUmVzZXJ2b2lyLnRz) | `95.65% <100.00%> (ø)` | | | [...-metrics/src/exemplar/NeverSampleExemplarFilter.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2Fexemplar%2FNeverSampleExemplarFilter.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL2V4ZW1wbGFyL05ldmVyU2FtcGxlRXhlbXBsYXJGaWx0ZXIudHM=) | `100.00% <ø> (ø)` | | | [...s/src/exemplar/SimpleFixedSizeExemplarReservoir.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2Fexemplar%2FSimpleFixedSizeExemplarReservoir.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL2V4ZW1wbGFyL1NpbXBsZUZpeGVkU2l6ZUV4ZW1wbGFyUmVzZXJ2b2lyLnRz) | `77.77% <ø> (ø)` | | | [...dk-metrics/src/exemplar/WithTraceExemplarFilter.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2Fexemplar%2FWithTraceExemplarFilter.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL2V4ZW1wbGFyL1dpdGhUcmFjZUV4ZW1wbGFyRmlsdGVyLnRz) | `100.00% <ø> (ø)` | | | [packages/sdk-metrics/src/export/MetricData.ts](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree&filepath=packages%2Fsdk-metrics%2Fsrc%2Fexport%2FMetricData.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-cGFja2FnZXMvc2RrLW1ldHJpY3Mvc3JjL2V4cG9ydC9NZXRyaWNEYXRhLnRz) | `100.00% <ø> (ø)` | | | ... and [5 more](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | | ... and [251 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-js/pull/5021/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)