Replies: 8 comments 9 replies
-
Here are the two major bits of functionality that the aspect mentioned above brings to the table. These features are totally orthogonal and can be considered independently from one another. Asynchronous TracingWhen the aspect first intercepts a call to an annotated method it will inspect the return type of that method to determine if it is asynchronous. The application can register any number of types and offer a strategy for how to handle tracing those methods, so the approach can be flexible over different frameworks (like Reactor, RxJava, Guava, Java 8, Scala, etc.). That strategy is responsible for handling the return value of the method and composing any notification required to end the span after the method has returned. @WithSpan
public Mono<String> someUpstreamRequest() {
return client.get()
.uri("http://www.example.com")
.retrieve()
.bodyToMono(String.class);
} When the above method is traced the span is kept open until the Parameters as AttributesParameters of an annotated method can also be annotated so that when the method is called the values of those parameters are added to the span as attributes. @WithSpan
public String someMethod(@Trace.Attribute("foo") String foo, @Trace.Attribute("bar") int bar) {
return "";
} |
Beta Was this translation helpful? Give feedback.
-
Thanks for the idea @HaloFour! Updating WithSpan to support asynchronous return types seems quite cool (and challenging :D). Mapping params to attributes also seems cool. These would be nice additions. |
Beta Was this translation helpful? Give feedback.
-
I've created the following draft PR: It's very raw, it's basically a dump of the source we are currently using with our own aspect implementation. Rather than trying to refactor it to fit into the existing project structure I thought I'd post what we have for the sake of discussion and figure out how to best fit the parts we want to adopt into the project. |
Beta Was this translation helpful? Give feedback.
-
In other news does anyone know how I can change the CLA associated with a PR? I expected to have to go through the EasyCLA check and I need to use my work email address but the check automatically passed, probably because I've submitted a PR to another repo under the |
Beta Was this translation helpful? Give feedback.
-
Hi @HaloFour ! Just wanted to know if there was any news on that feature ? That would be really useful for us as all of our services are reactive and mostly using reactors. Being able to use @WithSpan to trace our service would be great ! |
Beta Was this translation helpful? Give feedback.
-
I've put up a new draft PR which implements basic async span support for only the It only handles Java 8 |
Beta Was this translation helpful? Give feedback.
-
Awesome, now that the machinery is in place I'd like to discuss adding more implementations of
My questions would be:
/cc @trask |
Beta Was this translation helpful? Give feedback.
-
current Reactor instrumentation in OT has a shortcoming it inherited from opentracing-contrib (span associated with publisher is created too late for propagation to the upstream publisher in some cases) Feel free to copy the bits you like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a Spring WebFlux project that has adopted OpenTelemetry. Quite some time back we developed our own version of the aspect that creates spans around methods annotated with
@WithSpan
, but we extended it in a number of ways to make it work in a reactive application. Specifically the aspect is capable of recognizing that the method returns a value representing an asynchronous operation and leaves the span open until that operation completes. I've got the verbal approval of my employer to look into contributing our code and I'd like to gauge interest in doing so either as modifications to the existing aspect or as something entirely new.Beta Was this translation helpful? Give feedback.
All reactions