Skip to content

Instantly share code, notes, and snippets.

@DanielMSchmidt
Last active December 7, 2017 21:28
Show Gist options
  • Save DanielMSchmidt/de48182a1ce8f430de52333bbcb500a8 to your computer and use it in GitHub Desktop.
Save DanielMSchmidt/de48182a1ce8f430de52333bbcb500a8 to your computer and use it in GitHub Desktop.
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