retrace
takes a stdouttrace
-generated JSON file on stdin and re-exports the traces via oltptracehttp
.
This allows you to capture traces offline or in environments where it's difficult to use otel in the intended way.
For example, if you have a file produced by stdouttrace
at /tmp/trace.json
and want to view it in otel-desktop-viewer
, you can do this:
$ otel-desktop-viewer &
$ export OTEL_EXPORTER_OTLP_ENDPOINT="https://localhost:4318"
$ export OTEL_TRACES_EXPORTER="otlp"
$ export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
$ retrace < /tmp/trace.json
go install github.com/jonjohnsonjr/retrace@latest