opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

Re-enable JSON@HTTP exporter?

Open rmannibucau opened this issue 3 months ago • 1 comments

Hi,

Seems JSON export over HTTP is now impossible because io.opentelemetry.exporter.internal.http.HttpExporter#export uses binary content length evaluation so even hacking the builder with reflection to call exportAsJson will not enable to send JSON.

Is it possible to re-enable this feature which has several benefits over protobuf in particular in complex systems? (easy to make evolving, easier to make going through gateway to rewrite payloads, easier to interact with 3rd parties, etc...)

rmannibucau avatar Sep 25 '25 13:09 rmannibucau

The argument that json makes payload modifications easier is middleware is a new one. Of course it's not applicable if you use the collector but a rich OTLP ecosystem will and should consist of other OTLP receivers.

I'm on board with adding formal support for json.

My opposition to it has been because I hadn't previously heard of any situations where json was better than protobuf.

jack-berg avatar Sep 26 '25 19:09 jack-berg