-
Notifications
You must be signed in to change notification settings - Fork 485
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
json: ser/de bytes as base64 strings not an array of bytes #2471
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2471 +/- ##
=====================================
Coverage 79.1% 79.1%
=====================================
Files 118 118
Lines 22508 22508
=====================================
Hits 17821 17821
Misses 4687 4687 ☔ View full report in Codecov by Sentry. |
I'm not familiar with the codebase so I took a guess as to where to apply the fix. I tried to add an integration test but I could not get a failure case to fail a test so I'm not sure if that's even in the right place either. Some pointers would be appreciated. |
@lalitb I can't seem to get tests to agree on the order of items in attributes arrays. I'm not sure if they're getting sorted in one place but not another or something. Otherwise all tests seem to be passing. I'll point out that I had to implement bytes support for the rust sdk itself, maybe that should be it's own PR but if so it will block this PR. |
Hi, just checking if there's anything else I can do to move this along. Thanks! |
We've got some conflicts now. I'm happy to resolve them, or split this PR up, but I need a bit of guidance on how you'd like to proceed. Thanks! |
Hi folks pinging again. I'm willing to do the work here and this seems like an important issue (invalid data being generated) but I need some input from the dev team, this is my first PR to the repo. cc @cijothomas as main commiter. |
4eda296
to
bdd9c23
Compare
@adriangb Sorry on delay on this. I believe the CI failure is for the ordering of resource attributes. But see my comment here if that makes sense. |
8c7d87f
to
7d6ea07
Compare
@adriangb Thanks for helping! |
I use the crate to load telemetry exported as JSON by a browser SDK that follows the OTLP JSON spec, so yes I was hitting this in production. The bigger picture is that I use the crate as part of the ingestion portion of OTEL backend written in Rust: https://pydantic.dev/logfire |
And thank you both for getting this across the line! |
Thanks for sharing more context. We were earlier considering removing publishing the opentelemetry-proto crate itself, as it was considered an internal dependency for the opentelemetry-otlp itself! But later decided to keep it! |
I'm glad you did! |
Yes, interestingly, this crate is being utilized more than we initially expected. Another example: #2487. |
I believe this is how the proto <-> json spec defines that binary data should be handled: https://protobuf.dev/programming-guides/json/
I confirmed by exporting data from Python: