@@ -254,41 +254,41 @@ private void initApplicationSpanIfNotInitialized() {
254254 }
255255
256256 log .debug ("Starting tracer application span." );
257- if (!isRunningOnDatabricks ){
258- AgentTracer .SpanBuilder builder = buildSparkSpan ("spark.application" , null );
259-
260- if (applicationStart != null ) {
261- String ddTags =
262- Config .get ().getGlobalTags ().entrySet ().stream ()
263- .sorted (Map .Entry .comparingByKey ())
264- .map (e -> e .getKey () + ":" + e .getValue ())
265- .collect (Collectors .joining ("," ));
266-
267- builder
268- .withStartTimestamp (applicationStart .time () * 1000 )
269- .withTag ("application_name" , applicationStart .appName ())
270- .withTag ("djm.tags" , ddTags )
271- .withTag ("spark_user" , applicationStart .sparkUser ());
272-
273- if (applicationStart .appAttemptId ().isDefined ()) {
274- builder .withTag ("app_attempt_id" , applicationStart .appAttemptId ().get ());
257+ if (!isRunningOnDatabricks ) {
258+ AgentTracer .SpanBuilder builder = buildSparkSpan ("spark.application" , null );
259+
260+ if (applicationStart != null ) {
261+ String ddTags =
262+ Config .get ().getGlobalTags ().entrySet ().stream ()
263+ .sorted (Map .Entry .comparingByKey ())
264+ .map (e -> e .getKey () + ":" + e .getValue ())
265+ .collect (Collectors .joining ("," ));
266+
267+ builder
268+ .withStartTimestamp (applicationStart .time () * 1000 )
269+ .withTag ("application_name" , applicationStart .appName ())
270+ .withTag ("djm.tags" , ddTags )
271+ .withTag ("spark_user" , applicationStart .sparkUser ());
272+
273+ if (applicationStart .appAttemptId ().isDefined ()) {
274+ builder .withTag ("app_attempt_id" , applicationStart .appAttemptId ().get ());
275+ }
275276 }
276- }
277277
278- captureApplicationParameters (builder );
278+ captureApplicationParameters (builder );
279279
280- Optional <OpenlineageParentContext > openlineageParentContext =
281- OpenlineageParentContext .from (sparkConf );
282- // We know we're not in Databricks context
283- if (openlineageParentContext .isPresent ()) {
284- captureOpenlineageContextIfPresent (builder , openlineageParentContext .get ());
285- } else {
286- builder .asChildOf (predeterminedTraceIdContext );
287- }
280+ Optional <OpenlineageParentContext > openlineageParentContext =
281+ OpenlineageParentContext .from (sparkConf );
282+ // We know we're not in Databricks context
283+ if (openlineageParentContext .isPresent ()) {
284+ captureOpenlineageContextIfPresent (builder , openlineageParentContext .get ());
285+ } else {
286+ builder .asChildOf (predeterminedTraceIdContext );
287+ }
288288
289- applicationSpan = builder .start ();
290- setDataJobsSamplingPriority (applicationSpan );
291- applicationSpan .setMeasured (true );
289+ applicationSpan = builder .start ();
290+ setDataJobsSamplingPriority (applicationSpan );
291+ applicationSpan .setMeasured (true );
292292 }
293293 }
294294
0 commit comments