Class StrictContextStorage

java.lang.Object
io.opentelemetry.context.StrictContextStorage
All Implemented Interfaces:
ContextStorage, AutoCloseable

final class StrictContextStorage extends Object implements ContextStorage, AutoCloseable
A ContextStorage which keeps track of opened and closed Scopes, reporting caller information if a Scope is closed incorrectly or not at all.

Calling close() will check at the moment it's called whether there are any scopes that have been opened but not closed yet. This could be called at the end of a unit test to ensure the tested code cleaned up scopes correctly.