Interface TracingObservationHandler<T extends io.micrometer.observation.Observation.Context>
- Type Parameters:
T- type of handler context
- All Superinterfaces:
io.micrometer.observation.ObservationHandler<T>
- All Known Implementing Classes:
DefaultTracingObservationHandler, PropagatingReceiverTracingObservationHandler, PropagatingSenderTracingObservationHandler
public interface TracingObservationHandler<T extends io.micrometer.observation.Observation.Context>
extends io.micrometer.observation.ObservationHandler<T>
Marker interface for tracing handlers.
- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBasic tracing context.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 -
Method Summary
Modifier and TypeMethodDescriptiondefault voidEnds span and clears resources.default @Nullable SpangetParentSpan(io.micrometer.observation.Observation.ContextView context) Get the current span from parent if applicable.default SpangetRequiredSpan(T context) Returns the span from the context or throws an exception if it's not there.default StringgetSpanName(T context) Get the span name based on the given context.Returns theTracer.getTracingContext(T context) Get the current tracing context and updates the context if it's missing.default voiddefault voiddefault voidonScopeClosed(T context) Cleans the scope present in the context.default voidonScopeOpened(T context) Puts the span in scope.default voidonScopeReset(T context) Deprecated.default voidsetMaybeScopeOnTracingContext(TracingObservationHandler.TracingContext tracingContext, @Nullable Span newSpan) Creates or reuses an existingCurrentTraceContext.Scopegiven theSpan.default booleansupportsContext(io.micrometer.observation.Observation.Context context) default voidTags the span.Methods inherited from interface io.micrometer.observation.ObservationHandler
onStart, onStop
-
Method Details
-
tagSpan
-
getSpanName
-
onScopeOpened
-
setMaybeScopeOnTracingContext
default void setMaybeScopeOnTracingContext(TracingObservationHandler.TracingContext tracingContext, @Nullable Span newSpan) Creates or reuses an existingCurrentTraceContext.Scopegiven theSpan.Spancan benullin which a scope that resets current scope but remembers the previously present value will be created.- Parameters:
tracingContext- handler's tracing contextnewSpan- span, whose context will be used to create a new scope. Span can benull.- Since:
- 1.0.4
-
onScopeReset
Deprecated.Only invoked whenObservation.Scope.reset()orObservation.Scope.makeCurrent()is called; both are deprecated and no longer called by Micrometer code. This method will be removed in a future release.- Specified by:
onScopeResetin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
-
onEvent
-
onError
-
onScopeClosed
-
getParentSpan
Get the current span from parent if applicable.- Parameters:
context- aObservation.ContextView- Returns:
- parent span or
nullwhen there's none
-
getTracingContext
Get the current tracing context and updates the context if it's missing.- Parameters:
context- aObservation.Context- Returns:
- tracing context
-
supportsContext
default boolean supportsContext(io.micrometer.observation.Observation.Context context) - Specified by:
supportsContextin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
-
getRequiredSpan
-
endSpan
-
getTracer
-
Observation.Scope.reset()orObservation.Scope.makeCurrent()is called; both are deprecated and no longer called by Micrometer code.