Skip to content

Conversation

rachelyangdog
Copy link
Contributor

What Does This Do

  • Added _dd.p.ksr tag to all sampled spans
  • Propagated sample rate metadata through distributed traces for backend processing
  • For more information: RFC

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Copy link
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@rachelyangdog rachelyangdog marked this pull request as draft September 11, 2025 20:59
@datadog-datadog-prod-us1

This comment has been minimized.

@pr-commenter
Copy link

pr-commenter bot commented Sep 11, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master rachel.yang/knuth-sampling-tag
git_commit_date 1758822615 1758827491
git_commit_sha 61c2d97 ad8190f
release_version 1.54.0-SNAPSHOT~61c2d97420 1.54.0-SNAPSHOT~ad8190f8ca
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1758829331 1758829331
ci_job_id 1148530623 1148530623
ci_pipeline_id 77577212 77577212
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-mp6c45ay 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-mp6c45ay 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 1 performance improvements and 8 performance regressions! Performance is the same for 40 metrics, 10 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:insecure-bank:iast:GlobalTracer worse
[+6.217ms; +11.742ms] or [+2.603%; +4.917%]
247.779ms 238.800ms
scenario:startup:insecure-bank:tracing:GlobalTracer worse
[+9.674ms; +11.567ms] or [+3.913%; +4.678%]
257.876ms 247.256ms
scenario:startup:petclinic:appsec:GlobalTracer worse
[+11.217ms; +12.892ms] or [+4.691%; +5.392%]
251.155ms 239.101ms
scenario:startup:petclinic:appsec:AppSec better
[-10.237ms; -6.476ms] or [-5.967%; -3.774%]
163.216ms 171.572ms
scenario:startup:petclinic:iast:GlobalTracer worse
[+8.877ms; +17.259ms] or [+3.740%; +7.272%]
250.403ms 237.335ms
scenario:startup:petclinic:profiling:ProfilingAgent worse
[+7.367ms; +8.570ms] or [+7.284%; +8.473%]
109.109ms 101.140ms
scenario:startup:petclinic:profiling:GlobalTracer worse
[+9.835ms; +12.130ms] or [+4.397%; +5.423%]
234.669ms 223.686ms
scenario:startup:petclinic:profiling:Profiling worse
[+7.285ms; +8.896ms] or [+7.160%; +8.743%]
109.843ms 101.753ms
scenario:startup:petclinic:tracing:GlobalTracer worse
[+5.987ms; +12.727ms] or [+2.405%; +5.112%]
258.305ms 248.948ms
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.54.0-SNAPSHOT~ad8190f8ca, baseline=1.54.0-SNAPSHOT~61c2d97420

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.005 s) : 0, 1004602
Total [baseline] (8.687 s) : 0, 8687065
Agent [candidate] (1.019 s) : 0, 1018830
Total [candidate] (8.635 s) : 0, 8634794
section iast
Agent [baseline] (1.155 s) : 0, 1154628
Total [baseline] (9.257 s) : 0, 9256742
Agent [candidate] (1.155 s) : 0, 1154882
Total [candidate] (9.413 s) : 0, 9412743
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.005 s -
Agent iast 1.155 s 150.026 ms (14.9%)
Total tracing 8.687 s -
Total iast 9.257 s 569.677 ms (6.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.019 s -
Agent iast 1.155 s 136.052 ms (13.4%)
Total tracing 8.635 s -
Total iast 9.413 s 777.949 ms (9.0%)
gantt
    title insecure-bank - break down per module: candidate=1.54.0-SNAPSHOT~ad8190f8ca, baseline=1.54.0-SNAPSHOT~61c2d97420

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.459 ms) : 0, 1459
crashtracking [candidate] (1.452 ms) : 0, 1452
BytebuddyAgent [baseline] (687.677 ms) : 0, 687677
BytebuddyAgent [candidate] (688.319 ms) : 0, 688319
GlobalTracer [baseline] (247.256 ms) : 0, 247256
GlobalTracer [candidate] (257.876 ms) : 0, 257876
AppSec [baseline] (31.111 ms) : 0, 31111
AppSec [candidate] (31.134 ms) : 0, 31134
Debugger [baseline] (6.37 ms) : 0, 6370
Debugger [candidate] (6.323 ms) : 0, 6323
Remote Config [baseline] (695.835 µs) : 0, 696
Remote Config [candidate] (664.147 µs) : 0, 664
Telemetry [baseline] (8.997 ms) : 0, 8997
Telemetry [candidate] (12.083 ms) : 0, 12083
section iast
crashtracking [baseline] (1.473 ms) : 0, 1473
crashtracking [candidate] (1.46 ms) : 0, 1460
BytebuddyAgent [baseline] (817.494 ms) : 0, 817494
BytebuddyAgent [candidate] (809.557 ms) : 0, 809557
GlobalTracer [baseline] (238.8 ms) : 0, 238800
GlobalTracer [candidate] (247.779 ms) : 0, 247779
IAST [baseline] (26.395 ms) : 0, 26395
IAST [candidate] (28.681 ms) : 0, 28681
AppSec [baseline] (34.167 ms) : 0, 34167
AppSec [candidate] (30.912 ms) : 0, 30912
Debugger [baseline] (6.055 ms) : 0, 6055
Debugger [candidate] (6.166 ms) : 0, 6166
Remote Config [baseline] (592.081 µs) : 0, 592
Remote Config [candidate] (607.479 µs) : 0, 607
Telemetry [baseline] (8.374 ms) : 0, 8374
Telemetry [candidate] (8.571 ms) : 0, 8571
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.54.0-SNAPSHOT~ad8190f8ca, baseline=1.54.0-SNAPSHOT~61c2d97420

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.012 s) : 0, 1011908
Total [baseline] (10.755 s) : 0, 10755145
Agent [candidate] (1.022 s) : 0, 1021757
Total [candidate] (10.637 s) : 0, 10636653
section appsec
Agent [baseline] (1.184 s) : 0, 1184398
Total [baseline] (11.08 s) : 0, 11080058
Agent [candidate] (1.189 s) : 0, 1189375
Total [candidate] (10.916 s) : 0, 10916335
section iast
Agent [baseline] (1.146 s) : 0, 1146072
Total [baseline] (10.999 s) : 0, 10998823
Agent [candidate] (1.168 s) : 0, 1168143
Total [candidate] (11.097 s) : 0, 11096928
section profiling
Agent [baseline] (1.152 s) : 0, 1152001
Total [baseline] (10.965 s) : 0, 10965282
Agent [candidate] (1.172 s) : 0, 1172389
Total [candidate] (11.029 s) : 0, 11029216
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.012 s -
Agent appsec 1.184 s 172.49 ms (17.0%)
Agent iast 1.146 s 134.164 ms (13.3%)
Agent profiling 1.152 s 140.093 ms (13.8%)
Total tracing 10.755 s -
Total appsec 11.08 s 324.913 ms (3.0%)
Total iast 10.999 s 243.678 ms (2.3%)
Total profiling 10.965 s 210.138 ms (2.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.022 s -
Agent appsec 1.189 s 167.619 ms (16.4%)
Agent iast 1.168 s 146.387 ms (14.3%)
Agent profiling 1.172 s 150.632 ms (14.7%)
Total tracing 10.637 s -
Total appsec 10.916 s 279.682 ms (2.6%)
Total iast 11.097 s 460.276 ms (4.3%)
Total profiling 11.029 s 392.563 ms (3.7%)
gantt
    title petclinic - break down per module: candidate=1.54.0-SNAPSHOT~ad8190f8ca, baseline=1.54.0-SNAPSHOT~61c2d97420

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.468 ms) : 0, 1468
crashtracking [candidate] (1.454 ms) : 0, 1454
BytebuddyAgent [baseline] (692.684 ms) : 0, 692684
BytebuddyAgent [candidate] (689.431 ms) : 0, 689431
GlobalTracer [baseline] (248.948 ms) : 0, 248948
GlobalTracer [candidate] (258.305 ms) : 0, 258305
AppSec [baseline] (31.413 ms) : 0, 31413
AppSec [candidate] (31.182 ms) : 0, 31182
Debugger [baseline] (6.492 ms) : 0, 6492
Debugger [candidate] (6.363 ms) : 0, 6363
Remote Config [baseline] (706.816 µs) : 0, 707
Remote Config [candidate] (679.466 µs) : 0, 679
Telemetry [baseline] (9.085 ms) : 0, 9085
Telemetry [candidate] (13.285 ms) : 0, 13285
section appsec
crashtracking [baseline] (1.461 ms) : 0, 1461
crashtracking [candidate] (1.452 ms) : 0, 1452
BytebuddyAgent [baseline] (710.074 ms) : 0, 710074
BytebuddyAgent [candidate] (712.628 ms) : 0, 712628
GlobalTracer [baseline] (239.101 ms) : 0, 239101
GlobalTracer [candidate] (251.155 ms) : 0, 251155
IAST [baseline] (24.625 ms) : 0, 24625
IAST [candidate] (24.75 ms) : 0, 24750
AppSec [baseline] (171.572 ms) : 0, 171572
AppSec [candidate] (163.216 ms) : 0, 163216
Debugger [baseline] (7.528 ms) : 0, 7528
Debugger [candidate] (6.028 ms) : 0, 6028
Remote Config [baseline] (631.063 µs) : 0, 631
Remote Config [candidate] (642.547 µs) : 0, 643
Telemetry [baseline] (8.367 ms) : 0, 8367
Telemetry [candidate] (8.527 ms) : 0, 8527
section iast
crashtracking [baseline] (1.456 ms) : 0, 1456
crashtracking [candidate] (1.471 ms) : 0, 1471
BytebuddyAgent [baseline] (810.627 ms) : 0, 810627
BytebuddyAgent [candidate] (819.426 ms) : 0, 819426
GlobalTracer [baseline] (237.335 ms) : 0, 237335
GlobalTracer [candidate] (250.403 ms) : 0, 250403
IAST [baseline] (26.313 ms) : 0, 26313
IAST [candidate] (27.766 ms) : 0, 27766
AppSec [baseline] (34.064 ms) : 0, 34064
AppSec [candidate] (28.371 ms) : 0, 28371
Debugger [baseline] (6.02 ms) : 0, 6020
Debugger [candidate] (6.27 ms) : 0, 6270
Remote Config [baseline] (587.132 µs) : 0, 587
Remote Config [candidate] (612.683 µs) : 0, 613
Telemetry [baseline] (8.314 ms) : 0, 8314
Telemetry [candidate] (8.365 ms) : 0, 8365
section profiling
crashtracking [baseline] (1.45 ms) : 0, 1450
crashtracking [candidate] (1.441 ms) : 0, 1441
BytebuddyAgent [baseline] (718.558 ms) : 0, 718558
BytebuddyAgent [candidate] (719.405 ms) : 0, 719405
GlobalTracer [baseline] (223.686 ms) : 0, 223686
GlobalTracer [candidate] (234.669 ms) : 0, 234669
AppSec [baseline] (31.299 ms) : 0, 31299
AppSec [candidate] (31.421 ms) : 0, 31421
Debugger [baseline] (7.292 ms) : 0, 7292
Debugger [candidate] (8.197 ms) : 0, 8197
Remote Config [baseline] (717.646 µs) : 0, 718
Remote Config [candidate] (687.739 µs) : 0, 688
Telemetry [baseline] (15.607 ms) : 0, 15607
Telemetry [candidate] (15.001 ms) : 0, 15001
ProfilingAgent [baseline] (101.14 ms) : 0, 101140
ProfilingAgent [candidate] (109.109 ms) : 0, 109109
Profiling [baseline] (101.753 ms) : 0, 101753
Profiling [candidate] (109.843 ms) : 0, 109843
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master rachel.yang/knuth-sampling-tag
git_commit_date 1758822615 1758827491
git_commit_sha 61c2d97 ad8190f
release_version 1.54.0-SNAPSHOT~61c2d97420 1.54.0-SNAPSHOT~ad8190f8ca
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1758829000 1758829000
ci_job_id 1148530624 1148530624
ci_pipeline_id 77577212 77577212
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-yrqrn7g9 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-yrqrn7g9 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 3 performance improvements and 3 performance regressions! Performance is the same for 6 metrics, 12 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:high_load worse
[+312.280µs; +659.768µs] or [+3.321%; +7.017%]
unstable
[-86.321op/s; +37.759op/s] or [-17.478%; +7.645%]
9.889ms 469.594op/s 9.403ms 493.875op/s
scenario:load:petclinic:code_origins:high_load better
[-2.264ms; -1.476ms] or [-5.008%; -3.265%]
unstable
[-3.261op/s; +12.236op/s] or [-3.152%; +11.828%]
43.340ms 107.938op/s 45.210ms 103.450op/s
scenario:load:petclinic:tracing:high_load better
[-2.482ms; -1.658ms] or [-5.386%; -3.597%]
unstable
[-3.209op/s; +12.659op/s] or [-3.161%; +12.469%]
44.019ms 106.250op/s 46.089ms 101.525op/s
scenario:load:petclinic:iast:high_load better
[-2.060ms; -1.225ms] or [-4.578%; -2.723%]
unstable
[-4.157op/s; +12.032op/s] or [-3.997%; +11.569%]
43.347ms 107.938op/s 44.989ms 104.000op/s
scenario:load:petclinic:profiling:high_load worse
[+1.210ms; +2.154ms] or [+2.583%; +4.597%]
unstable
[-10.957op/s; +4.057op/s] or [-10.972%; +4.063%]
48.534ms 96.412op/s 46.852ms 99.862op/s
scenario:load:petclinic:appsec:high_load worse
[+1.695ms; +2.647ms] or [+3.493%; +5.457%]
unstable
[-11.457op/s; +3.232op/s] or [-11.877%; +3.351%]
50.690ms 92.350op/s 48.519ms 96.463op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~ad8190f8ca, baseline=1.54.0-SNAPSHOT~61c2d97420
    dateFormat X
    axisFormat %s
