You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using RegisterTraceServiceHandlerFromEndpoint from go.opentelemetry.io/proto/otlp/collector/trace/v1 to allow forwarding of traces sent via HTTP to the gRPC endpoint. This works perfectly for Protobuf records, but produces invalid records when JSON is sent.
Expected behavior
Telemetry sent as JSON is parsed and converted to valid models.
Observed behaviour
Models produced by JSON input have trace and span IDs that are 50% longer than expected.
I am using
RegisterTraceServiceHandlerFromEndpoint
fromgo.opentelemetry.io/proto/otlp/collector/trace/v1
to allow forwarding of traces sent via HTTP to the gRPC endpoint. This works perfectly for Protobuf records, but produces invalid records when JSON is sent.Expected behavior
Telemetry sent as JSON is parsed and converted to valid models.
Observed behaviour
Models produced by JSON input have trace and span IDs that are 50% longer than expected.
This appears to be because the code uses the default Protobuf JSON handler via the
runtime.MarshalerForRequest
function. This uses base64 to encode and decode binary arrays. This differs from the OTLP spec that states that trace and span IDs must be hex encoded.The result is that the hex encoded IDs are being decoded as if they were base64.
The text was updated successfully, but these errors were encountered: