-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Proposed fix for JSON ingestion issue #179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense as OTLP/JSON spec shows traceID & spanID will only be hex and not base64 encoded.
The changes make functional sense but think the bytesToTraceID and bytesToSpanID funcs could be refactored to be a little cleaner. I also think we should rename the new consts for hex only encoded trace and span IDs -- they aren't corrupted, just not base64 encoded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good to me!
## Which problem is this PR solving? - The bug fix in #179 had a bug, and it was found by a test in an internal library before deploy. ## Short description of the changes - Fix bug in BytesToTraceID - Add a test that would have found the bug, and more test cases for the new stuff This requires a release to v0.22.1.
## Which problem is this PR solving? - In #179 we added some code to deal with the fact that OTLP/JSON processing can't differentiate between arrays of bytes that are encoded as hex and those that are encoded as base64. When JS sends us browser-side telemetry, it encodes IDs as hex, but when we receive it it's decoded as base64. This PR also applies that to logs. ## Short description of the changes - Adjust log's parentID so that it properly parses - Add a new test case - Move some code to common since it now applies across signals - Move some tests to common - Clarify some comments
Which problem is this PR solving?
OTLP/JSON data coming direct from browser sources is arriving with traceID and spanID encoded as hex, per spec.
But when this is fed through the OTLP protojson library that Husky uses, these values are being decoded as if they were encoded in base64.
The result is that Husky is corrupting these IDs.
Short description of the changes
BytesToTraceID
function and addsbytesToSpanID
to special-case the conversion (which we can detect by its length).