10000 Revert "Add In-Product Enablement (#8461)" (#8509) · DataDog/dd-trace-java@7787c9d · GitHub
[go: up one dir, main page]

Skip to content

Commit 7787c9d

Browse files
authored
Revert "Add In-Product Enablement (#8461)" (#8509)
This reverts commit dceca28.
1 parent 951960b commit 7787c9d

File tree

16 files changed

+130
-637
lines changed

16 files changed

+130
-637
lines changed

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

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ private enum AgentFeature {
9696
CIVISIBILITY_AGENTLESS(CiVisibilityConfig.CIVISIBILITY_AGENTLESS_ENABLED, false),
9797
USM(UsmConfig.USM_ENABLED, false),
9898
TELEMETRY(GeneralConfig.TELEMETRY_ENABLED, true),
99-
DYNAMIC_INSTRUMENTATION(DebuggerConfig.DYNAMIC_INSTRUMENTATION_ENABLED, false),
100-
EXCEPTION_REPLAY(DebuggerConfig.EXCEPTION_REPLAY_ENABLED, false),
101-
CODE_ORIGIN(TraceInstrumentationConfig.CODE_ORIGIN_FOR_SPANS_ENABLED, false),
99+
DEBUGGER(DebuggerConfig.DYNAMIC_INSTRUMENTATION_ENABLED, false),
100+
EXCEPTION_DEBUGGING(DebuggerConfig.EXCEPTION_REPLAY_ENABLED, false),
101+
SPAN_ORIGIN(TraceInstrumentationConfig.CODE_ORIGIN_FOR_SPANS_ENABLED, false),
102102
DATA_JOBS(GeneralConfig.DATA_JOBS_ENABLED, false),
103103
AGENTLESS_LOG_SUBMISSION(GeneralConfig.AGENTLESS_LOG_SUBMISSION_ENABLED, false);
104104

@@ -149,10 +149,9 @@ public boolean isEnabledByDefault() {
149149
private static boolean ciVisibilityEnabled = false;
150150
private static boolean usmEnabled = false;
151151
private static boolean telemetryEnabled = true;
152-
private static boolean dynamicInstrumentationEnabled = false;
153-
private static boolean exceptionReplayEnabled = false;
154-
private static boolean codeOriginEnabled = false;
155-
private static boolean distributedDebuggerEnabled = false;
152+
private static boolean debuggerEnabled = false;
153+
private static boolean exceptionDebuggingEnabled = false;
154+
private static boolean spanOriginEnabled = false;
156155
private static boolean agentlessLogSubmissionEnabled = false;
157156

158157
/**
@@ -262,9 +261,9 @@ public static void start(
262261
|| isFeatureEnabled(AgentFeature.DEPRECATED_REMOTE_CONFIG);
263262
cwsEnabled = isFeatureEnabled(AgentFeature.CWS);
264263
telemetryEnabled = isFeatureEnabled(AgentFeature.TELEMETRY);
265-
dynamicInstrumentationEnabled = isFeatureEnabled(AgentFeature.DYNAMIC_INSTRUMENTATION);
266-
exceptionReplayEnabled = isFeatureEnabled(AgentFeature.EXCEPTION_REPLAY);
267-
codeOriginEnabled = isFeatureEnabled(AgentFeature.CODE_ORIGIN);
264+
debuggerEnabled = isFeatureEnabled(AgentFeature.DEBUGGER);
265+
exceptionDebuggingEnabled = isFeatureEnabled(AgentFeature.EXCEPTION_DEBUGGING);
266+
spanOriginEnabled = isFeatureEnabled(AgentFeature.SPAN_ORIGIN);
268267
agentlessLogSubmissionEnabled = isFeatureEnabled(AgentFeature.AGENTLESS_LOG_SUBMISSION);
269268

270269
if (profilingEnabled) {
@@ -1115,18 +1114,7 @@ private static void shutdownProfilingAgent(final boolean sync) {
11151114
}
11161115

11171116
private static void maybeStartDebugger(Instrumentation inst, Class<?> scoClass, Object sco) {
1118-
if (isExplicitlyDisabled(DebuggerConfig.DYNAMIC_INSTRUMENTATION_ENABLED)
1119-
&& isExplicitlyDisabled(DebuggerConfig.EXCEPTION_REPLAY_ENABLED)
1120-
&& isExplicitlyDisabled(TraceInstrumentationConfig.CODE_ORIGIN_FOR_SPANS_ENABLED)
1121-
&& isExplicitlyDisabled(DebuggerConfig.DISTRIBUTED_DEBUGGER_ENABLED)) {
1122-
return;
1123-
}
1124-
if (ciVisibilityEnabled
1125-
&& !dynamicInstrumentationEnabled
1126-
&& !exceptionReplayEnabled
1127-
&& !codeOriginEnabled
1128-
&& !distributedDebuggerEnabled) {
1129-
// if CI Visibility is enabled, debugger should be disabled by default
1117+
if (!debuggerEnabled && !exceptionDebuggingEnabled && !spanOriginEnabled) {
11301118
return;
11311119
}
11321120
if (!remoteConfigEnabled) {
@@ -1136,11 +1124,6 @@ && isExplicitlyDisabled(DebuggerConfig.DISTRIBUTED_DEBUGGER_ENABLED)) {
11361124
startDebuggerAgent(inst, scoClass, sco);
11371125
}
11381126

1139-
private static boolean isExplicitlyDisabled(String booleanKey) {
1140-
return Config.get().configProvider().isSet(booleanKey)
1141-
&& !Config.get().configProvider().getBoolean(booleanKey);
1142-
}
1143-
11441127
private static synchronized void startDebuggerAgent(
11451128
Instrumentation inst, Class<?> scoClass, Object sco) {
11461129
StaticEventLogger.begin("Debugger");

dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/DebuggerContext.java

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,6 @@ public String tag() {
5050
public abstract String tag();
5151
}
5252

53-
public interface ProductConfigUpdater {
54-
void updateConfig(
55-
Boolean dynamicInstrumentationEnabled,
56-
Boolean exceptionReplayEnabled,
57-
Boolean codeOriginEnabled,
58-
Boolean liveDebuggingEnabled);
59-
60-
boolean isDynamicInstrumentationEnabled();
61-
62-
boolean isExceptionReplayEnabled();
63-
64-
boolean isCodeOriginEnabled();
65-
66-
boolean isDistributedDebuggerEnabled();
67-
}
68-
6953
public interface ProbeResolver {
7054
ProbeImplementation resolve(String encodedProbeId);
7155
}
@@ -119,7 +103,6 @@ public interface CodeOriginRecorder {
119103
String captureCodeOrigin(Method method, boolean entry, boolean instrument);
120104
}
121105

122-
private static volatile ProductConfigUpdater productConfigUpdater;
123106
private static volatile ProbeResolver probeResolver;
124107
private static volatile ClassFilter classFilter;
125108
private static volatile ClassNameFilter classNameFilter;
@@ -129,10 +112,6 @@ public interface CodeOriginRecorder {
129112
private static volatile ExceptionDebugger exceptionDebugger;
130113
private static volatile CodeOriginRecorder codeOriginRecorder;
131114

132-
public static void initProductConfigUpdater(ProductConfigUpdater productConfigUpdater) {
133-
DebuggerContext.productConfigUpdater = productConfigUpdater;
134-
}
135-
136115
public static void initProbeResolver(ProbeResolver probeResolver) {
137116
DebuggerContext.probeResolver = probeResolver;
138117
}
@@ -165,59 +144,6 @@ public static void initCodeOrigin(CodeOriginRecorder codeOriginRecorder) {
165144
DebuggerContext.codeOriginRecorder = codeOriginRecorder;
166145
}
167146

168-
public static void updateConfig(
169-
Boolean dynamicInstrumentationEnabled,
170-
Boolean exceptionReplayEnabled,
171-
Boolean codeOriginEnabled,
172-
Boolean liveDebuggingEnabled) {
173-
LOGGER.debug(
174-
"Updating config: dynamicInstrumentationEnabled: {}, exceptionReplayEnabled: {}, codeOriginEnabled: {}, liveDebuggingEnabled: {}",
175-
dynamicInstrumentationEnabled,
176-
exceptionReplayEnabled,
177-
codeOriginEnabled,
178-
liveDebuggingEnabled);
179-
ProductConfigUpdater updater = productConfigUpdater;
180-
if (updater != null) {
181-
updater.updateConfig(
182-
dynamicInstrumentationEnabled,
183-
exceptionReplayEnabled,
184-
codeOriginEnabled,
185-
liveDebuggingEnabled);
186-
}
187-
}
188-
189-
public static boolean isDynamicInstrumentationEnabled() {
190-
ProductConfigUpdater updater = productConfigUpdater;
191-
if (updater != null) {
192-
return updater.isDynamicInstrumentationEnabled();
193-
}
194-
return Config.get().isDynamicInstrumentationEnabled();
195-
}
196-
197-
public static boolean isExceptionReplayEnabled() {
198-
ProductConfigUpdater updater = productConfigUpdater;
199-
if (updater != null) {
200-
return updater.isExceptionReplayEnabled();
201-
}
202-
return Config.get().isDebuggerExceptionEnabled();
203-
}
204-
205-
public static boolean isCodeOriginEnabled() {
206-
ProductConfigUpdater updater = productConfigUpdater;
207-
if (updater != null) {
208-
return updater.isCodeOriginEnabled();
209-
}
210-
return Config.get().isDebuggerCodeOriginEnabled();
211-
}
212-
213-
public static boolean isDistributedDebuggerEnabled() {
214-
ProductConfigUpdater updater = productConfigUpdater;
215-
if (updater != null) {
216-
return updater.isDistributedDebuggerEnabled();
217-
}
218-
return Config.get().isDistributedDebuggerEnabled();
219-
}
220-
221147
/**
222148
* Returns the probe details based on the probe id provided. If no probe is found, try to
223149
* re-transform the class using the callingClass parameter No-op if no implementation available

0 commit comments

Comments
 (0)
0