Added a filter condition to the reactor span pointcut; fixes gh-646

This commit is contained in:
Marcin Grzejszczak
2018-03-01 10:57:52 +01:00
parent 449db63f81
commit 2f4a7fbde0
2 changed files with 22 additions and 1 deletions

View File

@@ -45,7 +45,7 @@ public abstract class ReactorSleuth {
}
private static final Predicate<Scannable> POINTCUT_FILTER =
s -> !(s instanceof Fuseable.ScalarCallable);
s -> !(s instanceof Fuseable.ScalarCallable) && s.isScanAvailable();
private ReactorSleuth() {
}

View File

@@ -179,6 +179,27 @@ public class SpanSubscriberTests {
tracer.close(foo2);
}
// #646
@Test
public void should_work_for_mono_just_with_flat_map() {
Span span = this.tracer.createSpan("foo");
log.info("Hello");
Mono.just("value1")
.flatMap(request ->
Mono.just("value2")
.then(Mono.just("foo"))
)
.map(a -> "qwe")
.block();
Awaitility.await().untilAsserted(() -> {
then(ExceptionUtils.getLastException()).isNull();
});
then(this.tracer.getCurrentSpan()).isNull();
}
@AfterClass
public static void cleanup() {
Hooks.resetOnLastOperator();