Skip to content

Instantly share code, notes, and snippets.

@tedsuo
Created November 11, 2020 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tedsuo/a7bca14e37236087d96831e9554aa16d to your computer and use it in GitHub Desktop.
Save tedsuo/a7bca14e37236087d96831e9554aa16d to your computer and use it in GitHub Desktop.
node_span_chaining.js
app.get('/hello', (req, res) => {
tracer.getCurrentSpan()
.setAttribute('projectID', '123')
.addEvent('setting timeout', { sleep: 300 });
setTimeout(()=> {
tracer.getCurrentSpan().addEvent('sending response');
res.status(200).send('Hello World');
}, 300);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment