public final class MessagingSleuthOperators extends Object
forInputMessage factory methods will retrieve the tracer context from the
message headers and set up a a child span in the header under key Span.class
name. If you need to continue it or tag it, it's enough to retrieve it from the
headers.
The first messaging span (the one that was first found in the input message) is present
under the traceHandlerParentSpan header key.| Modifier and Type | Method and Description |
|---|---|
static <T> org.springframework.messaging.Message<T> |
afterMessageHandled(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Throwable ex)
Reports the span stored in the message.
|
static <T> Function<org.springframework.messaging.Message<T>,org.springframework.messaging.Message<T>> |
asFunction(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> inputMessage)
Function converting an input message to a message with tracer headers.
|
static <T> org.springframework.messaging.Message<T> |
forInputMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message)
Processes the input message and returns a message with a header containing a span.
|
static <T> org.springframework.messaging.Message<T> |
forInputMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Consumer<org.springframework.messaging.Message<T>> withSpanInScope)
Executes a span wrapped operation for an input message.
|
static <T> org.springframework.messaging.Message<T> |
handleOutputMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message)
Creates an output message with tracer headers and reports the corresponding
producer span.
|
static <T> org.springframework.messaging.Message<T> |
handleOutputMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Throwable throwable)
Creates an output message with tracer headers and reports the corresponding
producer span.
|
static <T> Span |
spanFromMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message)
Retrieves tracer information from message headers.
|
static <T> void |
withSpanInScope(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Consumer<org.springframework.messaging.Message<T>> withSpanInScope)
Retrieves tracer information from message headers and applies the operation.
|
static <T> org.springframework.messaging.Message<T> |
withSpanInScope(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Function<org.springframework.messaging.Message<T>,org.springframework.messaging.Message<T>> withSpanInScope)
Retrieves tracer information from message headers and applies the operation.
|
public static <T> org.springframework.messaging.Message<T> forInputMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Consumer<org.springframework.messaging.Message<T>> withSpanInScope)
T - - type of payloadbeanFactory - - bean factorymessage - - message to wrapwithSpanInScope - - an operation that will be wrapped in a span and the span
will be reported at the endpublic static <T> org.springframework.messaging.Message<T> forInputMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message)
T - - payload typebeanFactory - - bean factorymessage - - input message to processpublic static <T> Function<org.springframework.messaging.Message<T>,org.springframework.messaging.Message<T>> asFunction(org.springframework.beans.factory.BeanFactory beanFactory, org.springframework.messaging.Message<T> inputMessage)
T - input message typebeanFactory - - bean factoryinputMessage - - input message to processpublic static <T> Span spanFromMessage(org.springframework.beans.factory.BeanFactory beanFactory, org.springframework.messaging.Message<T> message)
T - - payload typebeanFactory - - bean factorymessage - - message to processnull if there was no spanpublic static <T> void withSpanInScope(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Consumer<org.springframework.messaging.Message<T>> withSpanInScope)
T - - payload typebeanFactory - - bean factorymessage - - message to processwithSpanInScope - - an operation that will be wrapped in a span but will not
be reportedpublic static <T> org.springframework.messaging.Message<T> withSpanInScope(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Function<org.springframework.messaging.Message<T>,org.springframework.messaging.Message<T>> withSpanInScope)
T - - payload typebeanFactory - - bean factorymessage - - message to processwithSpanInScope - - an operation that will be wrapped in a span but will not
be reportedpublic static <T> org.springframework.messaging.Message<T> handleOutputMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message)
destination it will
be used to tag the span with destination name.T - - message payloadbeanFactory - - bean factorymessage - - message to which tracer headers should be injectedpublic static <T> org.springframework.messaging.Message<T> handleOutputMessage(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Throwable throwable)
destination it will
be used to tag the span with destination name.T - - message payloadbeanFactory - - bean factorymessage - - message to which tracer headers should be injectedthrowable - - exception that took place while processing the messagepublic static <T> org.springframework.messaging.Message<T> afterMessageHandled(org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.messaging.Message<T> message,
Throwable ex)
T - - message payloadbeanFactory - - bean factorymessage - - message with tracer contextex - - potential exception that took place while processingCopyright © 2021 Pivotal Software, Inc.. All rights reserved.