public abstract class ReactorSleuth extends Object
| Modifier and Type | Field and Description |
|---|---|
static Function<reactor.util.context.Context,reactor.util.context.Context> |
contextWrappingFunction
Function that does additional wrapping of the Reactor context.
|
| Modifier and Type | Method and Description |
|---|---|
static reactor.util.context.Context |
enhanceContext(Tracer tracer,
CurrentTraceContext currentTraceContext,
reactor.util.context.Context context,
String childSpanName)
Updates the Reactor context with tracing information.
|
static reactor.util.context.Context |
enhanceContext(Tracer tracer,
CurrentTraceContext currentTraceContext,
reactor.util.context.Context context,
String childSpanName,
Function<Span,Span> spanSupplier)
Updates the Reactor context with tracing information.
|
static <T> Function<? super org.reactivestreams.Publisher<T>,? extends org.reactivestreams.Publisher<T>> |
onEachOperatorForOnEachInstrumentation(org.springframework.context.ConfigurableApplicationContext springContext)
Creates scope passing span operator which applies only to not
Scannable.Attr.RunStyle.SYNC Publishers. |
static <T> Function<? super org.reactivestreams.Publisher<T>,? extends org.reactivestreams.Publisher<T>> |
onLastOperatorForOnEachInstrumentation(org.springframework.context.ConfigurableApplicationContext springContext)
Creates tracing context capturing reactor operator.
|
static reactor.util.context.Context |
putSpanInScope(Tracer tracer,
reactor.util.context.Context context,
Span span)
Puts the provided span in scope and in Reactor context.
|
static Function<Runnable,Runnable> |
scopePassingOnScheduleHook(org.springframework.context.ConfigurableApplicationContext springContext) |
static <T> Function<? super org.reactivestreams.Publisher<T>,? extends org.reactivestreams.Publisher<T>> |
scopePassingSpanOperator(org.springframework.context.ConfigurableApplicationContext springContext)
Return a span operator pointcut given a Tracing.
|
static Span |
spanFromContext(Tracer tracer,
CurrentTraceContext currentTraceContext,
reactor.util.context.ContextView context)
Retrieves span from Reactor context.
|
static <T> Function<? super org.reactivestreams.Publisher<T>,? extends org.reactivestreams.Publisher<T>> |
springContextSpanOperator(org.springframework.context.ConfigurableApplicationContext springContext)
Creates a context with beans in it.
|
static <T> reactor.core.publisher.Flux<T> |
tracedFlux(Tracer tracer,
CurrentTraceContext currentTraceContext,
String childSpanName,
Supplier<reactor.core.publisher.Flux<T>> supplier)
Wraps the given Flux in a trace representation.
|
static <T> reactor.core.publisher.Flux<T> |
tracedFlux(Tracer tracer,
CurrentTraceContext currentTraceContext,
String childSpanName,
Supplier<reactor.core.publisher.Flux<T>> supplier,
BiConsumer<T,Span> spanCustomizer)
Wraps the given Flux in a trace representation.
|
static <T> reactor.core.publisher.Flux<T> |
tracedFlux(Tracer tracer,
CurrentTraceContext currentTraceContext,
String childSpanName,
Supplier<reactor.core.publisher.Flux<T>> supplier,
BiConsumer<T,Span> spanCustomizer,
Function<Span,Span> spanFunction)
Wraps the given Flux in a trace representation.
|
static <T> reactor.core.publisher.Flux<T> |
tracedFlux(Tracer tracer,
Span span,
Supplier<reactor.core.publisher.Flux<T>> supplier)
Wraps the given Flux in a trace representation.
|
static <T> reactor.core.publisher.Mono<T> |
tracedMono(Tracer tracer,
CurrentTraceContext currentTraceContext,
String childSpanName,
Supplier<reactor.core.publisher.Mono<T>> supplier)
Wraps the given Mono in a trace representation.
|
static <T> reactor.core.publisher.Mono<T> |
tracedMono(Tracer tracer,
CurrentTraceContext currentTraceContext,
String childSpanName,
Supplier<reactor.core.publisher.Mono<T>> supplier,
BiConsumer<T,Span> spanCustomizer)
Wraps the given Mono in a trace representation.
|
static <T> reactor.core.publisher.Mono<T> |
tracedMono(Tracer tracer,
CurrentTraceContext currentTraceContext,
String childSpanName,
Supplier<reactor.core.publisher.Mono<T>> supplier,
BiConsumer<T,Span> spanCustomizer,
Function<Span,Span> spanFunction)
Wraps the given Mono in a trace representation.
|
static <T> reactor.core.publisher.Mono<T> |
tracedMono(Tracer tracer,
Span span,
Supplier<reactor.core.publisher.Mono<T>> supplier)
Wraps the given Mono in a trace representation.
|
static reactor.util.context.Context |
wrapContext(reactor.util.context.Context context)
Mutates the Reactor context depending on the classpath contents.
|
public static Function<reactor.util.context.Context,reactor.util.context.Context> contextWrappingFunction
public static <T> Function<? super org.reactivestreams.Publisher<T>,? extends org.reactivestreams.Publisher<T>> scopePassingSpanOperator(org.springframework.context.ConfigurableApplicationContext springContext)
Flux.transform(Function),
Mono.transform(Function),
Hooks.onLastOperator(Function) or
Hooks.onLastOperator(Function). The Span operator
pointcut will pass the Scope of the Span without ever creating any new spans.T - an arbitrary type that is left unchanged by the span operatorspringContext - the Spring context.public static <T> Function<? super org.reactivestreams.Publisher<T>,? extends org.reactivestreams.Publisher<T>> onEachOperatorForOnEachInstrumentation(org.springframework.context.ConfigurableApplicationContext springContext)
Scannable.Attr.RunStyle.SYNC Publishers. Used by
InstrumentationType#DECORATE_ON_EACHT - an arbitrary type that is left unchanged by the span operator.springContext - the Spring context.Hooks.onEachOperator(Function).public static <T> Function<? super org.reactivestreams.Publisher<T>,? extends org.reactivestreams.Publisher<T>> springContextSpanOperator(org.springframework.context.ConfigurableApplicationContext springContext)
T - an arbitrary type that is left unchanged by the span operatorspringContext - spring contextpublic static <T> Function<? super org.reactivestreams.Publisher<T>,? extends org.reactivestreams.Publisher<T>> onLastOperatorForOnEachInstrumentation(org.springframework.context.ConfigurableApplicationContext springContext)
InstrumentationType#DECORATE_ON_EACH.T - an arbitrary type that is left unchanged by the span operator.springContext - the Spring context.Hooks.onLastOperator(Function) for
InstrumentationType#DECORATE_ON_EACHpublic static Function<Runnable,Runnable> scopePassingOnScheduleHook(org.springframework.context.ConfigurableApplicationContext springContext)
public static <T> reactor.core.publisher.Mono<T> tracedMono(@NonNull
Tracer tracer,
@NonNull
CurrentTraceContext currentTraceContext,
@NonNull
String childSpanName,
@NonNull
Supplier<reactor.core.publisher.Mono<T>> supplier,
@NonNull
BiConsumer<T,Span> spanCustomizer)
T - - type returned by the Monotracer - - Tracer beancurrentTraceContext - - CurrentTraceContext beanchildSpanName - - name of the created child spansupplier - - supplier of a Mono to be wrapped in tracingspanCustomizer - - customizer for the child spanpublic static <T> reactor.core.publisher.Mono<T> tracedMono(@NonNull
Tracer tracer,
@NonNull
CurrentTraceContext currentTraceContext,
@NonNull
String childSpanName,
@NonNull
Supplier<reactor.core.publisher.Mono<T>> supplier,
@NonNull
BiConsumer<T,Span> spanCustomizer,
@NonNull
Function<Span,Span> spanFunction)
T - - type returned by the Monotracer - - Tracer beancurrentTraceContext - - CurrentTraceContext beanchildSpanName - - name of the created child spansupplier - - supplier of a Mono to be wrapped in tracingspanCustomizer - - customizer for the child spanspanFunction - - function that creates a new or child spanpublic static <T> reactor.core.publisher.Mono<T> tracedMono(@NonNull
Tracer tracer,
@NonNull
CurrentTraceContext currentTraceContext,
@NonNull
String childSpanName,
@NonNull
Supplier<reactor.core.publisher.Mono<T>> supplier)
T - - type returned by the Monotracer - - Tracer beancurrentTraceContext - - CurrentTraceContext beanchildSpanName - - name of the created child spansupplier - - supplier of a Mono to be wrapped in tracingpublic static <T> reactor.core.publisher.Mono<T> tracedMono(@NonNull
Tracer tracer,
@NonNull
Span span,
@NonNull
Supplier<reactor.core.publisher.Mono<T>> supplier)
T - - type returned by the Monotracer - - Tracer beanspan - - span to put in contextsupplier - - supplier of a Mono to be wrapped in tracingpublic static <T> reactor.core.publisher.Flux<T> tracedFlux(@NonNull
Tracer tracer,
@NonNull
CurrentTraceContext currentTraceContext,
@NonNull
String childSpanName,
@NonNull
Supplier<reactor.core.publisher.Flux<T>> supplier,
@NonNull
BiConsumer<T,Span> spanCustomizer)
T - - type returned by the Fluxtracer - - Tracer beancurrentTraceContext - - CurrentTraceContext beanchildSpanName - - name of the created child spansupplier - - supplier of a Flux to be wrapped in tracingspanCustomizer - - customizer for the child spanpublic static <T> reactor.core.publisher.Flux<T> tracedFlux(@NonNull
Tracer tracer,
@NonNull
CurrentTraceContext currentTraceContext,
@NonNull
String childSpanName,
@NonNull
Supplier<reactor.core.publisher.Flux<T>> supplier,
@NonNull
BiConsumer<T,Span> spanCustomizer,
@NonNull
Function<Span,Span> spanFunction)
T - - type returned by the Fluxtracer - - Tracer beancurrentTraceContext - - CurrentTraceContext beanchildSpanName - - name of the created child spansupplier - - supplier of a Flux to be wrapped in tracingspanCustomizer - - customizer for the child spanspanFunction - - function that creates a new or child spanpublic static <T> reactor.core.publisher.Flux<T> tracedFlux(@NonNull
Tracer tracer,
@NonNull
Span span,
@NonNull
Supplier<reactor.core.publisher.Flux<T>> supplier)
T - - type returned by the Fluxtracer - - Tracer beanspan - - span to put in contextsupplier - - supplier of a Flux to be wrapped in tracingpublic static <T> reactor.core.publisher.Flux<T> tracedFlux(@NonNull
Tracer tracer,
@NonNull
CurrentTraceContext currentTraceContext,
@NonNull
String childSpanName,
@NonNull
Supplier<reactor.core.publisher.Flux<T>> supplier)
T - - type returned by the Fluxtracer - - Tracer beancurrentTraceContext - - CurrentTraceContext beanchildSpanName - - name of the created child spansupplier - - supplier of a Flux to be wrapped in tracingpublic static reactor.util.context.Context enhanceContext(Tracer tracer, CurrentTraceContext currentTraceContext, reactor.util.context.Context context, String childSpanName, Function<Span,Span> spanSupplier)
tracer - tracercurrentTraceContext - current trace contextcontext - Reactor contextchildSpanName - child span name when there is no span in contextspanSupplier - function that creates a new or child spanpublic static reactor.util.context.Context enhanceContext(Tracer tracer, CurrentTraceContext currentTraceContext, reactor.util.context.Context context, String childSpanName)
tracer - tracercurrentTraceContext - current trace contextcontext - Reactor contextchildSpanName - child span name when there is no span in contextpublic static reactor.util.context.Context putSpanInScope(Tracer tracer, reactor.util.context.Context context, Span span)
tracer - tracercontext - Reactor contextspan - span to put in Reactor contextpublic static reactor.util.context.Context wrapContext(reactor.util.context.Context context)
context - Reactor contextpublic static Span spanFromContext(Tracer tracer, CurrentTraceContext currentTraceContext, reactor.util.context.ContextView context)
tracer - tracercurrentTraceContext - current trace contextcontext - context viewCopyright © 2022 Pivotal Software, Inc.. All rights reserved.