@@ -172,11 +172,15 @@ static void setupSparkConf(SparkConf sparkConf) {
172172 "_dd.trace_id:"
173173 + listener .applicationSpan .context ().getTraceId ().toString ()
174174 + ";_dd.ol_intake.emit_spans:false" );
175+ for (Tuple2 <String , String > tuple : sparkConf .getAll ()) {
176+ log .error ("Set Spark conf: Key: " + tuple ._1 + ", Value: " + tuple ._2 );
177+ }
175178 }
176179
177180 public void setupOpenLineage () {
178- log .debug ("Setting up OpenLineage-Datadog integration" );
181+ log .error ("Setting up OpenLineage-Datadog integration" );
179182 if (openLineageSparkListener != null ) {
183+ log .error ("No init needed" );
180184 setupSparkConf (openLineageSparkConf );
181185 return ;
182186 }
@@ -240,6 +244,8 @@ private void initApplicationSpanIfNotInitialized() {
240244 return ;
241245 }
242246
247+ log .error ("Starting tracer application span." );
248+
243249 AgentTracer .SpanBuilder builder = buildSparkSpan ("spark.application" , null );
244250
245251 if (applicationStart != null ) {
@@ -253,8 +259,6 @@ private void initApplicationSpanIfNotInitialized() {
253259 }
254260 }
255261
256- notifyOl (x -> this .openLineageSparkListener .onApplicationStart (x ), applicationStart );
257-
258262 captureApplicationParameters (builder );
259263 captureOpenlineageContextIfPresent (builder );
260264
@@ -263,6 +267,7 @@ private void initApplicationSpanIfNotInitialized() {
263267 applicationSpan .setMeasured (true );
264268 // We need to set it up after we create application span to have correlation.
265269 setupOpenLineage ();
270+ notifyOl (x -> openLineageSparkListener .onApplicationStart (x ), applicationStart );
266271 }
267272
268273 private void captureOpenlineageContextIfPresent (AgentTracer .SpanBuilder builder ) {
@@ -774,14 +779,15 @@ public void onOtherEvent(SparkListenerEvent event) {
774779
775780 private <T extends SparkListenerEvent > void notifyOl (Consumer <T > ol , T event ) {
776781 if (isRunningOnDatabricks || isStreamingJob ) {
777- log .debug ("Not emitting event when running on databricks or on streaming jobs" );
782+ log .error ("Not emitting event when running on databricks or on streaming jobs" );
778783 return ;
779784 }
785+ initApplicationSpanIfNotInitialized ();
780786 if (openLineageSparkListener != null ) {
781- log .debug ("Notifying with event `{}`" , event .getClass ().getCanonicalName ());
787+ log .error ("Notifying with event `{}`" , event .getClass ().getCanonicalName ());
782788 ol .accept (event );
783789 } else {
784- log .debug ("OpenLineageSparkListener is null" );
790+ log .error ("OpenLineageSparkListener is null" );
785791 }
786792 }
787793
0 commit comments