
com.undefinedlabs.scope.scopemanager.DistributedContextScopeManager Maven / Gradle / Ivy
package com.undefinedlabs.scope.scopemanager;
import com.undefinedlabs.scope.context.ImmutableContext;
import io.opentracing.Scope;
import io.opentracing.ScopeManager;
import io.opentracing.Span;
public class DistributedContextScopeManager implements ScopeManager {
@Override
public Scope activate(Span span) {
return new DistributedContextScope(span);
}
@Override
public Span activeSpan() {
final DistributedContextScope scope =
(DistributedContextScope) DistributedContextScopeUtils.getValue(ImmutableContext.current());
return scope == null ? null : scope.span();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy