Skip to content

Commit 4f90af6

Browse files
committed
include span in log/exception
1 parent c2aea7c commit 4f90af6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ public void close() {
9999
if (agentSpan == tracer.activeSpan()) {
100100
tracer.closeActive();
101101
} else if (Config.get().isScopeStrictMode()) {
102-
throw new RuntimeException("Tried to close scope when not on top");
102+
throw new RuntimeException("Tried to close " + agentSpan + " scope when not on top");
103103
} else {
104-
log.warn("Tried to close scope when not on top");
104+
log.warn("Tried to close {} scope when not on top", agentSpan);
105105
}
106106
}
107107
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ public void close() {
109109
if (agentSpan == tracer.activeSpan()) {
110110
tracer.closeActive();
111111
} else if (Config.get().isScopeStrictMode()) {
112-
throw new RuntimeException("Tried to close scope when not on top");
112+
throw new RuntimeException("Tried to close " + agentSpan + " scope when not on top");
113113
} else {
114-
log.warn("Tried to close scope when not on top");
114+
log.warn("Tried to close {} scope when not on top", agentSpan);
115115
}
116116
}
117117
}

dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public final void close() {
5555
byte source = source();
5656
scopeManager.healthMetrics.onScopeCloseError(source);
5757
if (source == ScopeSource.MANUAL.id() && scopeManager.strictMode) {
58-
throw new RuntimeException("Tried to close scope when not on top");
58+
throw new RuntimeException("Tried to close " + span + " scope when not on top");
5959
}
6060
}
6161

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ public void close() {
127127
if (agentSpan == tracer.activeSpan()) {
128128
tracer.closeActive();
129129
} else if (Config.get().isScopeStrictMode()) {
130-
throw new RuntimeException("Tried to close scope when not on top");
130+
throw new RuntimeException("Tried to close " + agentSpan + " scope when not on top");
131131
} else {
132-
log.warn("Tried to close scope when not on top");
132+
log.warn("Tried to close {} scope when not on top", agentSpan);
133133
}
134134
}
135135
}

0 commit comments

Comments
 (0)