Skip to content

[CODE HEALTH] Fix cppcoreguidelines-pro-type-const-cast for multi observer metrics. - #4499

Merged
dbarker merged 4 commits into
open-telemetry:mainfrom
marcalff:fix_const_cast
Aug 31, 2026
Merged

[CODE HEALTH] Fix cppcoreguidelines-pro-type-const-cast for multi observer metrics.#4499
dbarker merged 4 commits into
open-telemetry:mainfrom
marcalff:fix_const_cast

Conversation

@marcalff

@marcalff marcalff commented Aug 29, 2026

Copy link
Copy Markdown
Member

Fixes # (issue)

Changes

Please provide a brief description of the changes here.

  • Resolved cppcoreguidelines-pro-type-const-cast warnings in the multi observer code.
  • Changed the observer result map to keep const instruments instead of non const objects.
  • Adjusted the code accordingly.

For significant contributions please make sure you have completed the following items:

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

@marcalff
marcalff requested a review from a team as a code owner August 29, 2026 17:23
@marcalff marcalff changed the title Fix cppcoreguidelines-pro-type-const-cast for multi observer metrics. [CODE HEALTH] Fix cppcoreguidelines-pro-type-const-cast for multi observer metrics. Aug 29, 2026
@marcalff

Copy link
Copy Markdown
Member Author

@KJTsanaktsidis

Hi. Could you review this change when you have a chance ?

Small cleanup on the observer_results_ map to use const pointers.

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.25%. Comparing base (58ed80d) to head (9965fa4).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4499      +/-   ##
==========================================
+ Coverage   83.24%   83.25%   +0.01%     
==========================================
  Files         521      521              
  Lines       20384    20381       -3     
==========================================
- Hits        16967    16966       -1     
+ Misses       3417     3415       -2     
Files with missing lines Coverage Δ
sdk/src/metrics/async_instruments.cc 100.00% <100.00%> (ø)
sdk/src/metrics/multi_observer_result.cc 92.31% <100.00%> (-0.41%) ⬇️
sdk/src/metrics/state/observable_registry.cc 97.62% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

@dbarker dbarker 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.

Looks good. Thanks

@dbarker
dbarker merged commit ed49dd3 into open-telemetry:main Aug 31, 2026
130 of 131 checks passed
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