-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[OPIK-1109] Add JSON support to OpenTelemetry traces ingestion #1394
Conversation
@Path("/traces") | ||
@POST | ||
@Consumes("application/json") | ||
public Response receiveJsonTraces(@RequestBody String jsonPayload) { |
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 believe it would be better to create a CustomDeserializer to do all this and keep the controller simple, just receiving the Parsed Object
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.
The payloads can be very very different depending on the integration, we can't predict them, so I'm just repassing the parsing to the otel-protobuf library
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.
Now I get what you meant, it's a very neat solution, thanks!
Details
Extending Otel support for JSON payloads. Nothing too fancy, the Otel library accepts merging JSON content into a the same object you'd use for Protobuf, so the work is just making both paths converge into a single process path asap.
I'm addind as defensive programming a JSON sanitization at the beginning as the Gson library was triggering lots of exceptions from unescaped json strings.
Issues
Resolves #
Testing
Documentation