Conversation
OTLP/JSON (proto3 JSON mapping) encodes int64/uint64/fixed64/sfixed64 as
string, e.g. {"intValue":"42"}. Standard OTel SDKs (Rust/Go/Python) emit
this form. AnyValue.UnmarshalJSON only decoded intValue as a JSON number,
so any span attribute carrying an int (thread.id, code.line.number, token
counts) failed the whole request with 600904004 "json Unmarshal err".
Fall back to parsing the string form when numeric decode fails; keep the
numeric path for the PB->JSON internal shape. Non-numeric strings still
error. Add unit tests for the string-encoded, negative and invalid cases.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #649 +/- ##
=======================================
Coverage 78.48% 78.48%
=======================================
Files 696 696
Lines 85978 85978
=======================================
+ Hits 67476 67480 +4
+ Misses 14568 14566 -2
+ Partials 3934 3932 -2
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OTLP/JSON (proto3 JSON mapping) encodes int64/uint64/fixed64/sfixed64 as string, e.g. {"intValue":"42"}. Standard OTel SDKs (Rust/Go/Python) emit this form. AnyValue.UnmarshalJSON only decoded intValue as a JSON number, so any span attribute carrying an int (thread.id, code.line.number, token counts) failed the whole request with 600904004 "json Unmarshal err".
Fall back to parsing the string form when numeric decode fails; keep the numeric path for the PB->JSON internal shape. Non-numeric strings still error. Add unit tests for the string-encoded, negative and invalid cases.
What type of PR is this?
Check the PR title
(Optional) Translate the PR title into Chinese
(Optional) More detailed description for this PR(en: English/zh: Chinese)
en:
zh(optional):
(Optional) Which issue(s) this PR fixes