-
Notifications
You must be signed in to change notification settings - Fork 323
Add support for DBM comment injection with MongoDB #9589
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
Conversation
This comment has been minimized.
This comment has been minimized.
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 53 metrics, 12 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.55.0-SNAPSHOT~5ffb54eb18, baseline=1.57.0-SNAPSHOT~dda618e90d
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.08 s) : 0, 1079503
Total [baseline] (10.832 s) : 0, 10831685
Agent [candidate] (1.08 s) : 0, 1080213
Total [candidate] (10.783 s) : 0, 10783039
section appsec
Agent [baseline] (1.27 s) : 0, 1270417
Total [baseline] (11.072 s) : 0, 11071625
Agent [candidate] (1.266 s) : 0, 1265653
Total [candidate] (10.991 s) : 0, 10990784
section iast
Agent [baseline] (1.221 s) : 0, 1221070
Total [baseline] (11.167 s) : 0, 11167449
Agent [candidate] (1.225 s) : 0, 1225357
Total [candidate] (11.312 s) : 0, 11311585
section profiling
Agent [baseline] (1.211 s) : 0, 1211052
Total [baseline] (11.036 s) : 0, 11036056
Agent [candidate] (1.203 s) : 0, 1203009
Total [candidate] (10.966 s) : 0, 10966380
gantt
title petclinic - break down per module: candidate=1.55.0-SNAPSHOT~5ffb54eb18, baseline=1.57.0-SNAPSHOT~dda618e90d
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.184 ms) : 0, 1184
crashtracking [candidate] (1.181 ms) : 0, 1181
BytebuddyAgent [baseline] (647.152 ms) : 0, 647152
BytebuddyAgent [candidate] (647.309 ms) : 0, 647309
GlobalTracer [baseline] (282.36 ms) : 0, 282360
GlobalTracer [candidate] (282.649 ms) : 0, 282649
AppSec [baseline] (32.147 ms) : 0, 32147
AppSec [candidate] (32.242 ms) : 0, 32242
Debugger [baseline] (67.795 ms) : 0, 67795
Debugger [candidate] (68.012 ms) : 0, 68012
Remote Config [baseline] (632.34 µs) : 0, 632
Remote Config [candidate] (634.671 µs) : 0, 635
Telemetry [baseline] (9.005 ms) : 0, 9005
Telemetry [candidate] (9.011 ms) : 0, 9011
Flare Poller [baseline] (3.727 ms) : 0, 3727
Flare Poller [candidate] (3.762 ms) : 0, 3762
section appsec
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.181 ms) : 0, 1181
BytebuddyAgent [baseline] (693.084 ms) : 0, 693084
BytebuddyAgent [candidate] (688.742 ms) : 0, 688742
GlobalTracer [baseline] (259.998 ms) : 0, 259998
GlobalTracer [candidate] (258.544 ms) : 0, 258544
AppSec [baseline] (174.374 ms) : 0, 174374
AppSec [candidate] (174.259 ms) : 0, 174259
Debugger [baseline] (67.749 ms) : 0, 67749
Debugger [candidate] (69.021 ms) : 0, 69021
Remote Config [baseline] (691.995 µs) : 0, 692
Remote Config [candidate] (728.786 µs) : 0, 729
Telemetry [baseline] (8.947 ms) : 0, 8947
Telemetry [candidate] (8.942 ms) : 0, 8942
Flare Poller [baseline] (3.863 ms) : 0, 3863
Flare Poller [candidate] (3.914 ms) : 0, 3914
IAST [baseline] (24.861 ms) : 0, 24861
IAST [candidate] (24.82 ms) : 0, 24820
section iast
crashtracking [baseline] (1.179 ms) : 0, 1179
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (788.976 ms) : 0, 788976
BytebuddyAgent [candidate] (790.749 ms) : 0, 790749
GlobalTracer [baseline] (255.143 ms) : 0, 255143
GlobalTracer [candidate] (256.962 ms) : 0, 256962
AppSec [baseline] (31.9 ms) : 0, 31900
AppSec [candidate] (33.636 ms) : 0, 33636
Debugger [baseline] (68.955 ms) : 0, 68955
Debugger [candidate] (67.596 ms) : 0, 67596
Remote Config [baseline] (576.394 µs) : 0, 576
Remote Config [candidate] (598.935 µs) : 0, 599
Telemetry [baseline] (8.44 ms) : 0, 8440
Telemetry [candidate] (8.585 ms) : 0, 8585
Flare Poller [baseline] (3.507 ms) : 0, 3507
Flare Poller [candidate] (3.514 ms) : 0, 3514
IAST [baseline] (26.956 ms) : 0, 26956
IAST [candidate] (27.139 ms) : 0, 27139
section profiling
ProfilingAgent [baseline] (98.992 ms) : 0, 98992
ProfilingAgent [candidate] (97.397 ms) : 0, 97397
crashtracking [baseline] (1.217 ms) : 0, 1217
crashtracking [candidate] (1.21 ms) : 0, 1210
BytebuddyAgent [baseline] (703.001 ms) : 0, 703001
BytebuddyAgent [candidate] (700.669 ms) : 0, 700669
GlobalTracer [baseline] (222.965 ms) : 0, 222965
GlobalTracer [candidate] (220.861 ms) : 0, 220861
AppSec [baseline] (32.82 ms) : 0, 32820
AppSec [candidate] (31.877 ms) : 0, 31877
Debugger [baseline] (68.875 ms) : 0, 68875
Debugger [candidate] (68.014 ms) : 0, 68014
Remote Config [baseline] (651.876 µs) : 0, 652
Remote Config [candidate] (616.361 µs) : 0, 616
Telemetry [baseline] (8.996 ms) : 0, 8996
Telemetry [candidate] (9.024 ms) : 0, 9024
Flare Poller [baseline] (3.76 ms) : 0, 3760
Flare Poller [candidate] (3.781 ms) : 0, 3781
Profiling [baseline] (99.588 ms) : 0, 99588
Profiling [candidate] (97.969 ms) : 0, 97969
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.55.0-SNAPSHOT~5ffb54eb18, baseline=1.57.0-SNAPSHOT~dda618e90d
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.085 s) : 0, 1085379
Total [baseline] (8.749 s) : 0, 8748777
Agent [candidate] (1.08 s) : 0, 1079740
Total [candidate] (8.742 s) : 0, 8742031
section iast
Agent [baseline] (1.219 s) : 0, 1219084
Total [baseline] (9.376 s) : 0, 9376250
Agent [candidate] (1.223 s) : 0, 1223263
Total [candidate] (9.425 s) : 0, 9425445
gantt
title insecure-bank - break down per module: candidate=1.55.0-SNAPSHOT~5ffb54eb18, baseline=1.57.0-SNAPSHOT~dda618e90d
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.196 ms) : 0, 1196
crashtracking [candidate] (1.184 ms) : 0, 1184
BytebuddyAgent [baseline] (651.581 ms) : 0, 651581
BytebuddyAgent [candidate] (647.719 ms) : 0, 647719
GlobalTracer [baseline] (283.025 ms) : 0, 283025
GlobalTracer [candidate] (282.203 ms) : 0, 282203
AppSec [baseline] (32.613 ms) : 0, 32613
AppSec [candidate] (32.403 ms) : 0, 32403
Debugger [baseline] (67.843 ms) : 0, 67843
Debugger [candidate] (66.707 ms) : 0, 66707
Remote Config [baseline] (652.233 µs) : 0, 652
Remote Config [candidate] (614.688 µs) : 0, 615
Telemetry [baseline] (9.0 ms) : 0, 9000
Telemetry [candidate] (9.809 ms) : 0, 9809
Flare Poller [baseline] (3.797 ms) : 0, 3797
Flare Poller [candidate] (3.742 ms) : 0, 3742
section iast
crashtracking [baseline] (1.199 ms) : 0, 1199
crashtracking [candidate] (1.194 ms) : 0, 1194
BytebuddyAgent [baseline] (787.749 ms) : 0, 787749
BytebuddyAgent [candidate] (790.448 ms) : 0, 790448
GlobalTracer [baseline] (255.486 ms) : 0, 255486
GlobalTracer [candidate] (256.382 ms) : 0, 256382
AppSec [baseline] (33.661 ms) : 0, 33661
AppSec [candidate] (31.111 ms) : 0, 31111
Debugger [baseline] (66.164 ms) : 0, 66164
Debugger [candidate] (69.07 ms) : 0, 69070
Remote Config [baseline] (595.108 µs) : 0, 595
Remote Config [candidate] (607.049 µs) : 0, 607
Telemetry [baseline] (8.41 ms) : 0, 8410
Telemetry [candidate] (8.468 ms) : 0, 8468
Flare Poller [baseline] (3.514 ms) : 0, 3514
Flare Poller [candidate] (3.48 ms) : 0, 3480
IAST [baseline] (26.935 ms) : 0, 26935
IAST [candidate] (27.025 ms) : 0, 27025
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 18 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~5ffb54eb18, baseline=1.57.0-SNAPSHOT~dda618e90d
dateFormat X
axisFormat %s
section baseline
no_agent (1.158 ms) : 1147, 1169
. : milestone, 1158,
iast (3.23 ms) : 3186, 3274
. : milestone, 3230,
iast_FULL (5.656 ms) : 5600, 5712
. : milestone, 5656,
iast_GLOBAL (3.657 ms) : 3602, 3713
. : milestone, 3657,
profiling (2.08 ms) : 2061, 2099
. : milestone, 2080,
tracing (1.787 ms) : 1771, 1804
. : milestone, 1787,
section candidate
no_agent (1.201 ms) : 1189, 1213
. : milestone, 1201,
iast (3.117 ms) : 3080, 3155
. : milestone, 3117,
iast_FULL (5.817 ms) : 5757, 5876
. : milestone, 5817,
iast_GLOBAL (3.644 ms) : 3585, 3702
. : milestone, 3644,
profiling (1.943 ms) : 1926, 1960
. : milestone, 1943,
tracing (1.781 ms) : 1766, 1795
. : milestone, 1781,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~5ffb54eb18, baseline=1.57.0-SNAPSHOT~dda618e90d
dateFormat X
axisFormat %s
section baseline
no_agent (17.191 ms) : 17023, 17359
. : milestone, 17191,
appsec (18.861 ms) : 18671, 19051
. : milestone, 18861,
code_origins (17.627 ms) : 17450, 17803
. : milestone, 17627,
iast (17.684 ms) : 17511, 17858
. : milestone, 17684,
profiling (18.714 ms) : 18528, 18900
. : milestone, 18714,
tracing (17.59 ms) : 17415, 17765
. : milestone, 17590,
section candidate
no_agent (19.567 ms) : 19364, 19770
. : milestone, 19567,
appsec (18.431 ms) : 18244, 18619
. : milestone, 18431,
code_origins (18.044 ms) : 17861, 18227
. : milestone, 18044,
iast (18.027 ms) : 17843, 18210
. : milestone, 18027,
profiling (18.479 ms) : 18296, 18662
. : milestone, 18479,
tracing (17.995 ms) : 17816, 18174
. : milestone, 17995,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 1 unstable metrics.
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~5ffb54eb18, baseline=1.57.0-SNAPSHOT~dda618e90d
dateFormat X
axisFormat %s
section baseline
no_agent (1.477 ms) : 1466, 1489
. : milestone, 1477,
appsec (3.657 ms) : 3441, 3873
. : milestone, 3657,
iast (2.208 ms) : 2144, 2273
. : milestone, 2208,
iast_GLOBAL (2.252 ms) : 2187, 2317
. : milestone, 2252,
profiling (2.095 ms) : 2041, 2149
. : milestone, 2095,
tracing (2.045 ms) : 1994, 2096
. : milestone, 2045,
section candidate
no_agent (1.479 ms) : 1468, 1491
. : milestone, 1479,
appsec (2.456 ms) : 2404, 2507
. : milestone, 2456,
iast (2.206 ms) : 2141, 2271
. : milestone, 2206,
iast_GLOBAL (2.26 ms) : 2195, 2325
. : milestone, 2260,
profiling (2.484 ms) : 2322, 2646
. : milestone, 2484,
tracing (2.05 ms) : 1999, 2100
. : milestone, 2050,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~5ffb54eb18, baseline=1.57.0-SNAPSHOT~dda618e90d
dateFormat X
axisFormat %s
section baseline
no_agent (15.313 s) : 15313000, 15313000
. : milestone, 15313000,
appsec (14.57 s) : 14570000, 14570000
. : milestone, 14570000,
iast (18.451 s) : 18451000, 18451000
. : milestone, 18451000,
iast_GLOBAL (17.916 s) : 17916000, 17916000
. : milestone, 17916000,
profiling (14.673 s) : 14673000, 14673000
. : milestone, 14673000,
tracing (14.898 s) : 14898000, 14898000
. : milestone, 14898000,
section candidate
no_agent (15.694 s) : 15694000, 15694000
. : milestone, 15694000,
appsec (14.923 s) : 14923000, 14923000
. : milestone, 14923000,
iast (18.153 s) : 18153000, 18153000
. : milestone, 18153000,
iast_GLOBAL (18.104 s) : 18104000, 18104000
. : milestone, 18104000,
profiling (14.704 s) : 14704000, 14704000
. : milestone, 14704000,
tracing (14.748 s) : 14748000, 14748000
. : milestone, 14748000,
|
...gent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/SQLCommenter.java
Show resolved
Hide resolved
...gent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/SQLCommenter.java
Show resolved
Hide resolved
...ion/mongo/common/src/main/java/datadog/trace/instrumentation/mongo/MongoCommentInjector.java
Outdated
Show resolved
Hide resolved
...ion/mongo/common/src/main/java/datadog/trace/instrumentation/mongo/MongoCommentInjector.java
Outdated
Show resolved
Hide resolved
22aab0a to
631958f
Compare
...e-tests/appsec/src/main/groovy/datadog/smoketest/appsec/AbstractAppSecServerSmokeTest.groovy
Outdated
Show resolved
Hide resolved
...src/main/java/datadog/trace/instrumentation/jdbc/DBMCompatibleConnectionInstrumentation.java
Outdated
Show resolved
Hide resolved
...ion/mongo/common/src/main/java/datadog/trace/instrumentation/mongo/MongoCommentInjector.java
Outdated
Show resolved
Hide resolved
72e2fae to
18ebfd2
Compare
…ries Write queries on the MongoDB driver >= 4.0 and <= 4.7 weren't correctly instrumented. I didn't notice it before because the tests weren't exhaustive, and my test app was using driver v5.6.
80a07db to
9da2307
Compare
vandonr
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.
still a bit uneasy about adding stuff under the comment key if it already contains something (i.e. user data), but otherwise lgtm
In the end, the instrumentation only works on driver > 3.6, so we decided to make a standalone package for that. This version being 9 years old seems to be enough for DBM support
… to run on driver > 4.0 only
We now have two instrumentations: one for 3.6 to 3.7, and another one for 3.8 to 5.6
PerfectSlayer
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.
Approving for the LP part. Sorry for the delay, I thought one approval was enough to get it unblock 🙇
What Does This Do
Addind support for injecting trace info in
mongospans, which is used by DBM. This PR mirrors the logic that was added in dd-trace-py.Motivation
Additional Notes
SQLCommenterlogic was mostly moved toSharedDBCommenterto share it with the newMongoCommentInjector, and now focuses on adding/*+*/, which Mongo does not needTo-do
SharedDBCommenterfrom JDBC instrumentation to dd-trace-core (to fix pipeline, but also because Mongo logic should not depend on JDBC)Contributor Checklist
type:and (comp:orinst:) labels in addition to any usefull labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]