-
Notifications
You must be signed in to change notification settings - Fork 893
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
Use hex encoding for trace id and span id fields in OTLP JSON encoding #911
Use hex encoding for trace id and span id fields in OTLP JSON encoding #911
Conversation
Resolves: open-telemetry#786 See discussion and motivation for the change in the issue linked above.
3ba61f1
to
93d0a6d
Compare
Is it a simple way to still use the protobuf encoder with this? Asking for a friend :))) |
I only tried with Gogoproto, and it was not trivial, required a custom marshaler and custom data type for the fields. Here is the draft code on my branch: open-telemetry/opentelemetry-collector@master...tigrannajaryan:feature/tigran/hexid I am not sure if this is doable with official protobuf libraries and how easy it is. |
@tigrannajaryan does it worth the effort then? |
I think it is worth it, see some thoughts on why here #786 (comment) Some of the work that is needed to make this work with Gogoproto we wanted to do anyway so that we can reduce the number of allocations for traceid/spanid slices in the Collector by using custom data types. Once it is done there is only some additional work needed to customize the JSON representation. For some language SDKs this is trivial if I understand correctly (e.g. for JS) since they don't use protobuf JSON encoding capabilities but encode manually instead and it is a one-line change for them. Even without Protobuf libraries it is not a big stretch to just code the entire JSON marshaling/unmarshaling manually using whatever JSON lib is available. Tests will probably take most of the time if one wants to do this. |
It would be super nice to have identifiers as hex. It will simplify life for humans. |
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.
LGTM given @tigrannajaryan knows how to implement it. Should we file a feature request at https://github.com/protocolbuffers/protobuf/issues?
@tigrannajaryan am I reading this change linked in the comments above correctly, 6000+ files changed with 1.9 million lines of code? |
Ignore the |
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.
LGTM.
open-telemetry#911) Resolves: open-telemetry#786 See discussion and motivation for the change in the issue linked above. Co-authored-by: Sergey Kanzhelev <[email protected]>
Resolves: #786
See discussion and motivation for the change in the issue linked above.