Skip to content
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

Add host and db name to tags injected in SQL comments #6778

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

vandonr
Copy link
Contributor

@vandonr vandonr commented Mar 6, 2024

What Does This Do

add more info to what's currently injected in SQL queries (via comments)

Motivation

https://datadoghq.atlassian.net/browse/AIT-9564

Additional Notes

Jira ticket: AIT-9564

same feature in other tracers:
DataDog/dd-trace-go#2550
DataDog/dd-trace-py#8286

@pr-commenter
Copy link

pr-commenter bot commented Mar 6, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master vandonr/payload
git_commit_date 1709707671 1709722064
git_commit_sha 02d3cb7 20b0e74
release_version 1.32.0-SNAPSHOT~02d3cb7aac 1.32.0-SNAPSHOT~20b0e74284
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1709725214 1709725214
ci_job_id 452179554 452179554
ci_pipeline_id 29597070 29597070
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 15 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.32.0-SNAPSHOT~20b0e74284, baseline=1.32.0-SNAPSHOT~02d3cb7aac

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.081 s) : 0, 1081070
Total [baseline] (8.566 s) : 0, 8565516
Agent [candidate] (1.09 s) : 0, 1089596
Total [candidate] (8.59 s) : 0, 8590269
section iast
Agent [baseline] (1.207 s) : 0, 1207360
Total [baseline] (9.04 s) : 0, 9040245
Agent [candidate] (1.212 s) : 0, 1211994
Total [candidate] (9.074 s) : 0, 9073603
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.216 s) : 0, 1215846
Total [baseline] (9.026 s) : 0, 9026241
Agent [candidate] (1.216 s) : 0, 1215899
Total [candidate] (9.018 s) : 0, 9018482
section iast_TELEMETRY_OFF
Agent [baseline] (1.21 s) : 0, 1210311
Total [baseline] (9.058 s) : 0, 9058479
Agent [candidate] (1.208 s) : 0, 1207922
Total [candidate] (9.038 s) : 0, 9037610
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.081 s -
Agent iast 1.207 s 126.29 ms (11.7%)
Agent iast_HARDCODED_SECRET_DISABLED 1.216 s 134.776 ms (12.5%)
Agent iast_TELEMETRY_OFF 1.21 s 129.241 ms (12.0%)
Total tracing 8.566 s -
Total iast 9.04 s 474.729 ms (5.5%)
Total iast_HARDCODED_SECRET_DISABLED 9.026 s 460.725 ms (5.4%)
Total iast_TELEMETRY_OFF 9.058 s 492.963 ms (5.8%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.09 s -
Agent iast 1.212 s 122.398 ms (11.2%)
Agent iast_HARDCODED_SECRET_DISABLED 1.216 s 126.303 ms (11.6%)
Agent iast_TELEMETRY_OFF 1.208 s 118.326 ms (10.9%)
Total tracing 8.59 s -
Total iast 9.074 s 483.333 ms (5.6%)
Total iast_HARDCODED_SECRET_DISABLED 9.018 s 428.213 ms (5.0%)
Total iast_TELEMETRY_OFF 9.038 s 447.34 ms (5.2%)
gantt
    title insecure-bank - break down per module: candidate=1.32.0-SNAPSHOT~20b0e74284, baseline=1.32.0-SNAPSHOT~02d3cb7aac

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (696.61 ms) : 0, 696610
BytebuddyAgent [candidate] (701.682 ms) : 0, 701682
GlobalTracer [baseline] (291.141 ms) : 0, 291141
GlobalTracer [candidate] (293.591 ms) : 0, 293591
AppSec [baseline] (50.536 ms) : 0, 50536
AppSec [candidate] (51.321 ms) : 0, 51321
Remote Config [baseline] (733.304 µs) : 0, 733
Remote Config [candidate] (740.496 µs) : 0, 740
Telemetry [baseline] (7.697 ms) : 0, 7697
Telemetry [candidate] (7.77 ms) : 0, 7770
section iast
BytebuddyAgent [baseline] (801.734 ms) : 0, 801734
BytebuddyAgent [candidate] (803.838 ms) : 0, 803838
GlobalTracer [baseline] (287.883 ms) : 0, 287883
GlobalTracer [candidate] (289.953 ms) : 0, 289953
AppSec [baseline] (54.858 ms) : 0, 54858
AppSec [candidate] (52.278 ms) : 0, 52278
Remote Config [baseline] (586.535 µs) : 0, 587
Remote Config [candidate] (597.929 µs) : 0, 598
Telemetry [baseline] (7.433 ms) : 0, 7433
Telemetry [candidate] (8.328 ms) : 0, 8328
IAST [baseline] (20.482 ms) : 0, 20482
IAST [candidate] (22.487 ms) : 0, 22487
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (806.988 ms) : 0, 806988
BytebuddyAgent [candidate] (807.327 ms) : 0, 807327
GlobalTracer [baseline] (290.59 ms) : 0, 290590
GlobalTracer [candidate] (290.451 ms) : 0, 290451
AppSec [baseline] (51.556 ms) : 0, 51556
AppSec [candidate] (51.973 ms) : 0, 51973
Remote Config [baseline] (598.258 µs) : 0, 598
Remote Config [candidate] (599.159 µs) : 0, 599
Telemetry [baseline] (6.676 ms) : 0, 6676
Telemetry [candidate] (7.579 ms) : 0, 7579
IAST [baseline] (24.708 ms) : 0, 24708
IAST [candidate] (23.321 ms) : 0, 23321
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (800.912 ms) : 0, 800912
BytebuddyAgent [candidate] (799.525 ms) : 0, 799525
GlobalTracer [baseline] (291.523 ms) : 0, 291523
GlobalTracer [candidate] (291.585 ms) : 0, 291585
AppSec [baseline] (51.895 ms) : 0, 51895
AppSec [candidate] (52.565 ms) : 0, 52565
Remote Config [baseline] (600.317 µs) : 0, 600
Remote Config [candidate] (597.839 µs) : 0, 598
Telemetry [baseline] (8.203 ms) : 0, 8203
Telemetry [candidate] (6.575 ms) : 0, 6575
IAST [baseline] (22.458 ms) : 0, 22458
IAST [candidate] (22.474 ms) : 0, 22474
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.32.0-SNAPSHOT~20b0e74284, baseline=1.32.0-SNAPSHOT~02d3cb7aac

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.086 s) : 0, 1085975
Total [baseline] (9.178 s) : 0, 9178197
Agent [candidate] (1.082 s) : 0, 1081912
Total [candidate] (9.185 s) : 0, 9185356
section appsec
Agent [baseline] (1.21 s) : 0, 1209650
Total [baseline] (9.371 s) : 0, 9370516
Agent [candidate] (1.206 s) : 0, 1205996
Total [candidate] (9.281 s) : 0, 9280652
section iast
Agent [baseline] (1.213 s) : 0, 1212697
Total [baseline] (9.356 s) : 0, 9355722
Agent [candidate] (1.207 s) : 0, 1206901
Total [candidate] (9.292 s) : 0, 9291838
section profiling
Agent [baseline] (1.273 s) : 0, 1273447
Total [baseline] (9.335 s) : 0, 9334815
Agent [candidate] (1.274 s) : 0, 1274239
Total [candidate] (9.333 s) : 0, 9333174
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.086 s -
Agent appsec 1.21 s 123.675 ms (11.4%)
Agent iast 1.213 s 126.722 ms (11.7%)
Agent profiling 1.273 s 187.472 ms (17.3%)
Total tracing 9.178 s -
Total appsec 9.371 s 192.319 ms (2.1%)
Total iast 9.356 s 177.525 ms (1.9%)
Total profiling 9.335 s 156.618 ms (1.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.082 s -
Agent appsec 1.206 s 124.084 ms (11.5%)
Agent iast 1.207 s 124.99 ms (11.6%)
Agent profiling 1.274 s 192.327 ms (17.8%)
Total tracing 9.185 s -
Total appsec 9.281 s 95.296 ms (1.0%)
Total iast 9.292 s 106.482 ms (1.2%)
Total profiling 9.333 s 147.818 ms (1.6%)
gantt
    title petclinic - break down per module: candidate=1.32.0-SNAPSHOT~20b0e74284, baseline=1.32.0-SNAPSHOT~02d3cb7aac

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (699.785 ms) : 0, 699785
BytebuddyAgent [candidate] (696.432 ms) : 0, 696432
GlobalTracer [baseline] (292.285 ms) : 0, 292285
GlobalTracer [candidate] (292.043 ms) : 0, 292043
AppSec [baseline] (50.976 ms) : 0, 50976
AppSec [candidate] (50.718 ms) : 0, 50718
Remote Config [baseline] (724.781 µs) : 0, 725
Remote Config [candidate] (731.301 µs) : 0, 731
Telemetry [baseline] (7.789 ms) : 0, 7789
Telemetry [candidate] (7.777 ms) : 0, 7777
section appsec
BytebuddyAgent [baseline] (700.623 ms) : 0, 700623
BytebuddyAgent [candidate] (697.89 ms) : 0, 697890
GlobalTracer [baseline] (292.868 ms) : 0, 292868
GlobalTracer [candidate] (292.151 ms) : 0, 292151
AppSec [baseline] (156.151 ms) : 0, 156151
AppSec [candidate] (156.37 ms) : 0, 156370
Remote Config [baseline] (614.114 µs) : 0, 614
Remote Config [candidate] (603.425 µs) : 0, 603
Telemetry [baseline] (6.876 ms) : 0, 6876
Telemetry [candidate] (6.868 ms) : 0, 6868
IAST [baseline] (17.93 ms) : 0, 17930
IAST [candidate] (17.778 ms) : 0, 17778
section iast
BytebuddyAgent [baseline] (804.924 ms) : 0, 804924
BytebuddyAgent [candidate] (800.294 ms) : 0, 800294
GlobalTracer [baseline] (289.633 ms) : 0, 289633
GlobalTracer [candidate] (288.491 ms) : 0, 288491
AppSec [baseline] (51.742 ms) : 0, 51742
AppSec [candidate] (51.127 ms) : 0, 51127
Remote Config [baseline] (603.578 µs) : 0, 604
Remote Config [candidate] (585.014 µs) : 0, 585
Telemetry [baseline] (6.846 ms) : 0, 6846
Telemetry [candidate] (7.445 ms) : 0, 7445
IAST [baseline] (24.442 ms) : 0, 24442
IAST [candidate] (24.712 ms) : 0, 24712
section profiling
ProfilingAgent [baseline] (93.105 ms) : 0, 93105
ProfilingAgent [candidate] (93.315 ms) : 0, 93315
BytebuddyAgent [baseline] (689.726 ms) : 0, 689726
BytebuddyAgent [candidate] (690.007 ms) : 0, 690007
GlobalTracer [baseline] (373.855 ms) : 0, 373855
GlobalTracer [candidate] (374.331 ms) : 0, 374331
AppSec [baseline] (52.471 ms) : 0, 52471
AppSec [candidate] (52.256 ms) : 0, 52256
Remote Config [baseline] (782.012 µs) : 0, 782
Remote Config [candidate] (783.948 µs) : 0, 784
Telemetry [baseline] (7.347 ms) : 0, 7347
Telemetry [candidate] (7.41 ms) : 0, 7410
Profiling [baseline] (93.131 ms) : 0, 93131
Profiling [candidate] (93.341 ms) : 0, 93341
Loading

Load

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.32.0-SNAPSHOT~20b0e74284, baseline=1.32.0-SNAPSHOT~02d3cb7aac
    dateFormat X
    axisFormat %s
section baseline
no_agent (359.892 µs) : 340, 380
.   : milestone, 360,
iast (468.48 µs) : 448, 489
.   : milestone, 468,
iast_FULL (533.667 µs) : 513, 554
.   : milestone, 534,
iast_GLOBAL (496.439 µs) : 476, 517
.   : milestone, 496,
iast_HARDCODED_SECRET_DISABLED (469.562 µs) : 449, 490
.   : milestone, 470,
iast_INACTIVE (443.812 µs) : 423, 464
.   : milestone, 444,
iast_TELEMETRY_OFF (469.579 µs) : 448, 491
.   : milestone, 470,
tracing (444.505 µs) : 423, 466
.   : milestone, 445,
section candidate
no_agent (363.368 µs) : 343, 383
.   : milestone, 363,
iast (470.458 µs) : 450, 491
.   : milestone, 470,
iast_FULL (534.874 µs) : 514, 555
.   : milestone, 535,
iast_GLOBAL (488.08 µs) : 468, 508
.   : milestone, 488,
iast_HARDCODED_SECRET_DISABLED (462.442 µs) : 442, 483
.   : milestone, 462,
iast_INACTIVE (448.145 µs) : 428, 469
.   : milestone, 448,
iast_TELEMETRY_OFF (464.676 µs) : 444, 485
.   : milestone, 465,
tracing (439.961 µs) : 420, 460
.   : milestone, 440,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 359.892 µs [339.59 µs, 380.194 µs] -
iast 468.48 µs [448.118 µs, 488.843 µs] 108.588 µs (30.2%)
iast_FULL 533.667 µs [513.411 µs, 553.924 µs] 173.775 µs (48.3%)
iast_GLOBAL 496.439 µs [475.766 µs, 517.112 µs] 136.547 µs (37.9%)
iast_HARDCODED_SECRET_DISABLED 469.562 µs [448.709 µs, 490.414 µs] 109.67 µs (30.5%)
iast_INACTIVE 443.812 µs [423.475 µs, 464.149 µs] 83.92 µs (23.3%)
iast_TELEMETRY_OFF 469.579 µs [448.495 µs, 490.663 µs] 109.687 µs (30.5%)
tracing 444.505 µs [423.181 µs, 465.83 µs] 84.614 µs (23.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 363.368 µs [343.259 µs, 383.476 µs] -
iast 470.458 µs [449.834 µs, 491.081 µs] 107.09 µs (29.5%)
iast_FULL 534.874 µs [514.329 µs, 555.42 µs] 171.506 µs (47.2%)
iast_GLOBAL 488.08 µs [467.866 µs, 508.295 µs] 124.713 µs (34.3%)
iast_HARDCODED_SECRET_DISABLED 462.442 µs [442.124 µs, 482.76 µs] 99.075 µs (27.3%)
iast_INACTIVE 448.145 µs [427.5 µs, 468.79 µs] 84.777 µs (23.3%)
iast_TELEMETRY_OFF 464.676 µs [444.044 µs, 485.308 µs] 101.308 µs (27.9%)
tracing 439.961 µs [419.897 µs, 460.025 µs] 76.593 µs (21.1%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.32.0-SNAPSHOT~20b0e74284, baseline=1.32.0-SNAPSHOT~02d3cb7aac
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.351 ms) : 1331, 1370
.   : milestone, 1351,
appsec (1.767 ms) : 1742, 1791
.   : milestone, 1767,
iast (1.536 ms) : 1513, 1559
.   : milestone, 1536,
profiling (1.533 ms) : 1508, 1558
.   : milestone, 1533,
tracing (1.519 ms) : 1496, 1542
.   : milestone, 1519,
section candidate
no_agent (1.356 ms) : 1337, 1375
.   : milestone, 1356,
appsec (1.764 ms) : 1741, 1788
.   : milestone, 1764,
iast (1.529 ms) : 1506, 1552
.   : milestone, 1529,
profiling (1.582 ms) : 1558, 1607
.   : milestone, 1582,
tracing (1.477 ms) : 1454, 1500
.   : milestone, 1477,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.351 ms [1.331 ms, 1.37 ms] -
appsec 1.767 ms [1.742 ms, 1.791 ms] 416.026 µs (30.8%)
iast 1.536 ms [1.513 ms, 1.559 ms] 185.55 µs (13.7%)
profiling 1.533 ms [1.508 ms, 1.558 ms] 182.721 µs (13.5%)
tracing 1.519 ms [1.496 ms, 1.542 ms] 168.649 µs (12.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.356 ms [1.337 ms, 1.375 ms] -
appsec 1.764 ms [1.741 ms, 1.788 ms] 408.308 µs (30.1%)
iast 1.529 ms [1.506 ms, 1.552 ms] 172.807 µs (12.7%)
profiling 1.582 ms [1.558 ms, 1.607 ms] 226.256 µs (16.7%)
tracing 1.477 ms [1.454 ms, 1.5 ms] 120.834 µs (8.9%)

@vandonr vandonr marked this pull request as ready for review March 6, 2024 13:22
@vandonr vandonr requested a review from a team as a code owner March 6, 2024 13:22
@vandonr vandonr merged commit 30e6c93 into master Mar 6, 2024
79 checks passed
@vandonr vandonr deleted the vandonr/payload branch March 6, 2024 16:20
@github-actions github-actions bot added this to the 1.32.0 milestone Mar 6, 2024
@PerfectSlayer PerfectSlayer added the inst: jdbc JDBC instrumentation label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: jdbc JDBC instrumentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants