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 Classes
    Modifier and Type
    Interface
    Description
    static class 
    Basic 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 Type
    Method
    Description
    default Span
    getParentSpan(io.micrometer.observation.Observation.ContextView context)
    Get the current span from parent if applicable.
    default Span
    getRequiredSpan(T context)
    Returns the span from the context or throws an exception if it's not there.
    default String
    getSpanName(T context)
    Get the span name.
    Returns the Tracer.
    Get the current tracing context and updates the context if it's missing.
    default void
    onError(T context)
     
    default void
    onEvent(io.micrometer.observation.Observation.Event event, T context)
     
    default void
    onScopeClosed(T context)
    Cleans the scope present in the context.
    default void
    onScopeOpened(T context)
    Puts the span in scope.
    default void
    onScopeReset(T context)
     
    default boolean
    supportsContext(io.micrometer.observation.Observation.Context context)
     
    default void
    tagSpan(T context, Span span)
    Tags the span.

    Methods inherited from interface io.micrometer.observation.ObservationHandler

    onStart, onStop
  • Method Details

    • tagSpan

      default void tagSpan(T context, Span span)
      Tags the span.
      Parameters:
      context - handler context
      span - span to tag
    • getSpanName

      default String getSpanName(T context)
      Get the span name.
      Parameters:
      context - handler context
      Returns:
      name for the span
    • onScopeOpened

      default void onScopeOpened(T context)
      Puts the span in scope.
      Specified by:
      onScopeOpened in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
      Parameters:
      context - recording with context containing scope
    • onScopeReset

      default void onScopeReset(T context)
      Specified by:
      onScopeReset in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • onEvent

      default void onEvent(io.micrometer.observation.Observation.Event event, T context)
      Specified by:
      onEvent in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • onError

      default void onError(T context)
      Specified by:
      onError in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • onScopeClosed

      default void onScopeClosed(T context)
      Cleans the scope present in the context.
      Specified by:
      onScopeClosed in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
      Parameters:
      context - recording with context containing scope
    • getParentSpan

      @Nullable default Span getParentSpan(io.micrometer.observation.Observation.ContextView context)
      Get the current span from parent if applicable.
      Parameters:
      context - a Observation.ContextView
      Returns:
      parent span or null when there's none
    • getTracingContext

      @NonNull default TracingObservationHandler.TracingContext getTracingContext(T context)
      Get the current tracing context and updates the context if it's missing.
      Parameters:
      context - a Observation.Context
      Returns:
      tracing context
    • supportsContext

      default boolean supportsContext(io.micrometer.observation.Observation.Context context)
      Specified by:
      supportsContext in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • getRequiredSpan

      default Span getRequiredSpan(T context)
      Returns the span from the context or throws an exception if it's not there.
      Parameters:
      context - context
      Returns:
      span or exception
    • getTracer

      Tracer getTracer()
      Returns the Tracer.
      Returns:
      tracer