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

Instrument Java Websocket API (JSR356) #8440

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

Conversation

amarziali
Copy link
Collaborator

@amarziali amarziali commented Feb 24, 2025

What Does This Do

Instrumenter module for javax.websocket and jakarta.websocket APIs. Supports both client and server API.

Provides spans for:

  • Message send (websocket.send)
  • Message receive (websocket.receive)
  • Connection close (websocket.close)

Tested with

  • Tyrus (reference implementation)
  • Tomcat 8+
  • Jetty 9+
  • Undertow
  • Spring boot via WebsocketHandler (tomcat based. netty websockets are not yet implemented since not implementing this API)

Limitations

  • POJO based endpoints are not supported in jetty since jetty does not build adapters on top of Endpoint class but direct calls annotated methods via MethodHandler. An additional work is still needed to support them
  • Client API implementations not completely tested

Motivation

Additional Notes

Contributor Checklist

Jira ticket: AIDM-535

@pr-commenter
Copy link

pr-commenter bot commented Feb 24, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/jsr356
git_commit_date 1741182994 1741191681
git_commit_sha 6055d50 700b1c3
release_version 1.48.0-SNAPSHOT~6055d50b80 1.48.0-SNAPSHOT~700b1c341a
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1741194146 1741194146
ci_job_id 834073063 834073063
ci_pipeline_id 57813275 57813275
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-tehyzuc2-project-304-concurrent-1-1htl7uk6 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Linux runner-tehyzuc2-project-304-concurrent-1-1htl7uk6 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.48.0-SNAPSHOT~700b1c341a, baseline=1.48.0-SNAPSHOT~6055d50b80

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.039 s) : 0, 1038650
Total [baseline] (8.701 s) : 0, 8701130
Agent [candidate] (1.042 s) : 0, 1042154
Total [candidate] (8.65 s) : 0, 8650428
section iast
Agent [baseline] (1.173 s) : 0, 1172863
Total [baseline] (9.309 s) : 0, 9308892
Agent [candidate] (1.173 s) : 0, 1173480
Total [candidate] (9.249 s) : 0, 9248844
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.169 s) : 0, 1168826
Total [baseline] (9.162 s) : 0, 9162101
Agent [candidate] (1.172 s) : 0, 1172317
Total [candidate] (9.215 s) : 0, 9215359
section iast_TELEMETRY_OFF
Agent [baseline] (1.174 s) : 0, 1173966
Total [baseline] (9.255 s) : 0, 9254688
Agent [candidate] (1.169 s) : 0, 1168570
Total [candidate] (9.218 s) : 0, 9218188
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.039 s -
Agent iast 1.173 s 134.213 ms (12.9%)
Agent iast_HARDCODED_SECRET_DISABLED 1.169 s 130.176 ms (12.5%)
Agent iast_TELEMETRY_OFF 1.174 s 135.316 ms (13.0%)
Total tracing 8.701 s -
Total iast 9.309 s 607.761 ms (7.0%)
Total iast_HARDCODED_SECRET_DISABLED 9.162 s 460.971 ms (5.3%)
Total iast_TELEMETRY_OFF 9.255 s 553.558 ms (6.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.042 s -
Agent iast 1.173 s 131.326 ms (12.6%)
Agent iast_HARDCODED_SECRET_DISABLED 1.172 s 130.162 ms (12.5%)
Agent iast_TELEMETRY_OFF 1.169 s 126.416 ms (12.1%)
Total tracing 8.65 s -
Total iast 9.249 s 598.415 ms (6.9%)
Total iast_HARDCODED_SECRET_DISABLED 9.215 s 564.931 ms (6.5%)
Total iast_TELEMETRY_OFF 9.218 s 567.76 ms (6.6%)
gantt
    title insecure-bank - break down per module: candidate=1.48.0-SNAPSHOT~700b1c341a, baseline=1.48.0-SNAPSHOT~6055d50b80

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (718.002 ms) : 0, 718002
BytebuddyAgent [candidate] (719.381 ms) : 0, 719381
GlobalTracer [baseline] (240.265 ms) : 0, 240265
GlobalTracer [candidate] (239.968 ms) : 0, 239968
AppSec [baseline] (55.45 ms) : 0, 55450
AppSec [candidate] (55.098 ms) : 0, 55098
Remote Config [baseline] (689.361 µs) : 0, 689
Remote Config [candidate] (687.012 µs) : 0, 687
Telemetry [baseline] (9.34 ms) : 0, 9340
Telemetry [candidate] (12.102 ms) : 0, 12102
section iast
BytebuddyAgent [baseline] (836.677 ms) : 0, 836677
BytebuddyAgent [candidate] (839.451 ms) : 0, 839451
GlobalTracer [baseline] (231.602 ms) : 0, 231602
GlobalTracer [candidate] (230.355 ms) : 0, 230355
IAST [baseline] (23.053 ms) : 0, 23053
IAST [candidate] (22.818 ms) : 0, 22818
AppSec [baseline] (57.185 ms) : 0, 57185
AppSec [candidate] (56.609 ms) : 0, 56609
Remote Config [baseline] (622.636 µs) : 0, 623
Remote Config [candidate] (607.241 µs) : 0, 607
Telemetry [baseline] (8.838 ms) : 0, 8838
Telemetry [candidate] (8.695 ms) : 0, 8695
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (835.545 ms) : 0, 835545
BytebuddyAgent [candidate] (838.087 ms) : 0, 838087
GlobalTracer [baseline] (229.856 ms) : 0, 229856
GlobalTracer [candidate] (230.743 ms) : 0, 230743
IAST [baseline] (23.543 ms) : 0, 23543
IAST [candidate] (22.832 ms) : 0, 22832
AppSec [baseline] (55.589 ms) : 0, 55589
AppSec [candidate] (56.486 ms) : 0, 56486
Remote Config [baseline] (609.674 µs) : 0, 610
Remote Config [candidate] (613.099 µs) : 0, 613
Telemetry [baseline] (8.725 ms) : 0, 8725
Telemetry [candidate] (8.66 ms) : 0, 8660
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (838.897 ms) : 0, 838897
BytebuddyAgent [candidate] (834.969 ms) : 0, 834969
GlobalTracer [baseline] (231.666 ms) : 0, 231666
GlobalTracer [candidate] (230.402 ms) : 0, 230402
IAST [baseline] (22.321 ms) : 0, 22321
IAST [candidate] (22.307 ms) : 0, 22307
AppSec [baseline] (56.699 ms) : 0, 56699
AppSec [candidate] (56.848 ms) : 0, 56848
Remote Config [baseline] (610.377 µs) : 0, 610
Remote Config [candidate] (621.287 µs) : 0, 621
Telemetry [baseline] (8.654 ms) : 0, 8654
Telemetry [candidate] (8.555 ms) : 0, 8555
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.48.0-SNAPSHOT~700b1c341a, baseline=1.48.0-SNAPSHOT~6055d50b80

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.042 s) : 0, 1041809
Total [baseline] (10.482 s) : 0, 10481645
Agent [candidate] (1.047 s) : 0, 1046529
Total [candidate] (10.509 s) : 0, 10509490
section appsec
Agent [baseline] (1.188 s) : 0, 1187651
Total [baseline] (10.743 s) : 0, 10742917
Agent [candidate] (1.187 s) : 0, 1186918
Total [candidate] (10.794 s) : 0, 10793677
section iast
Agent [baseline] (1.178 s) : 0, 1177676
Total [baseline] (10.991 s) : 0, 10990942
Agent [candidate] (1.171 s) : 0, 1170649
Total [candidate] (11.029 s) : 0, 11028756
section profiling
Agent [baseline] (1.259 s) : 0, 1259258
Total [baseline] (10.795 s) : 0, 10795018
Agent [candidate] (1.258 s) : 0, 1257986
Total [candidate] (10.802 s) : 0, 10801931
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.042 s -
Agent appsec 1.188 s 145.842 ms (14.0%)
Agent iast 1.178 s 135.867 ms (13.0%)
Agent profiling 1.259 s 217.449 ms (20.9%)
Total tracing 10.482 s -
Total appsec 10.743 s 261.273 ms (2.5%)
Total iast 10.991 s 509.298 ms (4.9%)
Total profiling 10.795 s 313.373 ms (3.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.047 s -
Agent appsec 1.187 s 140.389 ms (13.4%)
Agent iast 1.171 s 124.12 ms (11.9%)
Agent profiling 1.258 s 211.457 ms (20.2%)
Total tracing 10.509 s -
Total appsec 10.794 s 284.187 ms (2.7%)
Total iast 11.029 s 519.266 ms (4.9%)
Total profiling 10.802 s 292.441 ms (2.8%)
gantt
    title petclinic - break down per module: candidate=1.48.0-SNAPSHOT~700b1c341a, baseline=1.48.0-SNAPSHOT~6055d50b80

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (718.546 ms) : 0, 718546
BytebuddyAgent [candidate] (722.086 ms) : 0, 722086
GlobalTracer [baseline] (239.581 ms) : 0, 239581
GlobalTracer [candidate] (241.064 ms) : 0, 241064
AppSec [baseline] (55.263 ms) : 0, 55263
AppSec [candidate] (55.383 ms) : 0, 55383
Remote Config [baseline] (685.373 µs) : 0, 685
Remote Config [candidate] (694.091 µs) : 0, 694
Telemetry [baseline] (12.772 ms) : 0, 12772
Telemetry [candidate] (12.281 ms) : 0, 12281
section appsec
BytebuddyAgent [baseline] (738.942 ms) : 0, 738942
BytebuddyAgent [candidate] (738.347 ms) : 0, 738347
GlobalTracer [baseline] (236.877 ms) : 0, 236877
GlobalTracer [candidate] (237.276 ms) : 0, 237276
AppSec [baseline] (177.153 ms) : 0, 177153
AppSec [candidate] (176.271 ms) : 0, 176271
Remote Config [baseline] (662.062 µs) : 0, 662
Remote Config [candidate] (657.616 µs) : 0, 658
Telemetry [baseline] (8.278 ms) : 0, 8278
Telemetry [candidate] (8.689 ms) : 0, 8689
IAST [baseline] (21.47 ms) : 0, 21470
IAST [candidate] (21.423 ms) : 0, 21423
section iast
BytebuddyAgent [baseline] (842.165 ms) : 0, 842165
BytebuddyAgent [candidate] (837.151 ms) : 0, 837151
GlobalTracer [baseline] (231.165 ms) : 0, 231165
GlobalTracer [candidate] (230.126 ms) : 0, 230126
AppSec [baseline] (56.052 ms) : 0, 56052
AppSec [candidate] (56.568 ms) : 0, 56568
Remote Config [baseline] (614.976 µs) : 0, 615
Remote Config [candidate] (601.011 µs) : 0, 601
Telemetry [baseline] (8.753 ms) : 0, 8753
Telemetry [candidate] (8.642 ms) : 0, 8642
IAST [baseline] (23.874 ms) : 0, 23874
IAST [candidate] (22.601 ms) : 0, 22601
section profiling
BytebuddyAgent [baseline] (709.769 ms) : 0, 709769
BytebuddyAgent [candidate] (708.682 ms) : 0, 708682
GlobalTracer [baseline] (348.752 ms) : 0, 348752
GlobalTracer [candidate] (349.405 ms) : 0, 349405
AppSec [baseline] (54.852 ms) : 0, 54852
AppSec [candidate] (53.821 ms) : 0, 53821
Remote Config [baseline] (674.229 µs) : 0, 674
Remote Config [candidate] (669.983 µs) : 0, 670
Telemetry [baseline] (8.955 ms) : 0, 8955
Telemetry [candidate] (8.856 ms) : 0, 8856
ProfilingAgent [baseline] (95.879 ms) : 0, 95879
ProfilingAgent [candidate] (96.164 ms) : 0, 96164
Profiling [baseline] (95.903 ms) : 0, 95903
Profiling [candidate] (96.188 ms) : 0, 96188
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-03-05T16:32:35 2025-03-05T16:40:21
git_branch master andrea.marziali/jsr356
git_commit_date 1741182994 1741191681
git_commit_sha 6055d50 700b1c3
release_version 1.48.0-SNAPSHOT~6055d50b80 1.48.0-SNAPSHOT~700b1c341a
start_time 2025-03-05T16:32:21 2025-03-05T16:40:06
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1741193221 1741193221
ci_job_id 834073064 834073064
ci_pipeline_id 57813275 57813275
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-tehyzuc2-project-304-concurrent-3-l331dyks 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Linux runner-tehyzuc2-project-304-concurrent-3-l331dyks 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
variant iast iast

Summary

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

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~700b1c341a, baseline=1.48.0-SNAPSHOT~6055d50b80
    dateFormat X
    axisFormat %s
section baseline
no_agent (382.102 µs) : 362, 402
.   : milestone, 382,
iast (516.934 µs) : 495, 539
.   : milestone, 517,
iast_FULL (733.47 µs) : 711, 756
.   : milestone, 733,
iast_GLOBAL (557.08 µs) : 535, 579
.   : milestone, 557,
iast_HARDCODED_SECRET_DISABLED (521.222 µs) : 499, 544
.   : milestone, 521,
iast_INACTIVE (473.384 µs) : 451, 496
.   : milestone, 473,
iast_TELEMETRY_OFF (510.493 µs) : 487, 534
.   : milestone, 510,
tracing (465.289 µs) : 444, 486
.   : milestone, 465,
section candidate
no_agent (385.448 µs) : 365, 406
.   : milestone, 385,
iast (518.424 µs) : 497, 540
.   : milestone, 518,
iast_FULL (740.665 µs) : 719, 763
.   : milestone, 741,
iast_GLOBAL (565.355 µs) : 543, 588
.   : milestone, 565,
iast_HARDCODED_SECRET_DISABLED (525.582 µs) : 503, 548
.   : milestone, 526,
iast_INACTIVE (473.14 µs) : 452, 495
.   : milestone, 473,
iast_TELEMETRY_OFF (514.538 µs) : 491, 538
.   : milestone, 515,
tracing (460.98 µs) : 440, 482
.   : milestone, 461,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 382.102 µs [362.294 µs, 401.91 µs] -
iast 516.934 µs [495.244 µs, 538.623 µs] 134.832 µs (35.3%)
iast_FULL 733.47 µs [711.421 µs, 755.519 µs] 351.368 µs (92.0%)
iast_GLOBAL 557.08 µs [535.458 µs, 578.701 µs] 174.978 µs (45.8%)
iast_HARDCODED_SECRET_DISABLED 521.222 µs [498.902 µs, 543.542 µs] 139.12 µs (36.4%)
iast_INACTIVE 473.384 µs [451.226 µs, 495.543 µs] 91.283 µs (23.9%)
iast_TELEMETRY_OFF 510.493 µs [487.196 µs, 533.79 µs] 128.391 µs (33.6%)
tracing 465.289 µs [444.218 µs, 486.361 µs] 83.187 µs (21.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 385.448 µs [365.348 µs, 405.548 µs] -
iast 518.424 µs [496.677 µs, 540.172 µs] 132.977 µs (34.5%)
iast_FULL 740.665 µs [718.803 µs, 762.527 µs] 355.218 µs (92.2%)
iast_GLOBAL 565.355 µs [542.888 µs, 587.821 µs] 179.907 µs (46.7%)
iast_HARDCODED_SECRET_DISABLED 525.582 µs [503.376 µs, 547.789 µs] 140.135 µs (36.4%)
iast_INACTIVE 473.14 µs [451.767 µs, 494.512 µs] 87.692 µs (22.8%)
iast_TELEMETRY_OFF 514.538 µs [491.413 µs, 537.664 µs] 129.091 µs (33.5%)
tracing 460.98 µs [440.409 µs, 481.551 µs] 75.533 µs (19.6%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~700b1c341a, baseline=1.48.0-SNAPSHOT~6055d50b80
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.378 ms) : 1359, 1398
.   : milestone, 1378,
appsec (1.739 ms) : 1715, 1763
.   : milestone, 1739,
appsec_no_iast (1.729 ms) : 1704, 1754
.   : milestone, 1729,
code_origins (1.674 ms) : 1641, 1706
.   : milestone, 1674,
iast (1.526 ms) : 1502, 1550
.   : milestone, 1526,
profiling (1.504 ms) : 1481, 1528
.   : milestone, 1504,
tracing (1.494 ms) : 1469, 1519
.   : milestone, 1494,
section candidate
no_agent (1.37 ms) : 1350, 1390
.   : milestone, 1370,
appsec (1.738 ms) : 1713, 1762
.   : milestone, 1738,
appsec_no_iast (1.741 ms) : 1716, 1765
.   : milestone, 1741,
code_origins (1.696 ms) : 1662, 1730
.   : milestone, 1696,
iast (1.502 ms) : 1478, 1527
.   : milestone, 1502,
profiling (1.53 ms) : 1506, 1553
.   : milestone, 1530,
tracing (1.479 ms) : 1454, 1505
.   : milestone, 1479,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.378 ms [1.359 ms, 1.398 ms] -
appsec 1.739 ms [1.715 ms, 1.763 ms] 361.055 µs (26.2%)
appsec_no_iast 1.729 ms [1.704 ms, 1.754 ms] 350.36 µs (25.4%)
code_origins 1.674 ms [1.641 ms, 1.706 ms] 295.31 µs (21.4%)
iast 1.526 ms [1.502 ms, 1.55 ms] 147.756 µs (10.7%)
profiling 1.504 ms [1.481 ms, 1.528 ms] 126.103 µs (9.1%)
tracing 1.494 ms [1.469 ms, 1.519 ms] 115.739 µs (8.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.37 ms [1.35 ms, 1.39 ms] -
appsec 1.738 ms [1.713 ms, 1.762 ms] 367.877 µs (26.9%)
appsec_no_iast 1.741 ms [1.716 ms, 1.765 ms] 370.808 µs (27.1%)
code_origins 1.696 ms [1.662 ms, 1.73 ms] 325.892 µs (23.8%)
iast 1.502 ms [1.478 ms, 1.527 ms] 132.685 µs (9.7%)
profiling 1.53 ms [1.506 ms, 1.553 ms] 159.817 µs (11.7%)
tracing 1.479 ms [1.454 ms, 1.505 ms] 109.522 µs (8.0%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/jsr356
git_commit_date 1741182994 1741191681
git_commit_sha 6055d50 700b1c3
release_version 1.48.0-SNAPSHOT~6055d50b80 1.48.0-SNAPSHOT~700b1c341a
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1741193725 1741193725
ci_job_id 834073065 834073065
ci_pipeline_id 57813275 57813275
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-gnltaqnk-project-304-concurrent-0-qjic2wfg 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Linux runner-gnltaqnk-project-304-concurrent-0-qjic2wfg 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
variant appsec appsec

Summary

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

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~700b1c341a, baseline=1.48.0-SNAPSHOT~6055d50b80
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.925 s) : 14925000, 14925000
.   : milestone, 14925000,
appsec (15.312 s) : 15312000, 15312000
.   : milestone, 15312000,
iast (18.554 s) : 18554000, 18554000
.   : milestone, 18554000,
iast_GLOBAL (18.276 s) : 18276000, 18276000
.   : milestone, 18276000,
profiling (14.973 s) : 14973000, 14973000
.   : milestone, 14973000,
tracing (14.984 s) : 14984000, 14984000
.   : milestone, 14984000,
section candidate
no_agent (15.493 s) : 15493000, 15493000
.   : milestone, 15493000,
appsec (14.896 s) : 14896000, 14896000
.   : milestone, 14896000,
iast (18.873 s) : 18873000, 18873000
.   : milestone, 18873000,
iast_GLOBAL (17.756 s) : 17756000, 17756000
.   : milestone, 17756000,
profiling (15.01 s) : 15010000, 15010000
.   : milestone, 15010000,
tracing (14.928 s) : 14928000, 14928000
.   : milestone, 14928000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.925 s [14.925 s, 14.925 s] -
appsec 15.312 s [15.312 s, 15.312 s] 387.0 ms (2.6%)
iast 18.554 s [18.554 s, 18.554 s] 3.629 s (24.3%)
iast_GLOBAL 18.276 s [18.276 s, 18.276 s] 3.351 s (22.5%)
profiling 14.973 s [14.973 s, 14.973 s] 48.0 ms (0.3%)
tracing 14.984 s [14.984 s, 14.984 s] 59.0 ms (0.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.493 s [15.493 s, 15.493 s] -
appsec 14.896 s [14.896 s, 14.896 s] -597.0 ms (-3.9%)
iast 18.873 s [18.873 s, 18.873 s] 3.38 s (21.8%)
iast_GLOBAL 17.756 s [17.756 s, 17.756 s] 2.263 s (14.6%)
profiling 15.01 s [15.01 s, 15.01 s] -483.0 ms (-3.1%)
tracing 14.928 s [14.928 s, 14.928 s] -565.0 ms (-3.6%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~700b1c341a, baseline=1.48.0-SNAPSHOT~6055d50b80
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.467 ms) : 1455, 1478
.   : milestone, 1467,
appsec (2.333 ms) : 2290, 2376
.   : milestone, 2333,
iast (2.108 ms) : 2054, 2163
.   : milestone, 2108,
iast_GLOBAL (2.158 ms) : 2103, 2214
.   : milestone, 2158,
profiling (1.985 ms) : 1940, 2029
.   : milestone, 1985,
tracing (1.945 ms) : 1903, 1987
.   : milestone, 1945,
section candidate
no_agent (1.468 ms) : 1457, 1479
.   : milestone, 1468,
appsec (2.335 ms) : 2292, 2379
.   : milestone, 2335,
iast (2.111 ms) : 2056, 2167
.   : milestone, 2111,
iast_GLOBAL (2.159 ms) : 2104, 2215
.   : milestone, 2159,
profiling (1.957 ms) : 1913, 2000
.   : milestone, 1957,
tracing (1.943 ms) : 1901, 1985
.   : milestone, 1943,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.467 ms [1.455 ms, 1.478 ms] -
appsec 2.333 ms [2.29 ms, 2.376 ms] 866.206 µs (59.1%)
iast 2.108 ms [2.054 ms, 2.163 ms] 641.571 µs (43.7%)
iast_GLOBAL 2.158 ms [2.103 ms, 2.214 ms] 691.408 µs (47.1%)
profiling 1.985 ms [1.94 ms, 2.029 ms] 517.966 µs (35.3%)
tracing 1.945 ms [1.903 ms, 1.987 ms] 478.256 µs (32.6%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.468 ms [1.457 ms, 1.479 ms] -
appsec 2.335 ms [2.292 ms, 2.379 ms] 867.345 µs (59.1%)
iast 2.111 ms [2.056 ms, 2.167 ms] 643.389 µs (43.8%)
iast_GLOBAL 2.159 ms [2.104 ms, 2.215 ms] 691.231 µs (47.1%)
profiling 1.957 ms [1.913 ms, 2.0 ms] 488.563 µs (33.3%)
tracing 1.943 ms [1.901 ms, 1.985 ms] 474.829 µs (32.3%)

@amarziali amarziali force-pushed the andrea.marziali/jsr356 branch 4 times, most recently from b017c7b to 52d9691 Compare March 3, 2025 13:38
@amarziali amarziali marked this pull request as ready for review March 3, 2025 13:39
@amarziali amarziali requested review from a team as code owners March 3, 2025 13:39
@amarziali amarziali requested a review from ygree March 3, 2025 13:39
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

There are a lot of changes in this PR 😅
I will have a closer look the public and internal API later this week.

@amarziali amarziali force-pushed the andrea.marziali/jsr356 branch from 542304a to ab80d28 Compare March 4, 2025 09:34
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

Reviewed the API part and left some comments :)
Let me know if you need help with the OTel part.

private final Set<AgentSpanLink> assertedLinks = []

private LinksAssert(DDSpan span) {
this.links = span.links // this is class protected but for the moment groovy can access it
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it be left private? Can’t groovy access them when private too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let me check it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now I remember why. It does not work: (see that CI run)

It fails for

Caused by: groovy.lang.MissingPropertyException: No such property: links for class: datadog.trace.core.DDSpan$SpockMock$863262640

because that span it's got spied and then cannot be accessed if private. Any advice for it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just leave it as a comment with this reason.

@@ -107,7 +107,7 @@ static DDSpan create(
*/
private volatile int longRunningVersion = 0;

private final List<AgentSpanLink> links;
protected final List<AgentSpanLink> links;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it stay private? -- see related comment in SpanLinkTest

@@ -311,6 +311,7 @@ class OpenTelemetry14Test extends AgentTestRunner {
assertTraces(1) {
trace(1) {
span {
ignoreSpanLinks() // check is done on the content of the tag below
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need some help porting those checks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for proposing I don't refuse it :) I did this way mostly because here we wanted to check the serialized form so I just decided to skip them. Would you like to add the links part on this test?

assert span.tags.containsKey(DDTags.SPAN_LINKS)
assert span.tags[DDTags.SPAN_LINKS] != null
links({
link(DDTraceId.from((long)12052652441736835200), (long)-6394091631972716416)
Copy link
Contributor

Choose a reason for hiding this comment

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

Magic numbers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know where they come from 🤷 That trace ID is hardcoded somwhere so I had to hardcode it as well

Copy link
Contributor

@ygree ygree left a comment

Choose a reason for hiding this comment

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

Congratulations on putting it all together! That's a big one! Great to see a lot of tests as well. Overall looks solid. I left a few notes for clarification.

@amarziali amarziali force-pushed the andrea.marziali/jsr356 branch 2 times, most recently from cbd26e7 to 99e400b Compare March 5, 2025 09:55
@amarziali amarziali requested a review from ygree March 5, 2025 09:58
@amarziali amarziali force-pushed the andrea.marziali/jsr356 branch from 22ce86b to a947aef Compare March 5, 2025 12:41
@amarziali amarziali force-pushed the andrea.marziali/jsr356 branch from a947aef to 700b1c3 Compare March 5, 2025 16:21
Copy link
Contributor

@ygree ygree left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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

Successfully merging this pull request may close these issues.

3 participants