Skip to content

Handle unexpected types in attributes#432

Merged
fractalwrench merged 1 commit intoopen-telemetry:mainfrom
fractalwrench:fw/attr-protobuf-conversion
Apr 24, 2026
Merged

Handle unexpected types in attributes#432
fractalwrench merged 1 commit intoopen-telemetry:mainfrom
fractalwrench:fw/attr-protobuf-conversion

Conversation

@fractalwrench
Copy link
Copy Markdown
Member

Goal

Handles unexpected types in attributes by casting them to either Long or Double. Closes #409.

Testing

Added unit tests.

@fractalwrench fractalwrench requested a review from a team as a code owner April 23, 2026 13:43
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 23.52941% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.70%. Comparing base (9aa44d8) to head (881bb82).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...lemetry/kotlin/attributes/AttributeContainerExt.kt 0.00% 8 Missing ⚠️
...elemetry/kotlin/attributes/AttributesMutatorExt.kt 28.57% 4 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (23.52%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (89.70%) is below the adjusted base coverage (90.05%). You can increase the head coverage or adjust the Removed Code Behavior.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #432      +/-   ##
==========================================
- Coverage   89.84%   89.70%   -0.15%     
==========================================
  Files         263      264       +1     
  Lines        3428     3437       +9     
  Branches      369      379      +10     
==========================================
+ Hits         3080     3083       +3     
- Misses        264      269       +5     
- Partials       84       85       +1     

☔ 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.

is Long -> AnyValue(int_value = value)
is Double -> AnyValue(double_value = value)
is Float -> AnyValue(double_value = value.toDouble())
is Number -> AnyValue(int_value = value.toLong())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah nice

Copy link
Copy Markdown
Contributor

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

LGTM

@fractalwrench fractalwrench merged commit 956db7d into open-telemetry:main Apr 24, 2026
4 of 6 checks passed
@fractalwrench fractalwrench deleted the fw/attr-protobuf-conversion branch April 24, 2026 05:46
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.

Support integers in AttributesProtobufConverter

2 participants