Package io.micrometer.tracing.handler
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,HttpClientTracingObservationHandler,HttpServerTracingObservationHandler
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 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.Returns theTracer.getTracingContext(T context) Get the current tracing context.default voiddefault voidonScopeClosed(T context) Cleans the scope present in the context.default voidonScopeOpened(T context) Puts the span in scope.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
Tags the span.- Parameters:
context- handler contextspan- span to tag
-
getSpanName
Get the span name.- Parameters:
context- handler context- Returns:
- name for the span
-
onScopeOpened
Puts the span in scope.- Specified by:
onScopeOpenedin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>- Parameters:
context- recording with context containing scope
-
onError
- Specified by:
onErrorin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
-
onScopeClosed
Cleans the scope present in the context.- Specified by:
onScopeClosedin interfaceio.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>- Parameters:
context- recording with context containing scope
-
getTracingContext
Get the current tracing context.- 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
Returns the span from the context or throws an exception if it's not there.- Parameters:
context- contextd- Returns:
- span or exception
-
getTracer
Tracer getTracer()Returns theTracer.- Returns:
- tracer
-