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 peer service tag in dbm sql commenter #7913

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jordan-wong
Copy link
Contributor

What Does This Do

Adds a peer.service annotation to the SQL Commenter for DBM tracing.

Motivation

We want to add tags in line with the peer service model

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@jordan-wong jordan-wong requested a review from a team as a code owner November 7, 2024 22:45
@jordan-wong jordan-wong marked this pull request as draft November 7, 2024 22:46

// Both Postgres and MySQL are unhappy with anything before CALL in a stored procedure
// invocation but they seem ok with it after so we force append mode
if (firstWord.equalsIgnoreCase("call")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Code Quality Violation

Suggested change
if (firstWord.equalsIgnoreCase("call")) {
if ("call".equalsIgnoreCase(firstWord)) {
the literal should be first in String comparisons (...read more)

One should always prioritize using a string literal as the first arguments in any string comparison. This approach serves as a preventive measure against NullPointerExceptions because when the second argument is null, instead of encountering an exception, the comparisons will simply yield false results.

View in Datadog  Leave us feedback  Documentation

@pr-commenter
Copy link

pr-commenter bot commented Nov 7, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master add-peer-service-tag-in-DBM-sql-commenter
git_commit_date 1737139405 1737146951
git_commit_sha 0b239ae 69b16cc
release_version 1.46.0-SNAPSHOT~0b239ae5cc 1.43.0-SNAPSHOT~69b16cc7af
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1737152007 1737152007
ci_job_id 771644456 771644456
ci_pipeline_id 53384448 53384448
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 11 performance improvements and 13 performance regressions! Performance is the same for 29 metrics, 10 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:insecure-bank:iast:Agent.start worse
[+25.108ms; +34.554ms] or [+2.118%; +2.915%]
1.215s 1.185s
scenario:startup:insecure-bank:iast:BytebuddyAgent better
[-28.924ms; -22.372ms] or [-3.468%; -2.683%]
808.280ms 833.928ms
scenario:startup:insecure-bank:iast:GlobalTracer worse
[+58.182ms; +60.495ms] or [+23.550%; +24.486%]
306.398ms 247.059ms
scenario:startup:insecure-bank:iast:Telemetry better
[-1.592ms; -1.267ms] or [-17.919%; -14.262%]
7.454ms 8.884ms
scenario:startup:insecure-bank:iast_HARDCODED_SECRET_DISABLED:Agent.start worse
[+33.093ms; +53.962ms] or [+2.798%; +4.562%]
1.226s 1.183s
scenario:startup:insecure-bank:iast_HARDCODED_SECRET_DISABLED:GlobalTracer worse
[+59.209ms; +66.678ms] or [+24.051%; +27.085%]
309.127ms 246.183ms
scenario:startup:insecure-bank:iast_HARDCODED_SECRET_DISABLED:Remote Config better
[-90.837µs; -28.846µs] or [-13.230%; -4.201%]
626.770µs 686.611µs
scenario:startup:insecure-bank:iast_HARDCODED_SECRET_DISABLED:Telemetry better
[-1.369ms; -1.070ms] or [-15.515%; -12.122%]
7.606ms 8.825ms
scenario:startup:insecure-bank:iast_TELEMETRY_OFF:GlobalTracer worse
[+56.914ms; +62.874ms] or [+22.996%; +25.404%]
307.394ms 247.499ms
scenario:startup:insecure-bank:iast_TELEMETRY_OFF:Telemetry better
[-1.754ms; -1.110ms] or [-19.698%; -12.466%]
7.472ms 8.904ms
scenario:startup:insecure-bank:tracing:GlobalTracer worse
[+57.949ms; +70.233ms] or [+22.573%; +27.358%]
320.812ms 256.721ms
scenario:startup:insecure-bank:tracing:Remote Config better
[-61.599µs; -15.475µs] or [-8.316%; -2.089%]
702.230µs 740.767µs
scenario:startup:petclinic:appsec:Agent.start worse
[+27.251ms; +47.937ms] or [+2.293%; +4.033%]
1.226s 1.189s
scenario:startup:petclinic:appsec:GlobalTracer worse
[+59.272ms; +65.752ms] or [+23.513%; +26.084%]
314.596ms 252.084ms
scenario:startup:petclinic:appsec:Remote Config better
[-53.695µs; -19.387µs] or [-8.017%; -2.895%]
633.193µs 669.735µs
scenario:startup:petclinic:iast:BytebuddyAgent better
[-51.809ms; -21.726ms] or [-6.129%; -2.570%]
808.532ms 845.300ms
scenario:startup:petclinic:iast:GlobalTracer worse
[+55.228ms; +60.964ms] or [+22.222%; +24.530%]
306.619ms 248.524ms
scenario:startup:petclinic:iast:Telemetry better
[-1.633ms; -1.163ms] or [-18.389%; -13.101%]
7.482ms 8.880ms
scenario:startup:petclinic:profiling:Agent.start worse
[+27.703ms; +63.803ms] or [+2.210%; +5.090%]
1.299s 1.254s
scenario:startup:petclinic:profiling:GlobalTracer worse
[+51.209ms; +62.047ms] or [+14.689%; +17.798%]
405.253ms 348.625ms
scenario:startup:petclinic:tracing:Agent.start worse
[+32.414ms; +40.797ms] or [+3.078%; +3.874%]
1.090s 1.053s
scenario:startup:petclinic:tracing:BytebuddyAgent better
[-21.107ms; -16.048ms] or [-2.966%; -2.255%]
693.038ms 711.616ms
scenario:startup:petclinic:tracing:GlobalTracer worse
[+61.353ms; +63.539ms] or [+24.042%; +24.899%]
317.633ms 255.187ms
scenario:startup:petclinic:tracing:Remote Config better
[-78.649µs; -40.684µs] or [-10.544%; -5.454%]
686.250µs 745.916µs
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.43.0-SNAPSHOT~69b16cc7af, baseline=1.46.0-SNAPSHOT~0b239ae5cc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.06 s) : 0, 1059614
Total [baseline] (8.608 s) : 0, 8607764
Agent [candidate] (1.102 s) : 0, 1101847
Total [candidate] (8.68 s) : 0, 8680139
section iast
Agent [baseline] (1.185 s) : 0, 1185301
Total [baseline] (9.209 s) : 0, 9208795
Agent [candidate] (1.215 s) : 0, 1215132
Total [candidate] (9.177 s) : 0, 9176585
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.183 s) : 0, 1182735
Total [baseline] (9.146 s) : 0, 9145674
Agent [candidate] (1.226 s) : 0, 1226263
Total [candidate] (9.194 s) : 0, 9194040
section iast_TELEMETRY_OFF
Agent [baseline] (1.185 s) : 0, 1185169
Total [baseline] (9.215 s) : 0, 9215241
Agent [candidate] (1.217 s) : 0, 1216966
Total [candidate] (9.204 s) : 0, 9204101
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent iast 1.185 s 125.687 ms (11.9%)
Agent iast_HARDCODED_SECRET_DISABLED 1.183 s 123.121 ms (11.6%)
Agent iast_TELEMETRY_OFF 1.185 s 125.555 ms (11.8%)
Total tracing 8.608 s -
Total iast 9.209 s 601.03 ms (7.0%)
Total iast_HARDCODED_SECRET_DISABLED 9.146 s 537.91 ms (6.2%)
Total iast_TELEMETRY_OFF 9.215 s 607.476 ms (7.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.102 s -
Agent iast 1.215 s 113.285 ms (10.3%)
Agent iast_HARDCODED_SECRET_DISABLED 1.226 s 124.416 ms (11.3%)
Agent iast_TELEMETRY_OFF 1.217 s 115.119 ms (10.4%)
Total tracing 8.68 s -
Total iast 9.177 s 496.446 ms (5.7%)
Total iast_HARDCODED_SECRET_DISABLED 9.194 s 513.902 ms (5.9%)
Total iast_TELEMETRY_OFF 9.204 s 523.962 ms (6.0%)
gantt
    title insecure-bank - break down per module: candidate=1.43.0-SNAPSHOT~69b16cc7af, baseline=1.46.0-SNAPSHOT~0b239ae5cc

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (718.111 ms) : 0, 718111
BytebuddyAgent [candidate] (702.099 ms) : 0, 702099
GlobalTracer [baseline] (256.721 ms) : 0, 256721
GlobalTracer [candidate] (320.812 ms) : 0, 320812
AppSec [baseline] (56.632 ms) : 0, 56632
AppSec [candidate] (54.916 ms) : 0, 54916
Remote Config [baseline] (740.767 µs) : 0, 741
Remote Config [candidate] (702.23 µs) : 0, 702
Telemetry [baseline] (12.373 ms) : 0, 12373
Telemetry [candidate] (9.389 ms) : 0, 9389
section iast
BytebuddyAgent [baseline] (833.928 ms) : 0, 833928
BytebuddyAgent [candidate] (808.28 ms) : 0, 808280
GlobalTracer [baseline] (247.059 ms) : 0, 247059
GlobalTracer [candidate] (306.398 ms) : 0, 306398
AppSec [baseline] (58.128 ms) : 0, 58128
AppSec [candidate] (57.19 ms) : 0, 57190
IAST [baseline] (21.574 ms) : 0, 21574
IAST [candidate] (21.43 ms) : 0, 21430
Remote Config [baseline] (681.515 µs) : 0, 682
Remote Config [candidate] (630.143 µs) : 0, 630
Telemetry [baseline] (8.884 ms) : 0, 8884
Telemetry [candidate] (7.454 ms) : 0, 7454
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (831.855 ms) : 0, 831855
BytebuddyAgent [candidate] (815.816 ms) : 0, 815816
GlobalTracer [baseline] (246.183 ms) : 0, 246183
GlobalTracer [candidate] (309.127 ms) : 0, 309127
AppSec [baseline] (58.532 ms) : 0, 58532
AppSec [candidate] (58.403 ms) : 0, 58403
IAST [baseline] (21.632 ms) : 0, 21632
IAST [candidate] (20.814 ms) : 0, 20814
Remote Config [baseline] (686.611 µs) : 0, 687
Remote Config [candidate] (626.77 µs) : 0, 627
Telemetry [baseline] (8.825 ms) : 0, 8825
Telemetry [candidate] (7.606 ms) : 0, 7606
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (833.066 ms) : 0, 833066
BytebuddyAgent [candidate] (808.985 ms) : 0, 808985
GlobalTracer [baseline] (247.499 ms) : 0, 247499
GlobalTracer [candidate] (307.394 ms) : 0, 307394
AppSec [baseline] (58.496 ms) : 0, 58496
AppSec [candidate] (57.932 ms) : 0, 57932
IAST [baseline] (21.374 ms) : 0, 21374
IAST [candidate] (20.713 ms) : 0, 20713
Remote Config [baseline] (687.731 µs) : 0, 688
Remote Config [candidate] (654.983 µs) : 0, 655
Telemetry [baseline] (8.904 ms) : 0, 8904
Telemetry [candidate] (7.472 ms) : 0, 7472
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.43.0-SNAPSHOT~69b16cc7af, baseline=1.46.0-SNAPSHOT~0b239ae5cc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.053 s) : 0, 1052980
Total [baseline] (10.426 s) : 0, 10425630
Agent [candidate] (1.09 s) : 0, 1089586
Total [candidate] (10.397 s) : 0, 10396934
section appsec
Agent [baseline] (1.189 s) : 0, 1188562
Total [baseline] (10.69 s) : 0, 10689663
Agent [candidate] (1.226 s) : 0, 1226156
Total [candidate] (10.748 s) : 0, 10747528
section iast
Agent [baseline] (1.199 s) : 0, 1199138
Total [baseline] (11.005 s) : 0, 11004636
Agent [candidate] (1.216 s) : 0, 1215601
Total [candidate] (10.907 s) : 0, 10907075
section profiling
Agent [baseline] (1.254 s) : 0, 1253542
Total [baseline] (10.742 s) : 0, 10741895
Agent [candidate] (1.299 s) : 0, 1299295
Total [candidate] (10.794 s) : 0, 10794124
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.053 s -
Agent appsec 1.189 s 135.582 ms (12.9%)
Agent iast 1.199 s 146.158 ms (13.9%)
Agent profiling 1.254 s 200.562 ms (19.0%)
Total tracing 10.426 s -
Total appsec 10.69 s 264.034 ms (2.5%)
Total iast 11.005 s 579.007 ms (5.6%)
Total profiling 10.742 s 316.265 ms (3.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.09 s -
Agent appsec 1.226 s 136.57 ms (12.5%)
Agent iast 1.216 s 126.015 ms (11.6%)
Agent profiling 1.299 s 209.709 ms (19.2%)
Total tracing 10.397 s -
Total appsec 10.748 s 350.594 ms (3.4%)
Total iast 10.907 s 510.141 ms (4.9%)
Total profiling 10.794 s 397.19 ms (3.8%)
gantt
    title petclinic - break down per module: candidate=1.43.0-SNAPSHOT~69b16cc7af, baseline=1.46.0-SNAPSHOT~0b239ae5cc

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (711.616 ms) : 0, 711616
BytebuddyAgent [candidate] (693.038 ms) : 0, 693038
GlobalTracer [baseline] (255.187 ms) : 0, 255187
GlobalTracer [candidate] (317.633 ms) : 0, 317633
AppSec [baseline] (55.469 ms) : 0, 55469
AppSec [candidate] (54.378 ms) : 0, 54378
Remote Config [baseline] (745.916 µs) : 0, 746
Remote Config [candidate] (686.25 µs) : 0, 686
Telemetry [baseline] (14.99 ms) : 0, 14990
Telemetry [candidate] (10.137 ms) : 0, 10137
section appsec
BytebuddyAgent [baseline] (732.382 ms) : 0, 732382
BytebuddyAgent [candidate] (713.285 ms) : 0, 713285
GlobalTracer [baseline] (252.084 ms) : 0, 252084
GlobalTracer [candidate] (314.596 ms) : 0, 314596
AppSec [baseline] (170.641 ms) : 0, 170641
AppSec [candidate] (165.963 ms) : 0, 165963
Remote Config [baseline] (669.735 µs) : 0, 670
Remote Config [candidate] (633.193 µs) : 0, 633
Telemetry [baseline] (8.135 ms) : 0, 8135
Telemetry [candidate] (7.807 ms) : 0, 7807
IAST [baseline] (19.316 ms) : 0, 19316
IAST [candidate] (20.207 ms) : 0, 20207
section iast
BytebuddyAgent [baseline] (845.3 ms) : 0, 845300
BytebuddyAgent [candidate] (808.532 ms) : 0, 808532
GlobalTracer [baseline] (248.524 ms) : 0, 248524
GlobalTracer [candidate] (306.619 ms) : 0, 306619
AppSec [baseline] (58.606 ms) : 0, 58606
AppSec [candidate] (56.906 ms) : 0, 56906
Remote Config [baseline] (686.368 µs) : 0, 686
Remote Config [candidate] (634.496 µs) : 0, 634
Telemetry [baseline] (8.88 ms) : 0, 8880
Telemetry [candidate] (7.482 ms) : 0, 7482
IAST [baseline] (21.772 ms) : 0, 21772
IAST [candidate] (21.687 ms) : 0, 21687
section profiling
ProfilingAgent [baseline] (95.165 ms) : 0, 95165
ProfilingAgent [candidate] (94.894 ms) : 0, 94894
BytebuddyAgent [baseline] (703.562 ms) : 0, 703562
BytebuddyAgent [candidate] (692.016 ms) : 0, 692016
GlobalTracer [baseline] (348.625 ms) : 0, 348625
GlobalTracer [candidate] (405.253 ms) : 0, 405253
AppSec [baseline] (54.77 ms) : 0, 54770
AppSec [candidate] (55.526 ms) : 0, 55526
Remote Config [baseline] (692.354 µs) : 0, 692
Remote Config [candidate] (688.111 µs) : 0, 688
Telemetry [baseline] (8.746 ms) : 0, 8746
Telemetry [candidate] (11.587 ms) : 0, 11587
Profiling [baseline] (95.188 ms) : 0, 95188
Profiling [candidate] (94.917 ms) : 0, 94917
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-01-17T21:43:32 2025-01-17T21:50:34
git_branch master add-peer-service-tag-in-DBM-sql-commenter
git_commit_date 1737139405 1737146951
git_commit_sha 0b239ae 69b16cc
release_version 1.46.0-SNAPSHOT~0b239ae5cc 1.43.0-SNAPSHOT~69b16cc7af
start_time 2025-01-17T21:43:18 2025-01-17T21:50:21
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1737150988 1737150988
ci_job_id 771644457 771644457
ci_pipeline_id 53384448 53384448
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

Found 2 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 16 unstable metrics.

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:insecure-bank:iast_FULL better
[-119.943µs; -73.130µs] or [-16.065%; -9.795%]
unstable
[-396.244op/s; +2301.006op/s] or [-6.934%; +40.268%]
650.064µs 6666.667op/s 746.601µs 5714.286op/s
scenario:load:insecure-bank:iast_GLOBAL better
[-64.409µs; -15.272µs] or [-11.395%; -2.702%]
unstable
[-1173.638op/s; +3055.991op/s] or [-16.627%; +43.293%]
525.417µs 8000.000op/s 565.258µs 7058.824op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~69b16cc7af, baseline=1.46.0-SNAPSHOT~0b239ae5cc
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.34 ms) : 1320, 1359
.   : milestone, 1340,
appsec (1.734 ms) : 1711, 1758
.   : milestone, 1734,
appsec_no_iast (1.762 ms) : 1738, 1786
.   : milestone, 1762,
iast (1.499 ms) : 1475, 1522
.   : milestone, 1499,
profiling (1.518 ms) : 1494, 1541
.   : milestone, 1518,
tracing (1.474 ms) : 1449, 1500
.   : milestone, 1474,
section candidate
no_agent (1.361 ms) : 1341, 1382
.   : milestone, 1361,
appsec (1.758 ms) : 1734, 1782
.   : milestone, 1758,
appsec_no_iast (1.748 ms) : 1722, 1773
.   : milestone, 1748,
iast (1.521 ms) : 1498, 1543
.   : milestone, 1521,
profiling (1.512 ms) : 1487, 1536
.   : milestone, 1512,
tracing (1.502 ms) : 1476, 1527
.   : milestone, 1502,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.34 ms [1.32 ms, 1.359 ms] -
appsec 1.734 ms [1.711 ms, 1.758 ms] 394.777 µs (29.5%)
appsec_no_iast 1.762 ms [1.738 ms, 1.786 ms] 422.446 µs (31.5%)
iast 1.499 ms [1.475 ms, 1.522 ms] 158.969 µs (11.9%)
profiling 1.518 ms [1.494 ms, 1.541 ms] 177.854 µs (13.3%)
tracing 1.474 ms [1.449 ms, 1.5 ms] 134.789 µs (10.1%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.361 ms [1.341 ms, 1.382 ms] -
appsec 1.758 ms [1.734 ms, 1.782 ms] 396.858 µs (29.2%)
appsec_no_iast 1.748 ms [1.722 ms, 1.773 ms] 386.417 µs (28.4%)
iast 1.521 ms [1.498 ms, 1.543 ms] 159.414 µs (11.7%)
profiling 1.512 ms [1.487 ms, 1.536 ms] 150.656 µs (11.1%)
tracing 1.502 ms [1.476 ms, 1.527 ms] 140.43 µs (10.3%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~69b16cc7af, baseline=1.46.0-SNAPSHOT~0b239ae5cc
    dateFormat X
    axisFormat %s
section baseline
no_agent (376.051 µs) : 356, 396
.   : milestone, 376,
iast (508.845 µs) : 487, 531
.   : milestone, 509,
iast_FULL (746.601 µs) : 725, 769
.   : milestone, 747,
iast_GLOBAL (565.258 µs) : 541, 589
.   : milestone, 565,
iast_HARDCODED_SECRET_DISABLED (508.252 µs) : 486, 530
.   : milestone, 508,
iast_INACTIVE (459.53 µs) : 438, 481
.   : milestone, 460,
iast_TELEMETRY_OFF (496.294 µs) : 474, 519
.   : milestone, 496,
tracing (451.205 µs) : 431, 472
.   : milestone, 451,
section candidate
no_agent (378.785 µs) : 358, 399
.   : milestone, 379,
iast (493.254 µs) : 472, 515
.   : milestone, 493,
iast_FULL (650.064 µs) : 628, 672
.   : milestone, 650,
iast_GLOBAL (525.417 µs) : 504, 547
.   : milestone, 525,
iast_HARDCODED_SECRET_DISABLED (493.921 µs) : 473, 515
.   : milestone, 494,
iast_INACTIVE (464.707 µs) : 444, 486
.   : milestone, 465,
iast_TELEMETRY_OFF (482.135 µs) : 461, 503
.   : milestone, 482,
tracing (449.597 µs) : 429, 470
.   : milestone, 450,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 376.051 µs [356.054 µs, 396.048 µs] -
iast 508.845 µs [486.939 µs, 530.75 µs] 132.794 µs (35.3%)
iast_FULL 746.601 µs [724.675 µs, 768.527 µs] 370.55 µs (98.5%)
iast_GLOBAL 565.258 µs [541.461 µs, 589.054 µs] 189.206 µs (50.3%)
iast_HARDCODED_SECRET_DISABLED 508.252 µs [486.125 µs, 530.379 µs] 132.201 µs (35.2%)
iast_INACTIVE 459.53 µs [437.733 µs, 481.326 µs] 83.478 µs (22.2%)
iast_TELEMETRY_OFF 496.294 µs [473.695 µs, 518.893 µs] 120.243 µs (32.0%)
tracing 451.205 µs [430.53 µs, 471.88 µs] 75.153 µs (20.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 378.785 µs [358.369 µs, 399.202 µs] -
iast 493.254 µs [471.777 µs, 514.73 µs] 114.469 µs (30.2%)
iast_FULL 650.064 µs [628.489 µs, 671.64 µs] 271.279 µs (71.6%)
iast_GLOBAL 525.417 µs [503.594 µs, 547.24 µs] 146.632 µs (38.7%)
iast_HARDCODED_SECRET_DISABLED 493.921 µs [472.646 µs, 515.195 µs] 115.135 µs (30.4%)
iast_INACTIVE 464.707 µs [443.733 µs, 485.682 µs] 85.922 µs (22.7%)
iast_TELEMETRY_OFF 482.135 µs [460.895 µs, 503.374 µs] 103.35 µs (27.3%)
tracing 449.597 µs [428.93 µs, 470.264 µs] 70.812 µs (18.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master add-peer-service-tag-in-DBM-sql-commenter
git_commit_date 1737139405 1737146951
git_commit_sha 0b239ae 69b16cc
release_version 1.46.0-SNAPSHOT~0b239ae5cc 1.43.0-SNAPSHOT~69b16cc7af
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1737151538 1737151538
ci_job_id 771644459 771644459
ci_pipeline_id 53384448 53384448
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant appsec appsec

Summary

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

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~69b16cc7af, baseline=1.46.0-SNAPSHOT~0b239ae5cc
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.464 ms) : 1453, 1475
.   : milestone, 1464,
appsec (2.352 ms) : 2309, 2395
.   : milestone, 2352,
iast (2.095 ms) : 2041, 2149
.   : milestone, 2095,
iast_GLOBAL (2.137 ms) : 2082, 2191
.   : milestone, 2137,
profiling (2.442 ms) : 2259, 2625
.   : milestone, 2442,
tracing (1.937 ms) : 1896, 1979
.   : milestone, 1937,
section candidate
no_agent (1.468 ms) : 1457, 1480
.   : milestone, 1468,
appsec (2.32 ms) : 2279, 2361
.   : milestone, 2320,
iast (2.071 ms) : 2019, 2122
.   : milestone, 2071,
iast_GLOBAL (2.109 ms) : 2057, 2161
.   : milestone, 2109,
profiling (1.943 ms) : 1901, 1986
.   : milestone, 1943,
tracing (1.913 ms) : 1873, 1953
.   : milestone, 1913,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.464 ms [1.453 ms, 1.475 ms] -
appsec 2.352 ms [2.309 ms, 2.395 ms] 887.749 µs (60.6%)
iast 2.095 ms [2.041 ms, 2.149 ms] 631.134 µs (43.1%)
iast_GLOBAL 2.137 ms [2.082 ms, 2.191 ms] 672.572 µs (45.9%)
profiling 2.442 ms [2.259 ms, 2.625 ms] 977.806 µs (66.8%)
tracing 1.937 ms [1.896 ms, 1.979 ms] 473.34 µs (32.3%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.468 ms [1.457 ms, 1.48 ms] -
appsec 2.32 ms [2.279 ms, 2.361 ms] 851.885 µs (58.0%)
iast 2.071 ms [2.019 ms, 2.122 ms] 602.319 µs (41.0%)
iast_GLOBAL 2.109 ms [2.057 ms, 2.161 ms] 640.367 µs (43.6%)
profiling 1.943 ms [1.901 ms, 1.986 ms] 474.82 µs (32.3%)
tracing 1.913 ms [1.873 ms, 1.953 ms] 444.413 µs (30.3%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~69b16cc7af, baseline=1.46.0-SNAPSHOT~0b239ae5cc
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.399 s) : 15399000, 15399000
.   : milestone, 15399000,
appsec (14.993 s) : 14993000, 14993000
.   : milestone, 14993000,
iast (18.828 s) : 18828000, 18828000
.   : milestone, 18828000,
iast_GLOBAL (17.977 s) : 17977000, 17977000
.   : milestone, 17977000,
profiling (15.189 s) : 15189000, 15189000
.   : milestone, 15189000,
tracing (15.006 s) : 15006000, 15006000
.   : milestone, 15006000,
section candidate
no_agent (15.455 s) : 15455000, 15455000
.   : milestone, 15455000,
appsec (15.133 s) : 15133000, 15133000
.   : milestone, 15133000,
iast (18.352 s) : 18352000, 18352000
.   : milestone, 18352000,
iast_GLOBAL (17.858 s) : 17858000, 17858000
.   : milestone, 17858000,
profiling (15.23 s) : 15230000, 15230000
.   : milestone, 15230000,
tracing (14.906 s) : 14906000, 14906000
.   : milestone, 14906000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.399 s [15.399 s, 15.399 s] -
appsec 14.993 s [14.993 s, 14.993 s] -406.0 ms (-2.6%)
iast 18.828 s [18.828 s, 18.828 s] 3.429 s (22.3%)
iast_GLOBAL 17.977 s [17.977 s, 17.977 s] 2.578 s (16.7%)
profiling 15.189 s [15.189 s, 15.189 s] -210.0 ms (-1.4%)
tracing 15.006 s [15.006 s, 15.006 s] -393.0 ms (-2.6%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.455 s [15.455 s, 15.455 s] -
appsec 15.133 s [15.133 s, 15.133 s] -322.0 ms (-2.1%)
iast 18.352 s [18.352 s, 18.352 s] 2.897 s (18.7%)
iast_GLOBAL 17.858 s [17.858 s, 17.858 s] 2.403 s (15.5%)
profiling 15.23 s [15.23 s, 15.23 s] -225.0 ms (-1.5%)
tracing 14.906 s [14.906 s, 14.906 s] -549.0 ms (-3.6%)

@jordan-wong
Copy link
Contributor Author

Changed behavior according to discussion with Will. peer.service is inferred and is does not need to be manually set. We want to include the peer.service tag if a user enables peer.service tagging in their application, and as a result we see peer.service tag on our span. If we see a peer.service tag on our active span, we inject it into our SQL statement

@jordan-wong jordan-wong marked this pull request as ready for review November 18, 2024 18:45
Copy link
Contributor

@nayeem-kamal nayeem-kamal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. Just a few comments to address.

@@ -15,6 +19,7 @@ public class SQLCommenter {
private static final String DATABASE_SERVICE = encode("dddbs");
private static final String DD_HOSTNAME = encode("ddh");
private static final String DD_DB_NAME = encode("dddb");
private static final String DD_DB_INSTANCE = "ddprs";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this to dd_peer_service or something

@@ -113,6 +126,7 @@ public static String inject(
dbService,
hostname,
dbName,
peerServiceString,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably just call this peerService

}
}
}
sqlWithComment == expected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already checked in the then: block.

if (injectTrace) {
sqlWithComment = SQLCommenter.inject(query, dbService, dbType, host, dbName, traceParent, true, appendComment)
} else {
if (appendComment) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if branching structure is a bit hard to read. I think you could just do else if(appendComment) and then just a final else rather than having nested if statements like this

sqlWithComment == expected

where:
query | ddService | ddEnv | dbService | dbType | host | dbName | ddVersion | injectTrace | appendComment | traceParent | peerService | expected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably update this to only have the cases that include ddprs since that is what we want to test here. the other cases should already be tested in other tests so no need to repeat it.

final String dbService,
final String hostname,
final String dbName,
final String dbInstance,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets rename this to peerService for cleanliness

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants