forked from census-instrumentation/opencensus-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScopeManagerImpl.java
More file actions
45 lines (37 loc) · 1.18 KB
/
ScopeManagerImpl.java
File metadata and controls
45 lines (37 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package io.opencensus.trace;
import io.opencensus.common.Scope;
import io.opencensus.trace.BlankScope;
import io.opencensus.tags.BlankTagContext;
import io.opencensus.tags.TagContext;
import java.util.concurrent.Callable;
public class ScopeManagerImpl implements ScopeManager {
@Override
public Span activeSpan() {
return CurrentSpanUtils.getCurrentSpan();
}
@Override
public TagContext activeTagContext() {
return BlankTagContext.INSTANCE;
}
@Override
public Scope withSpan(Span span) {
return CurrentSpanUtils.withSpan(span, /* endSpan= */ false);
}
@Override
public Scope withSpan(Span span, boolean finishSpanOnClose) {
return CurrentSpanUtils.withSpan(span, finishSpanOnClose);
}
@Override
public Runnable withSpan(Span span, boolean finishSpanOnClose, Runnable runnable) {
return CurrentSpanUtils.withSpan(span, finishSpanOnClose, runnable);
}
@Override
public <C> Callable<C> withSpan(Span span, boolean finishSpanOnClose, Callable<C> callable) {
return CurrentSpanUtils.withSpan(span, finishSpanOnClose, callable);
}
@Override
public Scope withTagContext(TagContext context) {
// TODO
return BlankScope.INSTANCE;
}
}