Skip to content

fix: MetricExporters use getter methods instead of direct access #2973

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

Conversation

cijothomas
Copy link
Member

Fixes #
Design discussion issue (if applicable) #

Changes

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@cijothomas cijothomas requested a review from a team as a code owner May 16, 2025 04:46
Copy link

codecov bot commented May 16, 2025

Codecov Report

Attention: Patch coverage is 0% with 46 lines in your changes missing coverage. Please review.

Project coverage is 81.2%. Comparing base (8499914) to head (17cca6e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/metrics/data/mod.rs 0.0% 18 Missing ⚠️
opentelemetry-stdout/src/metrics/exporter.rs 0.0% 16 Missing ⚠️
opentelemetry-proto/src/transform/metrics.rs 0.0% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2973     +/-   ##
=======================================
- Coverage   81.3%   81.2%   -0.1%     
=======================================
  Files        126     126             
  Lines      24375   24394     +19     
=======================================
+ Hits       19827   19828      +1     
- Misses      4548    4566     +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -65,6 +65,12 @@ also modified to suppress telemetry before invoking exporters.
- `HistogramDataPoint` no longer exposes `bounds` and `bucket_counts`, but
instead offers `bounds()` and `bucket_counts()` methods that returns an
iterator over the same.
- `Metric` no longer exposes `name`, `description`, `unit`, `data` fields, but
Copy link
Contributor

Choose a reason for hiding this comment

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

The individual instrument and their datapoint related structs (such as Sum, SumDataPoint, etc.) also have some public fields where we can use getters.

@hdost
Copy link
Contributor

hdost commented May 16, 2025

It could be nice to have include rationale in PRs.

@cijothomas cijothomas merged commit d52dcef into open-telemetry:main May 20, 2025
26 of 27 checks passed
@cijothomas cijothomas deleted the cijothomas/metric-exporter-getter branch May 20, 2025 17:07
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.

4 participants