Skip to content

[CODE HEALTH] clean up nostd::variant access in otlp exporters#3973

Draft
dbarker wants to merge 4 commits intoopen-telemetry:mainfrom
dbarker:cleanup_nostd_variant_access_otlp_exporters
Draft

[CODE HEALTH] clean up nostd::variant access in otlp exporters#3973
dbarker wants to merge 4 commits intoopen-telemetry:mainfrom
dbarker:cleanup_nostd_variant_access_otlp_exporters

Conversation

@dbarker
Copy link
Copy Markdown
Member

@dbarker dbarker commented Apr 8, 2026

Fixes # (issue)

Changes

  • clean up use of nostd::holds_alternative/nostd::get if/else pattern
    • replace with nostd::visit in otlp AnyValue attribute utils
    • replace with nostd::get_if in otlp http client and otlp metric utils
  • Add tests for OtlpPopulateAttributeUtils
  • minor updates to OtlpMetricUtils to reduce data point copies and use const
  • update conversion of uint64 attribute values to match the standard (map to string on overflow of int).

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 96.50350% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.08%. Comparing base (0668d64) to head (294a38b).

Files with missing lines Patch % Lines
exporters/otlp/src/otlp_metric_utils.cc 88.89% 4 Missing ⚠️
exporters/otlp/src/otlp_http_client.cc 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3973      +/-   ##
==========================================
+ Coverage   82.04%   82.08%   +0.05%     
==========================================
  Files         385      385              
  Lines       15895    15916      +21     
==========================================
+ Hits        13039    13063      +24     
+ Misses       2856     2853       -3     
Files with missing lines Coverage Δ
...xporters/otlp/src/otlp_populate_attribute_utils.cc 98.00% <100.00%> (+3.31%) ⬆️
exporters/otlp/src/otlp_http_client.cc 67.64% <75.00%> (+0.07%) ⬆️
exporters/otlp/src/otlp_metric_utils.cc 90.53% <88.89%> (-1.49%) ⬇️

... 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 force-pushed the cleanup_nostd_variant_access_otlp_exporters branch 4 times, most recently from 1948936 to d03999c Compare April 9, 2026 15:27
@dbarker dbarker added the pr:do-not-merge This PR is not ready to be merged. label Apr 9, 2026
@dbarker dbarker force-pushed the cleanup_nostd_variant_access_otlp_exporters branch from d03999c to 294a38b Compare May 2, 2026 22:09
@dbarker dbarker added issue:blocked Fix blocked, waiting for other fixes as prerequisites pr:do-not-merge This PR is not ready to be merged. and removed pr:do-not-merge This PR is not ready to be merged. issue:blocked Fix blocked, waiting for other fixes as prerequisites labels May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:do-not-merge This PR is not ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant