-
Notifications
You must be signed in to change notification settings - Fork 324
Write base hash to current span when injected in DBM comment #10450
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
base: master
Are you sure you want to change the base?
Conversation
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b8fab5d78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
...src/main/java/datadog/trace/instrumentation/jdbc/DBMCompatibleConnectionInstrumentation.java
Outdated
Show resolved
Hide resolved
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 67 metrics, 4 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~b01fb29af0, baseline=1.59.0-SNAPSHOT~a34cb643aa
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.091 s) : 0, 1091218
Total [baseline] (10.76 s) : 0, 10759957
Agent [candidate] (1.099 s) : 0, 1099071
Total [candidate] (10.777 s) : 0, 10777243
section appsec
Agent [baseline] (1.277 s) : 0, 1276781
Total [baseline] (11.168 s) : 0, 11168023
Agent [candidate] (1.273 s) : 0, 1272912
Total [candidate] (11.035 s) : 0, 11035260
section iast
Agent [baseline] (1.24 s) : 0, 1240363
Total [baseline] (11.209 s) : 0, 11208917
Agent [candidate] (1.23 s) : 0, 1229539
Total [candidate] (11.025 s) : 0, 11024960
section profiling
Agent [baseline] (1.217 s) : 0, 1217440
Total [baseline] (10.956 s) : 0, 10955849
Agent [candidate] (1.211 s) : 0, 1211338
Total [candidate] (11.009 s) : 0, 11008902
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~b01fb29af0, baseline=1.59.0-SNAPSHOT~a34cb643aa
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.169 ms) : 0, 1169
crashtracking [candidate] (1.184 ms) : 0, 1184
BytebuddyAgent [baseline] (653.725 ms) : 0, 653725
BytebuddyAgent [candidate] (658.561 ms) : 0, 658561
AgentMeter [baseline] (29.083 ms) : 0, 29083
AgentMeter [candidate] (29.382 ms) : 0, 29382
GlobalTracer [baseline] (257.611 ms) : 0, 257611
GlobalTracer [candidate] (259.12 ms) : 0, 259120
AppSec [baseline] (32.626 ms) : 0, 32626
AppSec [candidate] (33.194 ms) : 0, 33194
Debugger [baseline] (68.297 ms) : 0, 68297
Debugger [candidate] (68.714 ms) : 0, 68714
Remote Config [baseline] (623.11 µs) : 0, 623
Remote Config [candidate] (621.269 µs) : 0, 621
Telemetry [baseline] (9.003 ms) : 0, 9003
Telemetry [candidate] (9.076 ms) : 0, 9076
Flare Poller [baseline] (3.658 ms) : 0, 3658
Flare Poller [candidate] (3.643 ms) : 0, 3643
section appsec
crashtracking [baseline] (1.175 ms) : 0, 1175
crashtracking [candidate] (1.175 ms) : 0, 1175
BytebuddyAgent [baseline] (695.189 ms) : 0, 695189
BytebuddyAgent [candidate] (693.911 ms) : 0, 693911
AgentMeter [baseline] (12.007 ms) : 0, 12007
AgentMeter [candidate] (11.956 ms) : 0, 11956
GlobalTracer [baseline] (251.793 ms) : 0, 251793
GlobalTracer [candidate] (251.126 ms) : 0, 251126
IAST [baseline] (24.668 ms) : 0, 24668
IAST [candidate] (24.556 ms) : 0, 24556
AppSec [baseline] (173.569 ms) : 0, 173569
AppSec [candidate] (173.84 ms) : 0, 173840
Debugger [baseline] (69.065 ms) : 0, 69065
Debugger [candidate] (67.028 ms) : 0, 67028
Remote Config [baseline] (707.574 µs) : 0, 708
Remote Config [candidate] (699.254 µs) : 0, 699
Telemetry [baseline] (9.447 ms) : 0, 9447
Telemetry [candidate] (9.54 ms) : 0, 9540
Flare Poller [baseline] (3.605 ms) : 0, 3605
Flare Poller [candidate] (3.616 ms) : 0, 3616
section iast
crashtracking [baseline] (1.185 ms) : 0, 1185
crashtracking [candidate] (1.177 ms) : 0, 1177
BytebuddyAgent [baseline] (801.074 ms) : 0, 801074
BytebuddyAgent [candidate] (794.292 ms) : 0, 794292
AgentMeter [baseline] (11.579 ms) : 0, 11579
AgentMeter [candidate] (11.308 ms) : 0, 11308
GlobalTracer [baseline] (249.673 ms) : 0, 249673
GlobalTracer [candidate] (247.85 ms) : 0, 247850
IAST [baseline] (27.084 ms) : 0, 27084
IAST [candidate] (26.65 ms) : 0, 26650
AppSec [baseline] (34.243 ms) : 0, 34243
AppSec [candidate] (33.571 ms) : 0, 33571
Debugger [baseline] (67.241 ms) : 0, 67241
Debugger [candidate] (66.87 ms) : 0, 66870
Remote Config [baseline] (544.654 µs) : 0, 545
Remote Config [candidate] (532.12 µs) : 0, 532
Telemetry [baseline] (8.693 ms) : 0, 8693
Telemetry [candidate] (8.524 ms) : 0, 8524
Flare Poller [baseline] (3.494 ms) : 0, 3494
Flare Poller [candidate] (3.42 ms) : 0, 3420
section profiling
crashtracking [baseline] (1.219 ms) : 0, 1219
crashtracking [candidate] (1.211 ms) : 0, 1211
BytebuddyAgent [baseline] (709.545 ms) : 0, 709545
BytebuddyAgent [candidate] (705.105 ms) : 0, 705105
AgentMeter [baseline] (8.886 ms) : 0, 8886
AgentMeter [candidate] (8.869 ms) : 0, 8869
GlobalTracer [baseline] (216.844 ms) : 0, 216844
GlobalTracer [candidate] (216.233 ms) : 0, 216233
AppSec [baseline] (32.689 ms) : 0, 32689
AppSec [candidate] (32.411 ms) : 0, 32411
Debugger [baseline] (67.354 ms) : 0, 67354
Debugger [candidate] (67.282 ms) : 0, 67282
Remote Config [baseline] (611.838 µs) : 0, 612
Remote Config [candidate] (596.001 µs) : 0, 596
Telemetry [baseline] (8.73 ms) : 0, 8730
Telemetry [candidate] (8.861 ms) : 0, 8861
Flare Poller [baseline] (9.208 ms) : 0, 9208
Flare Poller [candidate] (9.307 ms) : 0, 9307
ProfilingAgent [baseline] (92.094 ms) : 0, 92094
ProfilingAgent [candidate] (91.635 ms) : 0, 91635
Profiling [baseline] (92.678 ms) : 0, 92678
Profiling [candidate] (92.229 ms) : 0, 92229
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~b01fb29af0, baseline=1.59.0-SNAPSHOT~a34cb643aa
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.091 s) : 0, 1091324
Total [baseline] (8.767 s) : 0, 8766896
Agent [candidate] (1.099 s) : 0, 1099174
Total [candidate] (8.801 s) : 0, 8800854
section iast
Agent [baseline] (1.232 s) : 0, 1231531
Total [baseline] (9.351 s) : 0, 9350867
Agent [candidate] (1.248 s) : 0, 1247837
Total [candidate] (9.462 s) : 0, 9461641
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~b01fb29af0, baseline=1.59.0-SNAPSHOT~a34cb643aa
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (653.853 ms) : 0, 653853
BytebuddyAgent [candidate] (659.512 ms) : 0, 659512
AgentMeter [baseline] (29.081 ms) : 0, 29081
AgentMeter [candidate] (29.267 ms) : 0, 29267
GlobalTracer [baseline] (257.934 ms) : 0, 257934
GlobalTracer [candidate] (259.441 ms) : 0, 259441
AppSec [baseline] (32.93 ms) : 0, 32930
AppSec [candidate] (33.151 ms) : 0, 33151
Debugger [baseline] (67.592 ms) : 0, 67592
Debugger [candidate] (67.548 ms) : 0, 67548
Remote Config [baseline] (616.545 µs) : 0, 617
Remote Config [candidate] (621.498 µs) : 0, 621
Telemetry [baseline] (9.002 ms) : 0, 9002
Telemetry [candidate] (9.072 ms) : 0, 9072
Flare Poller [baseline] (3.633 ms) : 0, 3633
Flare Poller [candidate] (3.694 ms) : 0, 3694
section iast
crashtracking [baseline] (1.18 ms) : 0, 1180
crashtracking [candidate] (1.196 ms) : 0, 1196
BytebuddyAgent [baseline] (795.65 ms) : 0, 795650
BytebuddyAgent [candidate] (805.014 ms) : 0, 805014
AgentMeter [baseline] (11.277 ms) : 0, 11277
AgentMeter [candidate] (11.681 ms) : 0, 11681
GlobalTracer [baseline] (247.972 ms) : 0, 247972
GlobalTracer [candidate] (252.405 ms) : 0, 252405
AppSec [baseline] (33.532 ms) : 0, 33532
AppSec [candidate] (31.747 ms) : 0, 31747
Debugger [baseline] (67.186 ms) : 0, 67186
Debugger [candidate] (70.055 ms) : 0, 70055
Remote Config [baseline] (540.196 µs) : 0, 540
Remote Config [candidate] (554.371 µs) : 0, 554
Telemetry [baseline] (8.597 ms) : 0, 8597
Telemetry [candidate] (8.619 ms) : 0, 8619
Flare Poller [baseline] (3.485 ms) : 0, 3485
Flare Poller [candidate] (3.481 ms) : 0, 3481
IAST [baseline] (26.863 ms) : 0, 26863
IAST [candidate] (27.532 ms) : 0, 27532
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 19 metrics, 15 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~b01fb29af0, baseline=1.59.0-SNAPSHOT~a34cb643aa
dateFormat X
axisFormat %s
section baseline
no_agent (18.91 ms) : 18721, 19100
. : milestone, 18910,
appsec (18.601 ms) : 18411, 18790
. : milestone, 18601,
code_origins (17.769 ms) : 17593, 17945
. : milestone, 17769,
iast (17.618 ms) : 17445, 17791
. : milestone, 17618,
profiling (19.475 ms) : 19280, 19670
. : milestone, 19475,
tracing (18.779 ms) : 18589, 18969
. : milestone, 18779,
section candidate
no_agent (18.976 ms) : 18786, 19166
. : milestone, 18976,
appsec (18.333 ms) : 18150, 18515
. : milestone, 18333,
code_origins (17.831 ms) : 17655, 18007
. : milestone, 17831,
iast (17.756 ms) : 17579, 17932
. : milestone, 17756,
profiling (18.496 ms) : 18311, 18682
. : milestone, 18496,
tracing (17.516 ms) : 17338, 17694
. : milestone, 17516,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~b01fb29af0, baseline=1.59.0-SNAPSHOT~a34cb643aa
dateFormat X
axisFormat %s
section baseline
no_agent (1.172 ms) : 1161, 1184
. : milestone, 1172,
iast (3.258 ms) : 3217, 3299
. : milestone, 3258,
iast_FULL (5.765 ms) : 5707, 5822
. : milestone, 5765,
iast_GLOBAL (3.628 ms) : 3576, 3681
. : milestone, 3628,
profiling (2.122 ms) : 2103, 2141
. : milestone, 2122,
tracing (1.787 ms) : 1771, 1802
. : milestone, 1787,
section candidate
no_agent (1.186 ms) : 1175, 1198
. : milestone, 1186,
iast (3.199 ms) : 3157, 3240
. : milestone, 3199,
iast_FULL (5.741 ms) : 5684, 5798
. : milestone, 5741,
iast_GLOBAL (3.623 ms) : 3565, 3682
. : milestone, 3623,
profiling (2.018 ms) : 2000, 2036
. : milestone, 2018,
tracing (1.796 ms) : 1780, 1811
. : milestone, 1796,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~b01fb29af0, baseline=1.59.0-SNAPSHOT~a34cb643aa
dateFormat X
axisFormat %s
section baseline
no_agent (1.477 ms) : 1465, 1488
. : milestone, 1477,
appsec (3.707 ms) : 3488, 3926
. : milestone, 3707,
iast (2.239 ms) : 2171, 2308
. : milestone, 2239,
iast_GLOBAL (2.291 ms) : 2222, 2360
. : milestone, 2291,
profiling (2.108 ms) : 2050, 2166
. : milestone, 2108,
tracing (2.085 ms) : 2030, 2140
. : milestone, 2085,
section candidate
no_agent (1.472 ms) : 1460, 1483
. : milestone, 1472,
appsec (3.744 ms) : 3524, 3964
. : milestone, 3744,
iast (2.247 ms) : 2179, 2316
. : milestone, 2247,
iast_GLOBAL (2.292 ms) : 2223, 2361
. : milestone, 2292,
profiling (2.078 ms) : 2023, 2134
. : milestone, 2078,
tracing (2.058 ms) : 2004, 2113
. : milestone, 2058,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~b01fb29af0, baseline=1.59.0-SNAPSHOT~a34cb643aa
dateFormat X
axisFormat %s
section baseline
no_agent (15.337 s) : 15337000, 15337000
. : milestone, 15337000,
appsec (15.07 s) : 15070000, 15070000
. : milestone, 15070000,
iast (17.917 s) : 17917000, 17917000
. : milestone, 17917000,
iast_GLOBAL (18.209 s) : 18209000, 18209000
. : milestone, 18209000,
profiling (15.572 s) : 15572000, 15572000
. : milestone, 15572000,
tracing (14.796 s) : 14796000, 14796000
. : milestone, 14796000,
section candidate
no_agent (14.936 s) : 14936000, 14936000
. : milestone, 14936000,
appsec (14.679 s) : 14679000, 14679000
. : milestone, 14679000,
iast (17.977 s) : 17977000, 17977000
. : milestone, 17977000,
iast_GLOBAL (17.887 s) : 17887000, 17887000
. : milestone, 17887000,
profiling (15.033 s) : 15033000, 15033000
. : milestone, 15033000,
tracing (14.637 s) : 14637000, 14637000
. : milestone, 14637000,
|
What Does This Do
The base hash is injected into the DBM comment here:
dd-trace-java/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenter.java
Lines 65 to 67 in cce064e
but to be able to do anything with it, we need to tag spans with it too, so that in the backend, spans can be queried with this hash, allowing to recover the actual values that were used to build the hash from the spans' tags (which are then used to tag the SQL query)
Motivation
without that tag on the spans, the injected hash is useless
Additional Notes
RFC (that was updated since the initial Java implem) : https://docs.google.com/document/d/15GtNOKGBCt6Dc-HsDNnMmCdZwhewFQx8yUlI9in5n3M
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]