fix: spans started in same async op should be children#1890
fix: spans started in same async op should be children#1890
Conversation
This commit is just a start. There are still tests and discussion to be had. Fixes #1889
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Test errors
Expand to view the tests failures> Show only the first 10 test failures
|
|
Here is a case, from @dgieselaar, that shows this patch is insufficient. // ... apm and app (express) setup ...
app.get('/nspans-dario', (req, res) => {
var firstSpan = apm.startSpan('first-span', 'type', 'subtype', 'action')
process.nextTick(function ( ) {
firstSpan.end()
var secondSpan = apm.startSpan('second-span', 'type', 'subtype', 'action')
secondSpan.end()
res.end('done')
})
})The transaction/span hierarchy resulting from a call to this is: where arguably we want: We are no longer in the same async op here, so technically wasn't what this ticket was first considering. However, this is likely a more common case and we should consider it. Take a look at Dario's draft PR here: #1964 |
|
This can be closed if/when #2181 goes in. |
|
I believe this is fixed by #2181 |
This commit is just a start. There are still tests and discussion to be
had.
Fixes #1889