spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/ReactorSleuth.java
@SuppressWarnings("unchecked")
	public static <T> Function<? super Publisher<T>, ? extends Publisher<T>> scopePassingSpanOperator(
			BeanFactory beanFactory) {
		return sourcePub -> {
			// TODO: Remove this once Reactor 3.1.8 is released
			//do the checks directly on actual original Publisher
			if (sourcePub instanceof ConnectableFlux //Operators.lift can't handle that
					|| sourcePub instanceof GroupedFlux  //Operators.lift can't handle that
					) {
				return sourcePub;
			}
			//no more POINTCUT_FILTER since mechanism is broken
			Function<? super Publisher<T>, ? extends Publisher<T>> lift = Operators.lift((scannable, sub) -> {
				//rest of the logic unchanged...
				if (contextRefreshed(beanFactory)) {
					if (log.isTraceEnabled()) {
						log.trace("Spring Context already refreshed. Creating a scope " + "passing span subscriber with Reactor Context " + "[" + sub.currentContext() + "] and name [" + scannable.name() + "]");
					}
					return scopePassingSpanSubscription(beanFactory, scannable, sub).get();
				}
				if (log.isTraceEnabled()) {
					log.trace(
							"Spring Context is not yet refreshed, falling back to lazy span subscriber. Reactor Context is [" + sub.currentContext() + "] and name is [" + scannable.name() + "]");
				}
				return new LazySpanSubscriber<T>(
						scopePassingSpanSubscription(beanFactory, scannable, sub)
				);
			});

			return lift.apply(sourcePub);
		};
	}
/**
	 * Return a span operator pointcut given a {@link Tracing}. This can be used in reactor
	 * via {@link reactor.core.publisher.Flux#transform(Function)}, {@link
	 * reactor.core.publisher.Mono#transform(Function)}, {@link
	 * reactor.core.publisher.Hooks#onEachOperator(Function)} or {@link
	 * reactor.core.publisher.Hooks#onLastOperator(Function)}. The Span operator
	 * pointcut will pass the Scope of the Span without ever creating any new spans.
	 *
	 * @param beanFactory
	 * @param <T> an arbitrary type that is left unchanged by the span operator
	 *
	 * @return a new lazy span operator pointcut
	 */
Return a span operator pointcut given a  Tracing.

@param beanFactory
@param  an arbitrary type that is left unchanged by the span operator

@return a new lazy span operator pointcut
Return a span operator pointcut given a Tracing . @param beanFactory @param an arbitrary type that is left unchanged by the span operator @return a new lazy span operator pointcut
@SuppressWarnings("unchecked")
	public static <T> Function<? super Publisher<T>, ? extends Publisher<T>> scopePassingSpanOperator(
			BeanFactory beanFactory) {
		return sourcePub -> {
			if (sourcePub instanceof ConnectableFlux 
					|| sourcePub instanceof GroupedFlux  
					) {
				return sourcePub;
			}
			Function<? super Publisher<T>, ? extends Publisher<T>> lift = Operators.lift((scannable, sub) -> {
				if (contextRefreshed(beanFactory)) {
					if (log.isTraceEnabled()) {
						log.trace("Spring Context already refreshed. Creating a scope " + "passing span subscriber with Reactor Context " + "[" + sub.currentContext() + "] and name [" + scannable.name() + "]");
					}
					return scopePassingSpanSubscription(beanFactory, scannable, sub).get();
				}
				if (log.isTraceEnabled()) {
					log.trace(
							"Spring Context is not yet refreshed, falling back to lazy span subscriber. Reactor Context is [" + sub.currentContext() + "] and name is [" + scannable.name() + "]");
				}
				return new LazySpanSubscriber<T>(
						scopePassingSpanSubscription(beanFactory, scannable, sub)
				);
			});
			return lift.apply(sourcePub);
		};
	}
@ SuppressWarnings ( "unchecked" ) public static < T > Function < ? super Publisher < T > , ? extends Publisher < T > > scopePassingSpanOperator ( BeanFactory beanFactory ) { return sourcePub -> { if ( sourcePub instanceof ConnectableFlux || sourcePub instanceof GroupedFlux ) { return sourcePub ; } Function < ? super Publisher < T > , ? extends Publisher < T > > lift = Operators . lift ( ( scannable , sub ) -> { if ( contextRefreshed ( beanFactory ) ) { if ( log . isTraceEnabled ( ) ) { log . trace ( "Spring Context already refreshed. Creating a scope " + "passing span subscriber with Reactor Context " + "[" + sub . currentContext ( ) + "] and name [" + scannable . name ( ) + "]" ) ; } return scopePassingSpanSubscription ( beanFactory , scannable , sub ) . get ( ) ; } if ( log . isTraceEnabled ( ) ) { log . trace ( "Spring Context is not yet refreshed, falling back to lazy span subscriber. Reactor Context is [" + sub . currentContext ( ) + "] and name is [" + scannable . name ( ) + "]" ) ; } return new LazySpanSubscriber < T > ( scopePassingSpanSubscription ( beanFactory , scannable , sub ) ) ; } ) ; return lift . apply ( sourcePub ) ; } ; }
Return a span operator pointcut given a {@link Tracing}.
Return a span operator pointcut given a { @link Tracing } .
// TODO: Remove this once Reactor 3.1.8 is released //do the checks directly on actual original Publisher //Operators.lift can't handle that //Operators.lift can't handle that //no more POINTCUT_FILTER since mechanism is broken //rest of the logic unchanged...