-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 errorsExpand 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