Package io.micrometer.tracing.handler
Class TracingObservationHandler.TracingContext
java.lang.Object
io.micrometer.tracing.handler.TracingObservationHandler.TracingContext
- All Implemented Interfaces:
AutoCloseable
- Enclosing interface:
TracingObservationHandler<T extends io.micrometer.observation.Observation.Context>
public static class TracingObservationHandler.TracingContext
extends Object
implements AutoCloseable
Basic tracing context.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the baggage corresponding to this span.getScope()Returns the scope of the span.getSpan()Returns the span.voidsetBaggage(Map<String, String> baggage) Sets the baggagevoidSets the current trace context scope.voidSets the span.voidsetSpanAndScope(Span span, CurrentTraceContext.Scope scope) Convenience method to set both span and scope.toString()
-
Constructor Details
-
TracingContext
public TracingContext()
-
-
Method Details
-
getSpan
Returns the span.- Returns:
- span
-
setSpan
Sets the span.- Parameters:
span- span to set
-
getScope
Returns the scope of the span.- Returns:
- scope of the span
-
setScope
Sets the current trace context scope.- Parameters:
scope- scope to set
-
getBaggage
Returns the baggage corresponding to this span.- Returns:
- baggage attached to the span
-
setBaggage
Sets the baggage- Parameters:
baggage- baggage to set
-
setSpanAndScope
Convenience method to set both span and scope.- Parameters:
span- span to setscope- scope to set
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
toString
-