Last active
December 7, 2017 21:28
-
-
Save DanielMSchmidt/de48182a1ce8f430de52333bbcb500a8 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 = ... // See example above | |
tracer.scoped(() => { | |
const id = tracer.createRootId(); | |
tracer.setId(id); | |
tracer.recordAnnotation(new zipkin.Annotation.ClientSend()); | |
tracer.recordAnnotation(new zipkin.Annotation.Rpc("My Span")); | |
fetch("http://google.de").then(res => res.json()).then(result => { | |
tracer.scoped(() => { | |
tracer.setId(id); | |
tracer.recordBinary("result", JSON.stringify(result)); | |
tracer.recordAnnotation(new zipkin.Annotation.ClientRecv()); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment