Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk-metrics)!: extract IMetricReader interface and use it over abstract class #5311

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pichlermarc
Copy link
Member

Which problem is this PR solving?

We periodically run into problems since private properties in classes cause the type to be incompatible between versions. This PR fixes that for MetricReader by extracting an interface which we then use instead of the abstract class type in our public interface.

In this PR MetricReader type stays as-is, but this is marked as a breaking change since we technically narrow down what's being provided by MeterProviderOptions.

Part of #5283

Type of change

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

@pichlermarc pichlermarc added pkg:sdk-metrics target:next-major-release This PR targets the next major release (`next` branch) labels Jan 9, 2025
@pichlermarc pichlermarc added this to the OpenTelemetry SDK 2.0 milestone Jan 9, 2025
@pichlermarc pichlermarc marked this pull request as ready for review January 9, 2025 17:37
@pichlermarc pichlermarc requested a review from a team as a code owner January 9, 2025 17:37
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.63%. Comparing base (c408d21) to head (d88e876).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5311      +/-   ##
==========================================
+ Coverage   94.62%   94.63%   +0.01%     
==========================================
  Files         323      323              
  Lines        8071     8071              
  Branches     1640     1640              
==========================================
+ Hits         7637     7638       +1     
+ Misses        434      433       -1     
Files with missing lines Coverage Δ
...imental/packages/opentelemetry-sdk-node/src/sdk.ts 96.93% <100.00%> (ø)
packages/sdk-metrics/src/MeterProvider.ts 100.00% <ø> (ø)
packages/sdk-metrics/src/export/MetricReader.ts 100.00% <100.00%> (ø)
packages/sdk-metrics/src/state/MetricCollector.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:sdk-metrics target:next-major-release This PR targets the next major release (`next` branch)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant