Skip to content

Commit 13c8c9f

Browse files
committed
PR cleanups
1 parent 2de3ffb commit 13c8c9f

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/codeorigin/CodeOriginProbeManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public String createProbeForFrame(String signature) {
6262
StackTraceElement element = findPlaceInStack();
6363
String fingerprint = Fingerprinter.fingerprint(element);
6464
if (fingerprint == null) {
65-
LOG.debug("Unable to fingerprint snapshot");
65+
LOG.debug("Unable to fingerprint stack trace");
6666
return null;
6767
}
6868
CodeOriginProbe probe;
@@ -82,6 +82,8 @@ public String createProbeForFrame(String signature) {
8282

8383
installProbe(probe);
8484
if (AgentTracer.get().activeSpan() != null) {
85+
// committing here manually so that first run probe encounters decorate the span until the
86+
// instrumentation gets installed
8587
probe.commit(
8688
CapturedContext.EMPTY_CONTEXT, CapturedContext.EMPTY_CONTEXT, Collections.emptyList());
8789
}

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,20 @@ public void commit(
7272
AgentSpan span = AgentTracer.activeSpan();
7373

7474
if (span == null) {
75-
LOGGER.debug("Could not find the exit span for probeId {}", id);
75+
LOGGER.debug("Could not find the span for probeId {}", id);
7676
return;
7777
}
7878
String snapshotId = null;
7979
if (isDebuggerEnabled(span)) {
8080
Snapshot snapshot = createSnapshot();
8181
if (fillSnapshot(entryContext, exitContext, caughtExceptions, snapshot)) {
8282
snapshotId = snapshot.getId();
83-
LOGGER.debug(
84-
"committing exception probe id={}, snapshot id={}, exception id={}",
85-
id,
86-
snapshotId,
87-
snapshot.getExceptionId());
88-
83+
LOGGER.debug("committing code origin probe id={}, snapshot id={}", id, snapshotId);
8984
commitSnapshot(snapshot, DebuggerAgent.getSink());
9085
}
9186
}
9287
applySpanOriginTags(span, snapshotId);
88+
DebuggerAgent.getSink().getProbeStatusSink().addEmitting(probeId);
9389
}
9490

9591
private void applySpanOriginTags(AgentSpan span, String snapshotId) {
@@ -151,7 +147,7 @@ public void buildLocation(InstrumentationResult result) {
151147
type = result.getTypeName();
152148
method = result.getMethodName();
153149
}
154-
// drop line number for exception probe
150+
// drop line number for code origin probe
155151
this.location = new ProbeLocation(type, method, where.getSourceFile(), null);
156152
}
157153

dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/probe/DebuggerProbeTest.java

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)