const tracer = ... // As previously defined tracer.scoped(() => { // Previous example const previousResult = 404; tracer.scoped(() => { const id = tracer.createChildId(); tracer.setId(id); tracer.recordAnnotation(new zipkin.Annotation.ClientSend()); tracer.recordAnnotation(new zipkin.Annotation.Rpc("My Child Span")); fetch("https://http.cat/" + previousResult).then(res => res.json()).then(result => { tracer.scoped(() => { tracer.setId(id); tracer.recordAnnotation(new zipkin.Annotation.ClientRecv()); }); }); }); });