-
Notifications
You must be signed in to change notification settings - Fork 20
Add Span::prepare_for_async method and AbstractSpan trait.
#58
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #58 +/- ##
==========================================
- Coverage 17.69% 16.69% -1.01%
==========================================
Files 17 18 +1
Lines 565 629 +64
==========================================
+ Hits 100 105 +5
- Misses 465 524 +59
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
By following, you mean sharing the same parent span with the current active span? Two active spans created and running? |
Yes, like |
|
If they run concurrently, usually we prefer span created and change into async mode(not be active span anymore) This is Java dev doc. Notice, Java trace segment is in one thread only, so, when thread crossing happens, you need to go for new segment. But then the span duration can't represent the HTTP call anymore. So, we need async span to create in thread A, but finish in thread B. This concept should fit your scenarios as well. |
|
follow up span was introduced by Opentracing, but very confusing. So, OTEL doesn't mention that, SkyWalking never have this concept too. |
TracingContext::create_following_*_span methods.Span::prepare_for_async method and AbstractSpan trait.
wu-sheng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update doc about new APIs.
The documentation for this part of the API has already been mentioned in the document comments (generated in docs.rs), and mentioning it on readme will make it very large? |
|
Yes, such as how to typically use these new APIs. |
Sometimes we need to create a span following by the last active span instead of as the a child span, like in https://github.com/apache/skywalking-php/blob/eabb210b42ff652b8e34d8d99a933b5489b80397/src/plugin/plugin_curl.rs#LL276C9-L276C9
Span::prepare_for_asyncmehtod, which will return theAsyncSpanobject, when it dropped, it will auto finished and notifyTracingContext.TracingContext::waitmethod, which will block to wait allAsyncSpanfinished.AbstractSpantrait,SpanandAsyncSpanall implement it.