Skip to content

Commit 92efaca

Browse files
authored
Merge branch 'master' into rarguelloF/AIDM-340/kafka-messaging-destination
2 parents 1078807 + e037162 commit 92efaca

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/LogProbe.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ public Sampling getSampling() {
444444
@Override
445445
public InstrumentationResult.Status instrument(
446446
MethodInfo methodInfo, List<DiagnosticMessage> diagnostics, List<ProbeId> probeIds) {
447-
// if evaluation is at exit and with condition, skip collecting data at entry
448-
boolean captureEntry = !(getEvaluateAt() == MethodLocation.EXIT && hasCondition());
447+
// only capture entry values if explicitly not at Exit. By default, we are using evaluateAt=EXIT
448+
boolean captureEntry = getEvaluateAt() != MethodLocation.EXIT;
449449
return new CapturedContextInstrumentor(
450450
this,
451451
methodInfo,

dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/CapturedSnapshotTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ public void methodProbeAtExit() throws IOException, URISyntaxException {
155155
int result = Reflect.onClass(testClass).call("main", "1").get();
156156
assertEquals(3, result);
157157
Snapshot snapshot = assertOneSnapshot(listener);
158-
assertCaptureArgs(snapshot.getCaptures().getEntry(), "arg", "java.lang.String", "1");
158+
// no entry values capture
159+
assertEquals(CapturedContext.EMPTY_CAPTURING_CONTEXT, snapshot.getCaptures().getEntry());
159160
assertCaptureArgs(snapshot.getCaptures().getReturn(), "arg", "java.lang.String", "1");
160161
assertTrue(snapshot.getDuration() > 0);
161162
assertTrue(snapshot.getStack().size() > 0);

0 commit comments

Comments
 (0)