1111import datadog .trace .api .scopemanager .ExtendedScopeListener ;
1212import datadog .trace .api .scopemanager .ScopeListener ;
1313import datadog .trace .bootstrap .instrumentation .api .AgentScope ;
14- import datadog .trace .bootstrap .instrumentation .api .AgentScopeManager ;
1514import datadog .trace .bootstrap .instrumentation .api .AgentSpan ;
1615import datadog .trace .bootstrap .instrumentation .api .AgentTracer ;
1716import datadog .trace .bootstrap .instrumentation .api .ProfilerContext ;
1817import datadog .trace .bootstrap .instrumentation .api .ProfilingContextIntegration ;
1918import datadog .trace .bootstrap .instrumentation .api .ScopeSource ;
2019import datadog .trace .bootstrap .instrumentation .api .ScopeState ;
20+ import datadog .trace .bootstrap .instrumentation .api .ScopeStateAware ;
2121import datadog .trace .core .monitor .HealthMetrics ;
2222import datadog .trace .relocate .api .RatelimitedLogger ;
2323import datadog .trace .util .AgentTaskScheduler ;
3737 * from being reported even if all related spans are finished. It also delegates to other
3838 * ScopeInterceptors to provide additional functionality.
3939 */
40- public final class ContinuableScopeManager implements AgentScopeManager {
40+ public final class ContinuableScopeManager implements ScopeStateAware {
4141 static final Logger log = LoggerFactory .getLogger (ContinuableScopeManager .class );
4242 static final RatelimitedLogger ratelimitedLog = new RatelimitedLogger (log , 1 , MINUTES );
4343 static final long iterationKeepAlive =
@@ -81,18 +81,15 @@ public ContinuableScopeManager(
8181 this .profilingContextIntegration = profilingContextIntegration ;
8282 }
8383
84- @ Override
8584 public AgentScope activate (final AgentSpan span , final ScopeSource source ) {
8685 return activate (span , source .id (), false , /* ignored */ false );
8786 }
8887
89- @ Override
9088 public AgentScope activate (
9189 final AgentSpan span , final ScopeSource source , boolean isAsyncPropagating ) {
9290 return activate (span , source .id (), true , isAsyncPropagating );
9391 }
9492
95- @ Override
9693 public AgentScope .Continuation captureSpan (final AgentSpan span ) {
9794 AbstractContinuation continuation =
9895 new SingleContinuation (this , span , ScopeSource .INSTRUMENTATION .id ());
@@ -170,7 +167,6 @@ ContinuableScope continueSpan(
170167 return scope ;
171168 }
172169
173- @ Override
174170 public void closePrevious (final boolean finishSpan ) {
175171 ScopeStack scopeStack = scopeStack ();
176172
@@ -189,7 +185,6 @@ public void closePrevious(final boolean finishSpan) {
189185 }
190186 }
191187
192- @ Override
193188 public AgentScope activateNext (final AgentSpan span ) {
194189 ScopeStack scopeStack = scopeStack ();
195190
@@ -220,12 +215,10 @@ public AgentScope activateNext(final AgentSpan span) {
220215 return scope ;
221216 }
222217
223- @ Override
224218 public AgentScope active () {
225219 return scopeStack ().active ();
226220 }
227221
228- @ Override
229222 public AgentSpan activeSpan () {
230223 final ContinuableScope active = scopeStack ().active ();
231224 return active == null ? null : active .span ;
0 commit comments