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 TypeMethodDescriptionvoid
close()
Deprecated.scheduled for removal in 1.5.0getScope()
Returns the scope of the span.getSpan()
Returns the span.void
setBaggage
(Map<String, String> baggage) Deprecated.scheduled for removal in 1.5.0void
Sets the current trace context scope.void
Sets the span.void
setSpanAndScope
(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
Deprecated.scheduled for removal in 1.5.0Returns the baggage corresponding to this span.- Returns:
- baggage attached to the span
-
setBaggage
Deprecated.scheduled for removal in 1.5.0Sets 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:
close
in interfaceAutoCloseable
-
toString
-