Skip to content

Commit b79d752

Browse files
committed
Automatic AOT training detection can be turned off with DD_AOT_TRAINING=false
1 parent c234bb3 commit b79d752

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

dd-java-agent/src/main/java/datadog/trace/bootstrap/AgentBootstrap.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ private static boolean isAotTraining(String agentArgs, Instrumentation inst) {
436436
return false; // agent doesn't support training mode before Java 25
437437
} else if ("aot_training".equalsIgnoreCase(agentArgs)) {
438438
return true; // training mode explicitly enabled via -javaagent
439+
} else if ("false".equalsIgnoreCase(EnvironmentVariables.get("DD_AOT_TRAINING"))) {
440+
return false; // training mode explicitly disabled via DD_AOT_TRAINING=false
439441
} else {
440442
return AdvancedAgentChecks.isAotTraining(inst); // check JVM status
441443
}

metadata/supported-configurations.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@
105105
"aliases": []
106106
}
107107
],
108+
"DD_AOT_TRAINING": [
109+
{
110+
"version": "A",
111+
"type": "boolean",
112+
"default": null,
113+
"aliases": []
114+
}
115+
],
108116
"DD_API_KEY": [
109117
{
110118
"version": "A",

0 commit comments

Comments
 (0)