Package io.opentelemetry.context
Interface Scope
-
- All Superinterfaces:
AutoCloseable
public interface Scope extends 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.
-
-
-
Method Detail
-
noop
static Scope noop()
-
close
void close()
- Specified by:
close
in interfaceAutoCloseable
-
-