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 2019/03/10 17:42:24 UTC

[GitHub] [incubator-skywalking] BFergerson opened a new issue #2341: Support plugin for Vert.x

BFergerson opened a new issue #2341: Support plugin for Vert.x
URL: https://github.com/apache/incubator-skywalking/issues/2341
 
 
   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [x] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   
   I am creating a plugin for supporting Vert.x powered applications using SkyWalking. Everything appears to work when I spread out the events so they each happen one after the other but once I start letting the messages flow naturally SkyWalking won't finish a single span.
   
   For example:
    - I call GET on URL `/products/test` (this creates an ExitSpan)
    - I receive GET on URL `/products/test` (this creates an EntrySpan)
    - I respond to GET on URL `/products/test` (this closes the EntrySpan)
    - I receive response for GET on URL `/products/test` (this closes the ExitSpan)
   
   The above work correctly and the SkyWalking UI appears to agree. It's when the flow of events changes that SkyWalking will not finish a trace.
   
   For example:
    - I call GET on URL `/products/test` (this creates an ExitSpan)
    - I call GET on URL `/products/test` (this creates an ExitSpan, child of previous)
    - I receive GET on URL `/products/test` (this creates an EntrySpan, child of previous)
    - I receive GET on URL `/products/test` (this creates an EntrySpan, child of previous)
    - I respond to GET on URL `/products/test` (this closes the EntrySpan, child of previous)
    - I respond to GET on URL `/products/test` (this closes the EntrySpan, child of previous)
    - I receive response for GET on URL `/products/test` (this closes the ExitSpan, child of previous)
    - I receive response for GET on URL `/products/test` (this closes the ExitSpan)
   
   In the above example, SkyWalking would eventually finish a trace but it would be the single trace instead of the expected two traces. The reason I say that SkyWalking never finishes a trace is that I have the above occurring every second and since SkyWalking keeps adding spans as the child of the previous it keeps a non-empty span stack and continues without finishing any traces.
   
   From my best understanding of what's happening, the `TracingContext` class requires either of two scenarios to create a new trace:
    - `TracingContext.activeSpanStack` is empty
    - The current thread hasn't started a trace
   
   If that's correct then I don't see how I can get this to work with Vert.x. In this case, Vert.x is using the same thread to run all of the events on. Both of the GET requests, both of the GET receives, and both of the GET responses happen on the same thread and I can't simply use the `InstanceMethodsAroundInterceptor.afterMethod` method to close spans because of the asynchronous nature of Vert.x.
   
   If my understanding is correct what would you guys recommend to tackle this issue?
   
   ### Which version of SkyWalking, OS and JRE?
   SkyWalking 6.0.0 GA, Ubuntu 18.04, Java 8

----------------------------------------------------------------
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


With regards,
Apache Git Services