You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherListener.java
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,12 @@ public void stateChanged(SparkAppHandle handle) {
97
97
if (state == SparkAppHandle.State.FAILED
98
98
|| state == SparkAppHandle.State.KILLED
99
99
|| state == SparkAppHandle.State.LOST) {
100
-
finishSpan(true, "Application " + state);
100
+
// Set error tags but don't finish yet — RunMainAdvice may add the throwable
101
+
// with the full stack trace. The span will be finished by RunMainAdvice or
Copy file name to clipboardExpand all lines: dd-java-agent/instrumentation/spark/spark-common/src/test/groovy/datadog/trace/instrumentation/spark/SparkLauncherTest.groovy
+38-3Lines changed: 38 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ class SparkLauncherTest extends InstrumentationSpecification {
130
130
}
131
131
}
132
132
133
-
def"SparkLauncherListener finishes span with error on FAILED state"() {
133
+
def"SparkLauncherListener sets error tags on FAILED state but does not finish span"() {
134
134
setup:
135
135
SparkLauncherListener.launcherSpan =null
136
136
def tracer =AgentTracer.get()
@@ -150,6 +150,40 @@ class SparkLauncherTest extends InstrumentationSpecification {
150
150
handle.getAppId() >>"app-456"
151
151
listener.stateChanged(handle)
152
152
153
+
then:
154
+
// Span stays open so RunMainAdvice can add the throwable
0 commit comments