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.AutoCloseableAnAutoCloseablethat 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-resourcesblock:try (Scope ignored = span.makeCurrent()) { ... }
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()static Scopenoop()Returns aScopethat does nothing.
-