Skip to content

Replace trace serialization from proto to json #27

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

Merged

Conversation

mladjan-gadzic
Copy link
Contributor

@mladjan-gadzic mladjan-gadzic commented May 16, 2025

  • replaced proto serialization with json
  • tested successfully against partial collector v0.4.0

@mladjan-gadzic mladjan-gadzic requested a review from jgiannuzzi May 16, 2025 08:15
@mladjan-gadzic mladjan-gadzic marked this pull request as draft May 16, 2025 08:28
serialized_traces_data = traces_data.SerializeToString()
serialized_traces_data = json_format.MessageToJson(traces_data)

# FIXME/HACK replace serialized traceId and spanId values as string comparison
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not the happiest solution but built-in json serialization does not serialize trace_id and span_id from span according to partial collector expectations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

still, i prefer this over manual serialization where a lot of things can be missed/go wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding a test for a hack seems silly to me since this is using built-in json serialization.

@mladjan-gadzic mladjan-gadzic marked this pull request as ready for review May 16, 2025 12:21
@mladjan-gadzic mladjan-gadzic merged commit d4c3c39 into master May 19, 2025
4 checks passed
@mladjan-gadzic mladjan-gadzic deleted the no-ticket-replace-proto-serialization-with-json branch May 19, 2025 10:02
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.

2 participants