Skip to content

🍒 8369 - Disable capture of entry values #8424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ public Sampling getSampling() {
@Override
public InstrumentationResult.Status instrument(
MethodInfo methodInfo, List<DiagnosticMessage> diagnostics, List<ProbeId> probeIds) {
// if evaluation is at exit and with condition, skip collecting data at entry
boolean captureEntry = !(getEvaluateAt() == MethodLocation.EXIT && hasCondition());
// only capture entry values if explicitly not at Exit. By default, we are using evaluateAt=EXIT
boolean captureEntry = getEvaluateAt() != MethodLocation.EXIT;
return new CapturedContextInstrumentor(
this,
methodInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ public void methodProbeAtExit() throws IOException, URISyntaxException {
int result = Reflect.onClass(testClass).call("main", "1").get();
assertEquals(3, result);
Snapshot snapshot = assertOneSnapshot(listener);
assertCaptureArgs(snapshot.getCaptures().getEntry(), "arg", "java.lang.String", "1");
// no entry values capture
assertEquals(CapturedContext.EMPTY_CAPTURING_CONTEXT, snapshot.getCaptures().getEntry());
assertCaptureArgs(snapshot.getCaptures().getReturn(), "arg", "java.lang.String", "1");
assertTrue(snapshot.getDuration() > 0);
assertTrue(snapshot.getStack().size() > 0);
Expand Down
Loading