-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the DebuggerProbe. [DEBUG-2719] Update code origin tags [DEBUG-2722]
- Loading branch information
1 parent
efc6f52
commit 4abf841
Showing
45 changed files
with
1,287 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
...p/debugger/spanorigin/SpanOriginInfo.java → ...p/debugger/spanorigin/CodeOriginInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
package datadog.trace.bootstrap.debugger.spanorigin; | ||
|
||
import static datadog.trace.bootstrap.debugger.DebuggerContext.captureSnapshot; | ||
import static datadog.trace.bootstrap.debugger.DebuggerContext.captureCodeOrigin; | ||
import static java.util.Arrays.stream; | ||
|
||
import datadog.trace.api.InstrumenterConfig; | ||
import datadog.trace.bootstrap.instrumentation.api.AgentSpan; | ||
import java.lang.reflect.Method; | ||
import java.util.stream.Collectors; | ||
|
||
public class SpanOriginInfo { | ||
public static void entry(AgentSpan span, Method method) { | ||
if (InstrumenterConfig.get().isSpanOriginEnabled()) { | ||
public class CodeOriginInfo { | ||
public static void entry(Method method) { | ||
if (InstrumenterConfig.get().isCodeOriginEnabled()) { | ||
String signature = | ||
stream(method.getParameterTypes()) | ||
.map(Class::getName) | ||
.collect(Collectors.joining(",", "(", ")")); | ||
captureSnapshot(signature); | ||
captureCodeOrigin(signature); | ||
} | ||
} | ||
|
||
public static void exit(AgentSpan span) { | ||
if (InstrumenterConfig.get().isSpanOriginEnabled()) { | ||
span.getLocalRootSpan().setMetaStruct(captureSnapshot(null), span); | ||
if (InstrumenterConfig.get().isCodeOriginEnabled()) { | ||
String probeId = captureCodeOrigin(null); | ||
if (span != null) { | ||
span.getLocalRootSpan().setTag(probeId, span); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.