-
Notifications
You must be signed in to change notification settings - Fork 318
[IAST] Call Site Instrumentation support #3706
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
[IAST] Call Site Instrumentation support #3706
Conversation
1ff7c7a to
14e0381
Compare
14e0381 to
abe78a6
Compare
abe78a6 to
c0fa4cc
Compare
7c6708e to
3c7a72a
Compare
3c7a72a to
093220c
Compare
buildSrc/src/main/java/datadog/trace/plugin/csi/impl/AsmSpecificationBuilder.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/datadog/trace/plugin/csi/AdviceGenerator.java
Outdated
Show resolved
Hide resolved
fc95339 to
6213929
Compare
6213929 to
80f3fab
Compare
9826dc7 to
ba0d10f
Compare
ea531af to
8afa126
Compare
8afa126 to
7021e24
Compare
bantonsson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR!
There is only one thing that I think needs fixing in some way before merging.
I was a bit confused by the benchmarks, and it feels very counter intuitive that there should be any performance difference between callSite and callee in this case, so I had to poke at them a bit, and the response differs. The callSite one gets back Hello! [Transformed] and the callee one gets back Hello! [Transformed] [Transformed]. So we're not comparing the same things.
...ava-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/csi/Advices.java
Outdated
Show resolved
Hide resolved
...nt-tooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/csi/CallSiteInstrumenter.java
Show resolved
Hide resolved
@bantonsson, first of all thanks for the feedback 😃, much appreciated! My idea with the benchmark is to validate that doing call site instrumentation is feasible in terms of startup time as long as there's a proper exclusion list. In this particular case I wanted to showcase the instrumentation of Let me know if I should do something else about it. |
What Does This Do
This PR contains the basics to do Call Site Instrumentation in the tracer. It defines a new type of instrumenter
datadog.trace.agent.tooling.bytebuddy.csi.CallSiteInstrumenterthat is able to register instances ofdatadog.trace.agent.tooling.csi.CallSiteAdviceto perform the instrumentation via ASM.Motivation
Instrumentations related to IAST often affect core parts of the JDK (String, StringBuilder...) where using callee instrumentation (by default in ByteBuddy) is not good enough for performance. Call site instrumentation focuses on the calls to the instrumented methods enabling the use of inclusion/exclusion lists to fine tune where to instrument.
Additional Notes
Following this PR comes [IAST] Call Site Instrumentation plugin #3729 where advices can be autogenerated by a gradle plugin. It also showcases an example on how to use CSI in the tracer.
Benchmark results
The main goal of this results are to validate that call site instrumentation is feasible in terms of startup time of an application: