From a4e2819d99e650f9dc57c69163b9067f7736fe8c Mon Sep 17 00:00:00 2001 From: Paul Laffon Date: Fri, 18 Oct 2024 16:46:23 +0200 Subject: [PATCH] Fix default value for long-running spans with DJM (#7810) --- .../java/datadog/trace/bootstrap/Agent.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java index adfaef07392..7a4b446e7de 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java @@ -221,6 +221,15 @@ public static void start( boolean dataJobsEnabled = isFeatureEnabled(AgentFeature.DATA_JOBS); if (dataJobsEnabled) { + log.info("Data Jobs Monitoring enabled, enabling spark integrations"); + + setSystemPropertyDefault( + propertyNameToSystemPropertyName(TracerConfig.TRACE_LONG_RUNNING_ENABLED), "true"); + setSystemPropertyDefault( + propertyNameToSystemPropertyName("integration.spark.enabled"), "true"); + setSystemPropertyDefault( + propertyNameToSystemPropertyName("integration.spark-executor.enabled"), "true"); + String javaCommand = System.getProperty("sun.java.command"); String dataJobsCommandPattern = Config.get().getDataJobsCommandPattern(); if (!isDataJobsSupported(javaCommand, dataJobsCommandPattern)) { @@ -230,15 +239,6 @@ public static void start( dataJobsCommandPattern); return; } - - log.info("Data Jobs Monitoring enabled, enabling spark integrations"); - - setSystemPropertyDefault( - propertyNameToSystemPropertyName(TracerConfig.TRACE_LONG_RUNNING_ENABLED), "true"); - setSystemPropertyDefault( - propertyNameToSystemPropertyName("integration.spark.enabled"), "true"); - setSystemPropertyDefault( - propertyNameToSystemPropertyName("integration.spark-executor.enabled"), "true"); } if (!isSupportedAppSecArch()) {