Hi,
I've run into a strange issue regarding the span waterfal in APM Ul.
Say, I have a simple code like this:
const wait = time => () => new Promise(resolve => setTimeout(resolve, time));
const transaction = agent.startTransaction('test-apm-2', 'job');
const overallSpan = transaction.startSpan('overall-span', 'task');
let span1, span2, span3;
Promise.resolve()
.then(wait(50))
.then(() => span1 = transaction.startSpan('span-1', 'task'))
.then(wait(50))
.then(() => span1.end())
.then(() => span2 = transaction.startSpan('span-2', 'task'))
.then(wait(100))
.then(() => span2.end())
.then(() => span3 = transaction.startSpan('span-3', 'task'))
.then(wait(150))
.then(() => span3.end())
.then(() => {
overallSpan.end();
transaction.end();
agent.flush();
});
I expect this behaviour: overall-span
covers all transaction timeline and spans 1,2 and 3 appear sequentially. But instead I'm having the following picture will all spans starting at once:
The same thing appears with default instrumentation spans (like DB queries) - they all start at the same time in UI.
Am I doing something wrong? Or do I get the idea of waterfall wrong?
Node.js Agent v2.1.0
APM Server v6.5.3
Thanks.