Skip to content

refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope - #2959

Merged
legendecas merged 5 commits into
open-telemetry:mainfrom
dynatrace-oss-contrib:rename-instrumentation-library
May 11, 2022
Merged

refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope#2959
legendecas merged 5 commits into
open-telemetry:mainfrom
dynatrace-oss-contrib:rename-instrumentation-library

Conversation

@pichlermarc

@pichlermarc pichlermarc commented May 10, 2022

Copy link
Copy Markdown
Member

Which problem is this PR solving?

The spec renamed InstrumentationLibrary to InstrumentationScope. This PR renames InstrumentationLibrary to InstrumentationScope to match the spec (Metrics ONLY)

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • breaking change for experimental packages

How Has This Been Tested?

  • Unit Tests

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added updated
  • Documentation has been updated

@pichlermarc pichlermarc changed the title refactor(metrics-sdk): rename InstrumenationLibrary -> InstrumenationScope refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope May 10, 2022
@codecov

codecov Bot commented May 10, 2022

Copy link
Copy Markdown

Codecov Report

Merging #2959 (f37bc81) into main (4c99541) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2959   +/-   ##
=======================================
  Coverage   92.78%   92.78%           
=======================================
  Files         183      183           
  Lines        5921     5921           
  Branches     1257     1257           
=======================================
  Hits         5494     5494           
  Misses        427      427           
Impacted Files Coverage Δ
...elemetry-sdk-metrics-base/src/export/MetricData.ts 100.00% <ø> (ø)
...-metrics-base/src/state/TemporalMetricProcessor.ts 97.91% <ø> (ø)
...ry-exporter-prometheus/src/PrometheusSerializer.ts 95.12% <100.00%> (ø)
...metrics-base/src/state/MeterProviderSharedState.ts 100.00% <100.00%> (ø)
...try-sdk-metrics-base/src/state/MeterSharedState.ts 97.50% <100.00%> (ø)
...etry-sdk-metrics-base/src/state/MetricCollector.ts 100.00% <100.00%> (ø)
...ckages/opentelemetry-sdk-metrics-base/src/utils.ts 100.00% <100.00%> (ø)
...elemetry-sdk-metrics-base/src/view/ViewRegistry.ts 100.00% <100.00%> (ø)
.../packages/otlp-transformer/src/metrics/internal.ts 98.07% <100.00%> (ø)

@pichlermarc
pichlermarc marked this pull request as ready for review May 10, 2022 15:00
@pichlermarc
pichlermarc requested a review from a team May 10, 2022 15:00
Comment thread CHANGELOG.md Outdated
* feat: warn when hooked module is already loaded [#2926](https://github.com/open-telemetry/opentelemetry-js/pull/2926) @nozik
* feat: implement OSDetector [#2927](https://github.com/open-telemetry/opentelemetry-js/pull/2927) @rauno56
* feat: implement HostDetector [#2921](https://github.com/open-telemetry/opentelemetry-js/pull/2921) @rauno56
* refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope [#2959](https://github.com/open-telemetry/opentelemetry-js/pull/2959) @pichlermarc

@legendecas legendecas May 10, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two CHANGELOG files: one in the root directory and one in the exprimental/. I find that people tend to overlook the one in the experimental/ directory. Maybe we should merge those two.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also picked the wrong one more than once. 😅

However, I added this entry in both CHANGELOG.md files intentionally as it adds InstrumentationScope to @opentelemetry/core (enhancement for stable), but also changes field names in the Metrics SDK (breaking for experimental).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case you should modify both changelog files like you did.

There are two CHANGELOG files: one in the root directory and one in the exprimental/. I find that people tend to overlook the one in the experimental/ directory. Maybe we should merge those two.

I thought about this, but I think it makes for a confusing changelog file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope [#2959](https://github.com/open-telemetry/opentelemetry-js/pull/2959) @pichlermarc
* `@opentelemetry/core`: add InstrumentationScope [#2959](https://github.com/open-telemetry/opentelemetry-js/pull/2959) @pichlermarc

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the changelog entry for stable in b5296d9 🙂

@dyladan dyladan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big PR but most renames like this are. LGTM and I don't think any were missed.

Comment thread CHANGELOG.md Outdated
* feat: warn when hooked module is already loaded [#2926](https://github.com/open-telemetry/opentelemetry-js/pull/2926) @nozik
* feat: implement OSDetector [#2927](https://github.com/open-telemetry/opentelemetry-js/pull/2927) @rauno56
* feat: implement HostDetector [#2921](https://github.com/open-telemetry/opentelemetry-js/pull/2921) @rauno56
* refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope [#2959](https://github.com/open-telemetry/opentelemetry-js/pull/2959) @pichlermarc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case you should modify both changelog files like you did.

There are two CHANGELOG files: one in the root directory and one in the exprimental/. I find that people tend to overlook the one in the experimental/ directory. Maybe we should merge those two.

I thought about this, but I think it makes for a confusing changelog file.

Comment thread CHANGELOG.md Outdated
* feat: warn when hooked module is already loaded [#2926](https://github.com/open-telemetry/opentelemetry-js/pull/2926) @nozik
* feat: implement OSDetector [#2927](https://github.com/open-telemetry/opentelemetry-js/pull/2927) @rauno56
* feat: implement HostDetector [#2921](https://github.com/open-telemetry/opentelemetry-js/pull/2921) @rauno56
* refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope [#2959](https://github.com/open-telemetry/opentelemetry-js/pull/2959) @pichlermarc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope [#2959](https://github.com/open-telemetry/opentelemetry-js/pull/2959) @pichlermarc
* `@opentelemetry/core`: add InstrumentationScope [#2959](https://github.com/open-telemetry/opentelemetry-js/pull/2959) @pichlermarc

@legendecas legendecas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Just a minor naming question.


export interface InstrumentationLibraryMetrics {
instrumentationLibrary: InstrumentationLibrary;
export interface ScopeMetrics {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is InstrumentationScopeMetrics a name to be considered? Although it is somewhat verbose, we are not introducing any new term in the case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I found that this is the name in the OTLP proto.

@pichlermarc pichlermarc May 11, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I found that this is the name in the OTLP proto.

I considered InstrumentationScopeMetrics at first, but I think having this to as close as possible to the OTLP proto would make sense. 🙂

I checked the other language SDKs but there does not seem to be a consensus on what to call it. Java uses this MetricData to send to the Exporter, .NET does not map the concept directly, and Python is currently in the process of changing it to ScopeMetrics. If that Python PR merges, we will have consistent naming across Python, and JS and proto. 🙂

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its fine if we're matching the proto

@legendecas
legendecas merged commit 97bc632 into open-telemetry:main May 11, 2022
@dyladan
dyladan deleted the rename-instrumentation-library branch May 11, 2022 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants