-
Notifications
You must be signed in to change notification settings - Fork 304
Implement the DebuggerProbe #7588
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9b6cc13
Implement the DebuggerProbe
evanchooly 8cd4b40
WIP
evanchooly 87d0a4b
some tidying, fixing of json structures
evanchooly 0026f35
exit spans should not be tagged
evanchooly 2de3ffb
Merge branch 'master' into evanchooly/DEBUG-2719
evanchooly 13c8c9f
PR cleanups
evanchooly 4024d8a
fix the location of exit span stack traces
evanchooly fa4af98
fixes for exit spans
evanchooly de6b0c4
rename a constant
evanchooly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.