8000 Disable capture of entry values · DataDog/dd-trace-java@d5d15f1 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit d5d15f1

Browse files
committed
Dis 8000 able capture of entry values
Due to overhead induced by capturing entry values because we need to freeze them (serialize as Json) immediately before even know if we are sampling it or not, compared to the usefulness of having those values we only capture at exit by default.
1 parent 652b465 commit d5d15f1

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
5B8B 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)
0