Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[SDK] Fix MetricProducer interface #3413

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

Merged
merged 5 commits into from
May 20, 2025

Conversation

yashykt
Copy link
Contributor

@yashykt yashykt commented May 15, 2025

Fixes #3412

Changes

Cleans up the MetricProducer interface by removing the unused metric_filter_ parameter.

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@yashykt yashykt requested a review from a team as a code owner May 15, 2025 01:35
@yashykt
Copy link
Contributor Author

yashykt commented May 15, 2025

@IcySteam

Copy link

netlify bot commented May 15, 2025

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit e0f2731
🔍 Latest deploy log https://app.netlify.com/projects/opentelemetry-cpp-api-docs/deploys/682cb1af75f23f0008b14941

Copy link

codecov bot commented May 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.06%. Comparing base (2faa400) to head (e0f2731).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3413      +/-   ##
==========================================
- Coverage   90.06%   90.06%   -0.00%     
==========================================
  Files         212      212              
  Lines        6939     6937       -2     
==========================================
- Hits         6249     6247       -2     
  Misses        690      690              
Files with missing lines Coverage Δ
...opentelemetry/sdk/metrics/export/metric_producer.h 100.00% <100.00%> (ø)
sdk/src/metrics/state/metric_collector.cc 93.23% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@IcySteam IcySteam left a comment

Choose a reason for hiding this comment

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

Thanks for the PR Yash, having two instances of metric_filter_ indeed looks to be an oversight.

Should we remove the metric_filter_ member from MetricCollector instead, in order to closer to match the description of the specs?

@yashykt
Copy link
Contributor Author

yashykt commented May 15, 2025

Should we remove the metric_filter_ member from MetricCollector instead, in order to closer to match the description of the open-telemetry/opentelemetry-specification#3566?

I was not involved in the creation of the spec, but I don't think they intended to add member variables to interfaces (since that no longer would be a pure interface) . I think they just meant that child classes of MetricCollector should take in metric_filter_. Either that or as a parameter to Produce

@ThomsonTan ThomsonTan merged commit 29ac517 into open-telemetry:main May 20, 2025
67 checks passed
malkia added a commit to malkia/opentelemetry-cpp that referenced this pull request May 20, 2025
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.

SDK's MetricProducer API needs cleanup
6 participants