You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/03/01 11:17:29 UTC

[GitHub] [skywalking-nodejs] tom-pytel commented on pull request #33: MongoDB first working version

tom-pytel commented on pull request #33:
URL: https://github.com/apache/skywalking-nodejs/pull/33#issuecomment-787869991


   Ok, that bug in the plugin is not so much of a bug but a design issue. It is caused by MongoDB calling back into itself for internal operation using the same user-level API that starts an exit span. This causes a new exit span but inherits from the old and screws up some internal counts. I can easily fix it for this case, but the more general question is as follows:
   
   The original behavior in this agent was (and still) is that if an Entry / Exit span gets created on top of another of the same kind then that span is inherited instead of a new span being created as a child. This is great for something like `express` sitting on top of `http`, but there is a case where it becomes a problem. Like for example when I consider the user callback processing an incoming stream as part of the span, and that code creates another unrelated outgoing span. Like a message or database access during the processing of an incoming HTTP stream. Obviously that new span should not inherit from the old one but should rather be a child of it, but that gives us Exit span as a child of an Exit span.
   
   So what is the desired behavior here? Should I exclude user processing (like the callback or `.then()`) of an incoming stream from the span and just end the span before the user part? This would give incorrect end times for long streams. Or allow at least Exit spans as children of Exit spans and allow inheritance only in specifically recognized cases like for example `express` on top of `http`?


----------------------------------------------------------------
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:
users@infra.apache.org