Skip to content

Instantly share code, notes, and snippets.

@nathanpeck
Created July 24, 2018 23:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanpeck/df102bf6fc1881d98f51f1b88d018e4f to your computer and use it in GitHub Desktop.
Save nathanpeck/df102bf6fc1881d98f51f1b88d018e4f to your computer and use it in GitHub Desktop.
const span = tracer.startSpan('ws');
span.setTag('service.name', 'frontend-ws');
span.setTag('resource.name', 'new message');
// Must call this otherwise asychronous trace spans don't show up under the overall span.
tracer.scopeManager().activate(span);
// Asynchronous code starts here.
// At some point in the future, right before the callback
span.finish();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment