Closed tabdulradi closed 6 years ago
thanks for the help! can you rebase this over master as #59 is in which adds a test class. Would be nice to have a test for this.
I figured out my changes are also wrong. parent_id
is optional, unless type=subsegment
, in which case it becomes required.
I ended up writing my own zipkin to xray conversion logic. I defined classes that represents XRay model, to ensure I can't construct an illegal json. The code is here, supports Zipkin and Jaeger, but it is written in Scala https://github.com/tabdulradi/opentracing-xray
To fix this PR, we should always write the parent_id
if it not null (restore line 54). But don't write the type=subsegment
unless parentId
exists.
Unfortunately, I don't have the time to update this PR. You can close it if no one wants to own it.
I got the following error from X-Ray agent
The json document seems to have
"type":"subsegment"
but noparent_id
, which is illegal.This PR ensures we either write both fields or none of them.