@ThreadSafe public interface CorrelationContextManager
CorrelationContexts and CorrelationContexts based on the
current context.
This class returns builders that can be used to create the
implementation-dependent CorrelationContexts.
Implementations may have different constraints and are free to convert entry contexts to their
own subtypes. This means callers cannot assume the current context
is the same instance as the one placed into scope.
| Modifier and Type | Method and Description |
|---|---|
CorrelationContext.Builder |
contextBuilder()
Returns a new
Builder. |
CorrelationContext |
getCurrentContext()
Returns the current
CorrelationContext. |
io.opentelemetry.context.Scope |
withContext(CorrelationContext distContext)
Enters the scope of code where the given
CorrelationContext is in the current context
(replacing the previous CorrelationContext) and returns an object that represents that
scope. |
CorrelationContext getCurrentContext()
CorrelationContext.CorrelationContext.CorrelationContext.Builder contextBuilder()
Builder.Builder.io.opentelemetry.context.Scope withContext(CorrelationContext distContext)
CorrelationContext is in the current context
(replacing the previous CorrelationContext) and returns an object that represents that
scope. The scope is exited when the returned object is closed.distContext - the CorrelationContext to be set as the current context.CorrelationContext is set as the
current context.