Skip to content

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

Open
marcalff wants to merge 3 commits into
open-telemetry:mainfrom
marcalff:fix_const_cast
Open

[CODE HEALTH] Fix cppcoreguidelines-pro-type-const-cast for multi observer metrics.#4499
marcalff wants to merge 3 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.22%. Comparing base (bd4752b) to head (2c5678b).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4499      +/-   ##
==========================================
- Coverage   83.22%   83.22%   -0.00%     
==========================================
  Files         521      521              
  Lines       20404    20401       -3     
==========================================
- Hits        16980    16977       -3     
  Misses       3424     3424              
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%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant