Skip to content

Commit c2aea7c

Browse files
committed
feedback
1 parent 623f2ce commit c2aea7c

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

dd-java-agent/instrumentation/opentracing/api-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTScopeManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public byte source() {
9797
@Override
9898
public void close() {
9999
if (agentSpan == tracer.activeSpan()) {
100-
tracer.closeActiveSpan();
100+
tracer.closeActive();
101101
} else if (Config.get().isScopeStrictMode()) {
102102
throw new RuntimeException("Tried to close scope when not on top");
103103
} else {

dd-java-agent/instrumentation/opentracing/api-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTScopeManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public byte source() {
107107
@Override
108108
public void close() {
109109
if (agentSpan == tracer.activeSpan()) {
110-
tracer.closeActiveSpan();
110+
tracer.closeActive();
111111
} else if (Config.get().isScopeStrictMode()) {
112112
throw new RuntimeException("Tried to close scope when not on top");
113113
} else {

dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ public AgentScope activeScope() {
978978
}
979979

980980
@Override
981-
public void closeActiveSpan() {
981+
public void closeActive() {
982982
AgentScope activeScope = this.scopeManager.active();
983983
if (activeScope != null) {
984984
activeScope.close();

dd-trace-ot/src/main/java/datadog/opentracing/OTScopeManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public byte source() {
125125
@Override
126126
public void close() {
127127
if (agentSpan == tracer.activeSpan()) {
128-
tracer.closeActiveSpan();
128+
tracer.closeActive();
129129
} else if (Config.get().isScopeStrictMode()) {
130130
throw new RuntimeException("Tried to close scope when not on top");
131131
} else {

internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,13 @@ public static AgentScope.Continuation captureSpan(final AgentSpan span) {
122122
}
123123

124124
/**
125-
* Closes the scope for the currently active span. Prefer closing the scope returned by {@link
126-
* #activateSpan} when available.
125+
* Closes the scope for the currently active span.
126+
*
127+
* @deprecated Prefer closing the scope returned by {@link #activateSpan} when available.
127128
*/
128-
public static void closeActiveSpan() {
129-
get().closeActiveSpan();
129+
@Deprecated
130+
public static void closeActive() {
131+
get().closeActive();
130132
}
131133

132134
/**
@@ -318,6 +320,8 @@ AgentSpan startSpan(
318320

319321
AgentScope.Continuation captureSpan(AgentSpan span);
320322

323+
void closeActive();
324+
321325
void closePrevious(boolean finishSpan);
322326

323327
AgentScope activateNext(AgentSpan span);
@@ -326,8 +330,6 @@ AgentSpan startSpan(
326330

327331
AgentScope activeScope();
328332

329-
void closeActiveSpan();
330-
331333
default AgentSpan blackholeSpan() {
332334
final AgentSpan active = activeSpan();
333335
return new BlackHoleSpan(active != null ? active.getTraceId() : DDTraceId.ZERO);
@@ -473,6 +475,9 @@ public boolean isAsyncPropagationEnabled() {
473475
@Override
474476
public void setAsyncPropagationEnabled(boolean asyncPropagationEnabled) {}
475477

478+
@Override
479+
public void closeActive() {}
480+
476481
@Override
477482
public void closePrevious(final boolean finishSpan) {}
478483

@@ -491,9 +496,6 @@ public AgentScope activeScope() {
491496
return null;
492497
}
493498

494-
@Override
495-
public void closeActiveSpan() {}
496-
497499
@Override
498500
public AgentSpan blackholeSpan() {
499501
return NoopSpan.INSTANCE; // no-op tracer stays no-op

0 commit comments

Comments
 (0)