Last active
December 7, 2017 21:53
-
-
Save DanielMSchmidt/f9a7ceb60c654cdc04b3f2e4cac11366 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment