Package io.opentelemetry.context
Interface Scope
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
StrictContextStorage.StrictScope
,ThreadLocalContextStorage.NoopScope
,ThreadLocalContextStorage.ScopeImpl
public interface Scope extends java.lang.AutoCloseable
AnAutoCloseable
that represents a mounted context for a block of code. A failure to callclose()
will generally break tracing or cause memory leaks. It is recommended that you use this class with atry-with-resources
block:try (Scope ignored = span.makeCurrent()) { ... }
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
static Scope
noop()
Returns aScope
that does nothing.
-