Skip to content

[CODE HEALTH] Fix clang-tidy performance enum size warnings#3923

Open
marcalff wants to merge 3 commits intoopen-telemetry:mainfrom
marcalff:tidy_enum_size
Open

[CODE HEALTH] Fix clang-tidy performance enum size warnings#3923
marcalff wants to merge 3 commits intoopen-telemetry:mainfrom
marcalff:tidy_enum_size

Conversation

@marcalff
Copy link
Member

@marcalff marcalff commented Mar 11, 2026

Fixes # (issue)

Changes

Please provide a brief description of the changes here.

  • Fix clang-tidy performance-enum-size warnings
  • In the API, make sure to preserve enums as is for ABI_VERSION 1, for binary compatibility
  • Everywhere else, use smaller enums (std::uint8_t) when possible.

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 marked this pull request as ready for review March 11, 2026 21:13
@marcalff marcalff requested a review from a team as a code owner March 11, 2026 21:13
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.05%. Comparing base (bef0b90) to head (aea19a2).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3923      +/-   ##
==========================================
- Coverage   90.06%   90.05%   -0.01%     
==========================================
  Files         226      226              
  Lines        7223     7223              
==========================================
- Hits         6505     6504       -1     
- Misses        718      719       +1     
Files with missing lines Coverage Δ
...include/opentelemetry/sdk/common/attribute_utils.h 98.81% <ø> (ø)
...lude/opentelemetry/sdk/common/global_log_handler.h 50.00% <ø> (ø)
...e/opentelemetry/sdk/metrics/export/metric_filter.h 100.00% <ø> (ø)
...opentelemetry/sdk/metrics/export/metric_producer.h 100.00% <ø> (ø)
...dk/include/opentelemetry/sdk/metrics/instruments.h 75.76% <ø> (ø)
sdk/include/opentelemetry/sdk/trace/sampler.h 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.

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.

2 participants