section baseline
no_agent (37.55 ms) : 37245, 37855
.   : milestone, 37550,
appsec (48.519 ms) : 48094, 48943
.   : milestone, 48519,
code_origins (45.21 ms) : 44827, 45593
.   : milestone, 45210,
iast (44.989 ms) : 44602, 45376
.   : milestone, 44989,
profiling (46.852 ms) : 46449, 47254
.   : milestone, 46852,
tracing (46.089 ms) : 45699, 46478
.   : milestone, 46089,
section candidate
no_agent (37.217 ms) : 36909, 37524
.   : milestone, 37217,
appsec (50.69 ms) : 50229, 51150
.   : milestone, 50690,
code_origins (43.34 ms) : 42991, 43688
.   : milestone, 43340,
iast (43.347 ms) : 42958, 43735
.   : milestone, 43347,
profiling (48.534 ms) : 48062, 49006
.   : milestone, 48534,
tracing (44.019 ms) : 43642, 44395
.   : milestone, 44019,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.55 ms [37.245 ms, 37.855 ms] -
appsec 48.519 ms [48.094 ms, 48.943 ms] 10.968 ms (29.2%)
code_origins 45.21 ms [44.827 ms, 45.593 ms] 7.66 ms (20.4%)
iast 44.989 ms [44.602 ms, 45.376 ms] 7.439 ms (19.8%)
profiling 46.852 ms [46.449 ms, 47.254 ms] 9.302 ms (24.8%)
tracing 46.089 ms [45.699 ms, 46.478 ms] 8.539 ms (22.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.217 ms [36.909 ms, 37.524 ms] -
appsec 50.69 ms [50.229 ms, 51.15 ms] 13.473 ms (36.2%)
code_origins 43.34 ms [42.991 ms, 43.688 ms] 6.123 ms (16.5%)
iast 43.347 ms [42.958 ms, 43.735 ms] 6.13 ms (16.5%)
profiling 48.534 ms [48.062 ms, 49.006 ms] 11.317 ms (30.4%)
tracing 44.019 ms [43.642 ms, 44.395 ms] 6.802 ms (18.3%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~ad8190f8ca, baseline=1.54.0-SNAPSHOT~61c2d97420
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.408 ms) : 4359, 4457
.   : milestone, 4408,
iast (9.403 ms) : 9247, 9559
.   : milestone, 9403,
iast_FULL (14.554 ms) : 14255, 14852
.   : milestone, 14554,
iast_GLOBAL (11.319 ms) : 11116, 11522
.   : milestone, 11319,
profiling (8.828 ms) : 8689, 8968
.   : milestone, 8828,
tracing (7.925 ms) : 7810, 8041
.   : milestone, 7925,
section candidate
no_agent (4.283 ms) : 4231, 4336
.   : milestone, 4283,
iast (9.889 ms) : 9722, 10056
.   : milestone, 9889,
iast_FULL (14.079 ms) : 13796, 14363
.   : milestone, 14079,
iast_GLOBAL (11.208 ms) : 11002, 11415
.   : milestone, 11208,
profiling (9.151 ms) : 9007, 9296
.   : milestone, 9151,
tracing (7.763 ms) : 7645, 7881
.   : milestone, 7763,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.408 ms [4.359 ms, 4.457 ms] -
iast 9.403 ms [9.247 ms, 9.559 ms] 4.995 ms (113.3%)
iast_FULL 14.554 ms [14.255 ms, 14.852 ms] 10.146 ms (230.2%)
iast_GLOBAL 11.319 ms [11.116 ms, 11.522 ms] 6.911 ms (156.8%)
profiling 8.828 ms [8.689 ms, 8.968 ms] 4.421 ms (100.3%)
tracing 7.925 ms [7.81 ms, 8.041 ms] 3.517 ms (79.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.283 ms [4.231 ms, 4.336 ms] -
iast 9.889 ms [9.722 ms, 10.056 ms] 5.606 ms (130.9%)
iast_FULL 14.079 ms [13.796 ms, 14.363 ms] 9.796 ms (228.7%)
iast_GLOBAL 11.208 ms [11.002 ms, 11.415 ms] 6.925 ms (161.7%)
profiling 9.151 ms [9.007 ms, 9.296 ms] 4.868 ms (113.7%)
tracing 7.763 ms [7.645 ms, 7.881 ms] 3.48 ms (81.2%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master rachel.yang/knuth-sampling-tag
git_commit_date 1758822615 1758827491
git_commit_sha 61c2d97 ad8190f
release_version 1.54.0-SNAPSHOT~61c2d97420 1.54.0-SNAPSHOT~ad8190f8ca
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1758829528 1758829528
ci_job_id 1148530625 1148530625
ci_pipeline_id 77577212 77577212
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-2-1m8hu4u7 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-2-1m8hu4u7 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

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

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~ad8190f8ca, baseline=1.54.0-SNAPSHOT~61c2d97420
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.68 s) : 14680000, 14680000
.   : milestone, 14680000,
appsec (15.005 s) : 15005000, 15005000
.   : milestone, 15005000,
iast (18.912 s) : 18912000, 18912000
.   : milestone, 18912000,
iast_GLOBAL (17.632 s) : 17632000, 17632000
.   : milestone, 17632000,
profiling (15.194 s) : 15194000, 15194000
.   : milestone, 15194000,
tracing (14.963 s) : 14963000, 14963000
.   : milestone, 14963000,
section candidate
no_agent (14.953 s) : 14953000, 14953000
.   : milestone, 14953000,
appsec (15.218 s) : 15218000, 15218000
.   : milestone, 15218000,
iast (18.424 s) : 18424000, 18424000
.   : milestone, 18424000,
iast_GLOBAL (18.22 s) : 18220000, 18220000
.   : milestone, 18220000,
profiling (15.386 s) : 15386000, 15386000
.   : milestone, 15386000,
tracing (15.063 s) : 15063000, 15063000
.   : milestone, 15063000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.68 s [14.68 s, 14.68 s] -
appsec 15.005 s [15.005 s, 15.005 s] 325.0 ms (2.2%)
iast 18.912 s [18.912 s, 18.912 s] 4.232 s (28.8%)
iast_GLOBAL 17.632 s [17.632 s, 17.632 s] 2.952 s (20.1%)
profiling 15.194 s [15.194 s, 15.194 s] 514.0 ms (3.5%)
tracing 14.963 s [14.963 s, 14.963 s] 283.0 ms (1.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.953 s [14.953 s, 14.953 s] -
appsec 15.218 s [15.218 s, 15.218 s] 265.0 ms (1.8%)
iast 18.424 s [18.424 s, 18.424 s] 3.471 s (23.2%)
iast_GLOBAL 18.22 s [18.22 s, 18.22 s] 3.267 s (21.8%)
profiling 15.386 s [15.386 s, 15.386 s] 433.0 ms (2.9%)
tracing 15.063 s [15.063 s, 15.063 s] 110.0 ms (0.7%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~ad8190f8ca, baseline=1.54.0-SNAPSHOT~61c2d97420
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.479 ms) : 1467, 1491
.   : milestone, 1479,
appsec (3.738 ms) : 3521, 3956
.   : milestone, 3738,
iast (2.208 ms) : 2144, 2271
.   : milestone, 2208,
iast_GLOBAL (2.252 ms) : 2188, 2316
.   : milestone, 2252,
profiling (2.038 ms) : 1988, 2088
.   : milestone, 2038,
tracing (2.011 ms) : 1962, 2061
.   : milestone, 2011,
section candidate
no_agent (1.478 ms) : 1467, 1490
.   : milestone, 1478,
appsec (3.717 ms) : 3502, 3932
.   : milestone, 3717,
iast (2.208 ms) : 2145, 2271
.   : milestone, 2208,
iast_GLOBAL (2.247 ms) : 2184, 2310
.   : milestone, 2247,
profiling (2.07 ms) : 2017, 2122
.   : milestone, 2070,
tracing (2.029 ms) : 1979, 2078
.   : milestone, 2029,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.479 ms [1.467 ms, 1.491 ms] -
appsec 3.738 ms [3.521 ms, 3.956 ms] 2.259 ms (152.7%)
iast 2.208 ms [2.144 ms, 2.271 ms] 728.699 µs (49.3%)
iast_GLOBAL 2.252 ms [2.188 ms, 2.316 ms] 772.804 µs (52.2%)
profiling 2.038 ms [1.988 ms, 2.088 ms] 558.682 µs (37.8%)
tracing 2.011 ms [1.962 ms, 2.061 ms] 532.331 µs (36.0%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.478 ms [1.467 ms, 1.49 ms] -
appsec 3.717 ms [3.502 ms, 3.932 ms] 2.239 ms (151.4%)
iast 2.208 ms [2.145 ms, 2.271 ms] 729.868 µs (49.4%)
iast_GLOBAL 2.247 ms [2.184 ms, 2.31 ms] 768.609 µs (52.0%)
profiling 2.07 ms [2.017 ms, 2.122 ms] 591.11 µs (40.0%)
tracing 2.029 ms [1.979 ms, 2.078 ms] 550.248 µs (37.2%)

return span.getTag("env", "");
}

private String formatKnuthSamplingRate(double rate) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should centralize this logic. Currently we define this function in two places


private String formatKnuthSamplingRate(double rate) {
// Format to up to 6 decimal places, removing trailing zeros
return DECIMAL_FORMAT.format(rate);
Copy link
Contributor

Choose a reason for hiding this comment

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

Quick heads-up that java.text.DecimalFormat.format(...) is not thread-safe: https://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html#synchronization

But adding synchronization here would kill performance....

One option could be to write our own simple formatter, since we just want to truncate the value - for example, if we assume the value is between 0 and 1, a naive solution might be:

  private static String example(double value) {
    if (value <= 0) {
      return "0";
    } else if (value >= 1) {
      return "1";
    } else {
      return "0." + (int) (value * 1_000_000 + 0.5);
    }
  }

( you'd need to write tests to verify this behaves as expected - but you'd need to do that anyway :)

Also note you don't need to do the formatting every time the sampling rate is applied because each RateSampler is deterministic: https://github.com/DataDog/dd-trace-java/blob/master/dd-trace-core/src/main/java/datadog/trace/common/sampling/DeterministicSampler.java#L41

In other words, the sample rate for each individual RateSampler is fixed at construct time - so you could add a String getKnuthSampleRate() or similar method to RateSampler and then do the formatting once in the DeterministicSampler constructor and save it as a String field alongside the rate, at which point setting the tag just involves calling getKnuthSampleRate() to get the pre-formatted string.

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.

3 participants