tom-pytel commented on pull request #21: URL: https://github.com/apache/skywalking-nodejs/pull/21#issuecomment-753954388
I am using a slightly condensed debug log for easier reading, have a look at both the client and server below and notice the first 4 lines of each, that is the entry span being created and closed BEFORE the async exit spans even get executed. That segment close needs to be deferred via await until the async http request handler terminates. client.ts: ``` 18506 725008eaa7574e4e8ee4d3f495ba1f7e 45 C.newEntrySpan: [] 0 18506 725008eaa7574e4e8ee4d3f495ba1f7e 45 C.start: 0 18506 725008eaa7574e4e8ee4d3f495ba1f7e 45 C.stop: 0 18506 725008eaa7574e4e8ee4d3f495ba1f7e 45 C.segment-finished 18506 725008eaa7574e4e8ee4d3f495ba1f7e 53 C.newExitSpan: [] 1 18506 725008eaa7574e4e8ee4d3f495ba1f7e 53 C.start: 1 18506 725008eaa7574e4e8ee4d3f495ba1f7e 53 C.newExitSpan: [ 1 ] 1 18506 725008eaa7574e4e8ee4d3f495ba1f7e 53 C.async: 1 18506 725008eaa7574e4e8ee4d3f495ba1f7e 77 C.resync: 1 18506 725008eaa7574e4e8ee4d3f495ba1f7e 68 http stop: 15467.935335000046 18506 725008eaa7574e4e8ee4d3f495ba1f7e 68 C.stop: 1 18506 725008eaa7574e4e8ee4d3f495ba1f7e 68 C.segment-finished ``` server.ts ``` 18476 3a638dea53e145599075e9ddaaa369e2 50 C.newEntrySpan: [] 0 18476 3a638dea53e145599075e9ddaaa369e2 50 C.start: 0 18476 3a638dea53e145599075e9ddaaa369e2 50 C.stop: 0 18476 3a638dea53e145599075e9ddaaa369e2 50 C.segment-finished 18476 3a638dea53e145599075e9ddaaa369e2 58 C.newExitSpan: [] 1 18476 3a638dea53e145599075e9ddaaa369e2 58 C.start: 1 18476 3a638dea53e145599075e9ddaaa369e2 58 C.newExitSpan: [ 1 ] 1 18476 3a638dea53e145599075e9ddaaa369e2 58 C.async: 1 18476 3a638dea53e145599075e9ddaaa369e2 80 C.resync: 1 18476 3a638dea53e145599075e9ddaaa369e2 71 http stop: 20777.711658000015 18476 3a638dea53e145599075e9ddaaa369e2 71 C.stop: 1 18476 3a638dea53e145599075e9ddaaa369e2 71 C.segment-finished ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
