Top Description Methods
io.opentelemetry.context

public Interface Scope

extends AutoCloseable
Known Direct Implementers
io.opentelemetry.context.StrictContextStorage.StrictScope, io.opentelemetry.context.ThreadLocalContextStorage.ScopeImpl, io.opentelemetry.context.ThreadLocalContextStorage.NoopScope
Imports
io.opentelemetry.context.ThreadLocalContextStorage.NoopScope

An AutoCloseable that represents a mounted context for a block of code. A failure to call Scope#close() will generally break tracing or cause memory leaks. It is recommended that you use this class with a try-with-resources block:
try (Scope ignored = span.makeCurrent()) {
  ...
}

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources.

public static Scope
noop()

Returns a Scope that does nothing.

Method Detail

closeback to summary
public void close()

Redeclares java.lang.AutoCloseable.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Annotations
@Override
noopback to summary
public static Scope noop()

Returns a Scope that does nothing. Represents attaching a Context when it is already attached.