Skip to content

Commit 036cd28

Browse files
Flush traces when spark application is finished
1 parent 47044c2 commit 036cd28

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dd-java-agent/instrumentation/spark/src/main/java/datadog/trace/instrumentation/spark/AbstractDatadogSparkListener.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ public synchronized void finishApplication(
213213
"spark.available_executor_time", computeCurrentAvailableExecutorTime(time));
214214

215215
applicationSpan.finish(time * 1000);
216+
217+
// write traces synchronously:
218+
// as soon as the application finishes, the JVM starts to shut down
219+
tracer.flush();
216220
}
217221

218222
private AgentSpan getOrCreateStreamingBatchSpan(

0 commit comments

Comments
 (0)