Package io.micrometer.tracing.handler
Class PropagatingReceiverTracingObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
java.lang.Object
io.micrometer.tracing.handler.PropagatingReceiverTracingObservationHandler<T>
- All Implemented Interfaces:
io.micrometer.observation.ObservationHandler<T>
,TracingObservationHandler<T>
public class PropagatingReceiverTracingObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
extends Object
implements TracingObservationHandler<T>
A
TracingObservationHandler
called when receiving 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.FirstMatchingCompositeObservationHandler
Nested classes/interfaces inherited from interface io.micrometer.tracing.handler.TracingObservationHandler
TracingObservationHandler.TracingContext
-
Constructor Summary
ConstructorDescriptionPropagatingReceiverTracingObservationHandler
(Tracer tracer, Propagator propagator) Creates a new instance ofPropagatingReceiverTracingObservationHandler
. -
Method Summary
Modifier and TypeMethodDescriptioncustomizeExtractedSpan
(T context, Span.Builder builder) Customizes the extracted span (e.g.void
customizeReceiverSpan
(T context, Span span) Allows to customize the receiver span before reporting it.Returns theTracer
.void
void
void
boolean
supportsContext
(io.micrometer.observation.Observation.Context context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micrometer.tracing.handler.TracingObservationHandler
getParentSpan, getRequiredSpan, getSpanName, getTracingContext, onEvent, onScopeClosed, onScopeOpened, onScopeReset, tagSpan
-
Constructor Details
-
PropagatingReceiverTracingObservationHandler
Creates a new instance ofPropagatingReceiverTracingObservationHandler
.- Parameters:
tracer
- the tracer to use to record eventspropagator
- the mechanism to propagate tracing information from the carrier
-
-
Method Details
-
onStart
- Specified by:
onStart
in interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
-
customizeExtractedSpan
Customizes the extracted span (e.g. you can set theSpan.Kind
viaSpan.Builder.kind(Span.Kind)
).- Parameters:
context
- contextbuilder
- span builder- Returns:
- span builder
-
onError
- Specified by:
onError
in interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
- Specified by:
onError
in interfaceTracingObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
-
onStop
- Specified by:
onStop
in interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
-
customizeReceiverSpan
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:
supportsContext
in interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
- Specified by:
supportsContext
in interfaceTracingObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
-
getTracer
Description copied from interface:TracingObservationHandler
Returns theTracer
.- Specified by:
getTracer
in interfaceTracingObservationHandler<T extends io.micrometer.observation.transport.ReceiverContext>
- Returns:
- tracer
-