Package io.micrometer.tracing.handler
Class PropagatingSenderTracingObservationHandler<T extends io.micrometer.observation.transport.SenderContext>
java.lang.Object
io.micrometer.tracing.handler.PropagatingSenderTracingObservationHandler<T>
- All Implemented Interfaces:
io.micrometer.observation.ObservationHandler<T>,TracingObservationHandler<T>
public class PropagatingSenderTracingObservationHandler<T extends io.micrometer.observation.transport.SenderContext>
extends Object
implements TracingObservationHandler<T>
A
TracingObservationHandler called when sending occurred - e.g. of messages or
http requests.- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micrometer.observation.ObservationHandler
io.micrometer.observation.ObservationHandler.AllMatchingCompositeObservationHandler, io.micrometer.observation.ObservationHandler.CompositeObservationHandler, io.micrometer.observation.ObservationHandler.FirstMatchingCompositeObservationHandlerNested classes/interfaces inherited from interface io.micrometer.tracing.handler.TracingObservationHandler
TracingObservationHandler.TracingContext -
Constructor Summary
ConstructorsConstructorDescriptionPropagatingSenderTracingObservationHandler(Tracer tracer, Propagator propagator) Creates a new instance ofPropagatingSenderTracingObservationHandler. -
Method Summary
Modifier and TypeMethodDescriptioncreateSenderSpan(T context) Method to be used to create a sender span.voidcustomizeSenderSpan(T context, Span span) Allows to customize the receiver span before reporting it.Returns theTracer.voidvoidvoidbooleansupportsContext(io.micrometer.observation.Observation.Context context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micrometer.tracing.handler.TracingObservationHandler
endSpan, getParentSpan, getRequiredSpan, getSpanName, getTracingContext, onEvent, onScopeClosed, onScopeOpened, onScopeReset, setMaybeScopeOnTracingContext, tagSpan
-
Constructor Details
-
PropagatingSenderTracingObservationHandler
Creates a new instance ofPropagatingSenderTracingObservationHandler.- Parameters:
tracer- the tracer to use to record eventspropagator- the mechanism to propagate tracing information into the carrier
-
-
Method Details
-
onStart
- Specified by:
onStartin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.transport.SenderContext>
-
createSenderSpan
Method to be used to create a sender span.- Parameters:
context- context- Returns:
- sender span
-
onError
- Specified by:
onErrorin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.transport.SenderContext>- Specified by:
onErrorin interfaceTracingObservationHandler<T extends io.micrometer.observation.transport.SenderContext>
-
onStop
- Specified by:
onStopin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.transport.SenderContext>
-
customizeSenderSpan
Allows to customize the receiver span before reporting it.- Parameters:
context- contextspan- span to customize
-
supportsContext
public boolean supportsContext(io.micrometer.observation.Observation.Context context) - Specified by:
supportsContextin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.transport.SenderContext>- Specified by:
supportsContextin interfaceTracingObservationHandler<T extends io.micrometer.observation.transport.SenderContext>
-
getTracer
Description copied from interface:TracingObservationHandlerReturns theTracer.- Specified by:
getTracerin interfaceTracingObservationHandler<T extends io.micrometer.observation.transport.SenderContext>- Returns:
- tracer
-