Commit f015cfc
authored
Finish pyspark-shell trace using SparkListenerApplicationEnd (#6956)
Finish pyspark-shell application span when the spark listener is receiving the SparkListenerApplicationEnd event
The application span is currently finished when exiting the runMain method to capture JVM errors, however this function is not exited as expected (System.exit(0)) when executing as pyspark-shell
Pyspark application can be launched using multiple method, mainly:
- spark-submit script.py
- python script.py
The spark instrumentation is working as expected in the spark-submit case, because this is java/scala code launched behind the scene
However, the python case, the listener is being injected as expected, but the spark.application span is not being closed properly because the JVM is launched as PythonGatewayServer which is exited using System.exit(0), leading to the exit advice not being called1 parent 7cbd5a5 commit f015cfc
File tree
3 files changed
+66
-1
lines changed- dd-java-agent/instrumentation/spark/src
- main/java/datadog/trace/instrumentation/spark
- testFixtures/groovy/datadog/trace/instrumentation/spark
3 files changed
+66
-1
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
| |||
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
50 | 77 | | |
51 | 78 | | |
52 | 79 | | |
53 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
54 | 83 | | |
55 | 84 | | |
56 | 85 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
224 | 259 | | |
225 | 260 | | |
226 | 261 | | |
| |||
0 commit comments