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 basic Scala Weaver sbt support #8189

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

daniel-mohedano
Copy link
Contributor

@daniel-mohedano daniel-mohedano commented Jan 13, 2025

What Does This Do

Adds support for Scala Weaver testing framework (using sbt) to CI Visibility.

Motivation

There is a feature request.

Additional Notes

Contributor Checklist

Jira ticket: SDTEST-1439

Comment on lines 15 to 19
public TaskDefAwareQueueProxy(TaskDef taskDef, ConcurrentLinkedQueue<T> delegate) {
this.taskDef = taskDef;
this.delegate = delegate;
DatadogWeaverReporter.start();
}
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

Consider adding super() or this() to your constructor (...read more)

In Java, it is suggested to call super() in an extended class. This rule will report a violation if both a call to super() and an overloaded constructor are absent.

View in Datadog  Leave us feedback  Documentation

@daniel-mohedano daniel-mohedano added type: enhancement comp: ci visibility Continuous Integration Visibility labels Jan 13, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jan 13, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master daniel.mohedano/weaver-support
git_commit_date 1737025133 1737027043
git_commit_sha 296ed7b af56922
release_version 1.46.0-SNAPSHOT~296ed7bdd3 1.46.0-SNAPSHOT~af569223da
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1737029566 1737029566
ci_job_id 768776186 768776186
ci_pipeline_id 53170233 53170233
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 1 performance regressions! Performance is the same for 58 metrics, 4 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:petclinic:profiling:GlobalTracer worse
[+9.665ms; +21.588ms] or [+2.728%; +6.094%]
369.886ms 354.259ms
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~af569223da, baseline=1.46.0-SNAPSHOT~296ed7bdd3

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1063816
Total [baseline] (8.635 s) : 0, 8634646
Agent [candidate] (1.06 s) : 0, 1059693
Total [candidate] (8.63 s) : 0, 8630041
section iast
Agent [baseline] (1.181 s) : 0, 1181000
Total [baseline] (9.174 s) : 0, 9173789
Agent [candidate] (1.186 s) : 0, 1186164
Total [candidate] (9.255 s) : 0, 9254817
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.193 s) : 0, 1192734
Total [baseline] (9.214 s) : 0, 9213871
Agent [candidate] (1.183 s) : 0, 1182881
Total [candidate] (9.175 s) : 0, 9174564
section iast_TELEMETRY_OFF
Agent [baseline] (1.184 s) : 0, 1183917
Total [baseline] (9.239 s) : 0, 9239058
Agent [candidate] (1.18 s) : 0, 1179967
Total [candidate] (9.216 s) : 0, 9215545
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.064 s -
Agent iast 1.181 s 117.184 ms (11.0%)
Agent iast_HARDCODED_SECRET_DISABLED 1.193 s 128.917 ms (12.1%)
Agent iast_TELEMETRY_OFF 1.184 s 120.1 ms (11.3%)
Total tracing 8.635 s -
Total iast 9.174 s 539.143 ms (6.2%)
Total iast_HARDCODED_SECRET_DISABLED 9.214 s 579.225 ms (6.7%)
Total iast_TELEMETRY_OFF 9.239 s 604.413 ms (7.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent iast 1.186 s 126.471 ms (11.9%)
Agent iast_HARDCODED_SECRET_DISABLED 1.183 s 123.188 ms (11.6%)
Agent iast_TELEMETRY_OFF 1.18 s 120.273 ms (11.3%)
Total tracing 8.63 s -
Total iast 9.255 s 624.775 ms (7.2%)
Total iast_HARDCODED_SECRET_DISABLED 9.175 s 544.523 ms (6.3%)
Total iast_TELEMETRY_OFF 9.216 s 585.503 ms (6.8%)
gantt
    title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~af569223da, baseline=1.46.0-SNAPSHOT~296ed7bdd3

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (719.641 ms) : 0, 719641
BytebuddyAgent [candidate] (715.955 ms) : 0, 715955
GlobalTracer [baseline] (258.092 ms) : 0, 258092
GlobalTracer [candidate] (256.675 ms) : 0, 256675
AppSec [baseline] (56.441 ms) : 0, 56441
AppSec [candidate] (55.428 ms) : 0, 55428
Remote Config [baseline] (725.462 µs) : 0, 725
Remote Config [candidate] (716.629 µs) : 0, 717
Telemetry [baseline] (13.748 ms) : 0, 13748
Telemetry [candidate] (15.962 ms) : 0, 15962
section iast
BytebuddyAgent [baseline] (830.301 ms) : 0, 830301
BytebuddyAgent [candidate] (834.033 ms) : 0, 834033
GlobalTracer [baseline] (246.689 ms) : 0, 246689
GlobalTracer [candidate] (247.61 ms) : 0, 247610
AppSec [baseline] (58.066 ms) : 0, 58066
AppSec [candidate] (58.295 ms) : 0, 58295
Remote Config [baseline] (661.004 µs) : 0, 661
Remote Config [candidate] (684.433 µs) : 0, 684
Telemetry [baseline] (8.805 ms) : 0, 8805
Telemetry [candidate] (8.817 ms) : 0, 8817
IAST [baseline] (21.419 ms) : 0, 21419
IAST [candidate] (21.612 ms) : 0, 21612
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (838.93 ms) : 0, 838930
BytebuddyAgent [candidate] (831.428 ms) : 0, 831428
GlobalTracer [baseline] (248.296 ms) : 0, 248296
GlobalTracer [candidate] (247.148 ms) : 0, 247148
AppSec [baseline] (58.484 ms) : 0, 58484
AppSec [candidate] (58.331 ms) : 0, 58331
Remote Config [baseline] (707.454 µs) : 0, 707
Remote Config [candidate] (686.223 µs) : 0, 686
Telemetry [baseline] (9.047 ms) : 0, 9047
Telemetry [candidate] (8.829 ms) : 0, 8829
IAST [baseline] (21.975 ms) : 0, 21975
IAST [candidate] (21.447 ms) : 0, 21447
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (832.228 ms) : 0, 832228
BytebuddyAgent [candidate] (829.028 ms) : 0, 829028
GlobalTracer [baseline] (247.965 ms) : 0, 247965
GlobalTracer [candidate] (247.649 ms) : 0, 247649
AppSec [baseline] (58.223 ms) : 0, 58223
AppSec [candidate] (58.119 ms) : 0, 58119
Remote Config [baseline] (669.806 µs) : 0, 670
Remote Config [candidate] (671.021 µs) : 0, 671
Telemetry [baseline] (8.717 ms) : 0, 8717
Telemetry [candidate] (8.652 ms) : 0, 8652
IAST [baseline] (21.077 ms) : 0, 21077
IAST [candidate] (20.807 ms) : 0, 20807
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~af569223da, baseline=1.46.0-SNAPSHOT~296ed7bdd3

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.061 s) : 0, 1061452
Total [baseline] (10.463 s) : 0, 10462901
Agent [candidate] (1.058 s) : 0, 1058477
Total [candidate] (10.388 s) : 0, 10388276
section appsec
Agent [baseline] (1.186 s) : 0, 1185720
Total [baseline] (10.691 s) : 0, 10691326
Agent [candidate] (1.192 s) : 0, 1192326
Total [candidate] (10.71 s) : 0, 10710449
section iast
Agent [baseline] (1.183 s) : 0, 1182990
Total [baseline] (10.937 s) : 0, 10936966
Agent [candidate] (1.191 s) : 0, 1190834
Total [candidate] (10.947 s) : 0, 10947426
section profiling
Agent [baseline] (1.268 s) : 0, 1267698
Total [baseline] (10.881 s) : 0, 10881409
Agent [candidate] (1.272 s) : 0, 1272500
Total [candidate] (10.825 s) : 0, 10824518
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.061 s -
Agent appsec 1.186 s 124.269 ms (11.7%)
Agent iast 1.183 s 121.538 ms (11.5%)
Agent profiling 1.268 s 206.247 ms (19.4%)
Total tracing 10.463 s -
Total appsec 10.691 s 228.425 ms (2.2%)
Total iast 10.937 s 474.065 ms (4.5%)
Total profiling 10.881 s 418.508 ms (4.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.058 s -
Agent appsec 1.192 s 133.849 ms (12.6%)
Agent iast 1.191 s 132.357 ms (12.5%)
Agent profiling 1.272 s 214.023 ms (20.2%)
Total tracing 10.388 s -
Total appsec 10.71 s 322.172 ms (3.1%)
Total iast 10.947 s 559.149 ms (5.4%)
Total profiling 10.825 s 436.242 ms (4.2%)
gantt
    title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~af569223da, baseline=1.46.0-SNAPSHOT~296ed7bdd3

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (718.888 ms) : 0, 718888
BytebuddyAgent [candidate] (715.798 ms) : 0, 715798
GlobalTracer [baseline] (257.381 ms) : 0, 257381
GlobalTracer [candidate] (256.863 ms) : 0, 256863
AppSec [baseline] (56.352 ms) : 0, 56352
AppSec [candidate] (56.949 ms) : 0, 56949
Remote Config [baseline] (736.006 µs) : 0, 736
Remote Config [candidate] (736.943 µs) : 0, 737
Telemetry [baseline] (12.988 ms) : 0, 12988
Telemetry [candidate] (13.122 ms) : 0, 13122
section appsec
BytebuddyAgent [baseline] (729.578 ms) : 0, 729578
BytebuddyAgent [candidate] (734.179 ms) : 0, 734179
GlobalTracer [baseline] (252.377 ms) : 0, 252377
GlobalTracer [candidate] (253.276 ms) : 0, 253276
AppSec [baseline] (170.349 ms) : 0, 170349
AppSec [candidate] (170.66 ms) : 0, 170660
Remote Config [baseline] (656.452 µs) : 0, 656
Remote Config [candidate] (667.084 µs) : 0, 667
Telemetry [baseline] (8.127 ms) : 0, 8127
Telemetry [candidate] (8.635 ms) : 0, 8635
IAST [baseline] (19.35 ms) : 0, 19350
IAST [candidate] (19.528 ms) : 0, 19528
section iast
BytebuddyAgent [baseline] (831.929 ms) : 0, 831929
BytebuddyAgent [candidate] (837.355 ms) : 0, 837355
GlobalTracer [baseline] (246.985 ms) : 0, 246985
GlobalTracer [candidate] (248.693 ms) : 0, 248693
AppSec [baseline] (57.99 ms) : 0, 57990
AppSec [candidate] (58.199 ms) : 0, 58199
Remote Config [baseline] (699.164 µs) : 0, 699
Remote Config [candidate] (685.618 µs) : 0, 686
Telemetry [baseline] (8.819 ms) : 0, 8819
Telemetry [candidate] (8.957 ms) : 0, 8957
IAST [baseline] (21.542 ms) : 0, 21542
IAST [candidate] (21.802 ms) : 0, 21802
section profiling
BytebuddyAgent [baseline] (708.631 ms) : 0, 708631
BytebuddyAgent [candidate] (702.543 ms) : 0, 702543
GlobalTracer [baseline] (354.259 ms) : 0, 354259
GlobalTracer [candidate] (369.886 ms) : 0, 369886
AppSec [baseline] (55.583 ms) : 0, 55583
AppSec [candidate] (53.927 ms) : 0, 53927
Remote Config [baseline] (686.591 µs) : 0, 687
Remote Config [candidate] (693.742 µs) : 0, 694
Telemetry [baseline] (9.088 ms) : 0, 9088
Telemetry [candidate] (8.862 ms) : 0, 8862
ProfilingAgent [baseline] (97.437 ms) : 0, 97437
ProfilingAgent [candidate] (94.686 ms) : 0, 94686
Profiling [baseline] (97.461 ms) : 0, 97461
Profiling [candidate] (94.713 ms) : 0, 94713
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-01-16T11:42:59 2025-01-16T11:50:02
git_branch master daniel.mohedano/weaver-support
git_commit_date 1737025133 1737027043
git_commit_sha 296ed7b af56922
release_version 1.46.0-SNAPSHOT~296ed7bdd3 1.46.0-SNAPSHOT~af569223da
start_time 2025-01-16T11:42:45 2025-01-16T11:49:49
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1737028557 1737028557
ci_job_id 768776187 768776187
ci_pipeline_id 53170233 53170233
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 1 performance improvements and 1 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
[-104.937µs; -57.945µs] or [-14.127%; -7.801%]
unstable
[-872.081op/s; +2075.088op/s] or [-15.261%; +36.314%]
661.365µs 6315.789op/s 742.806µs 5714.286op/s
scenario:load:petclinic:appsec worse
[+36.689µs; +87.417µs] or [+2.128%; +5.071%]
unstable
[-490.089op/s; +306.181op/s] or [-17.766%; +11.099%]
1.786ms 2666.667op/s 1.724ms 2758.621op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~af569223da, baseline=1.46.0-SNAPSHOT~296ed7bdd3
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.357 ms) : 1337, 1378
.   : milestone, 1357,
appsec (1.724 ms) : 1700, 1748
.   : milestone, 1724,
appsec_no_iast (1.766 ms) : 1741, 1792
.   : milestone, 1766,
iast (1.5 ms) : 1476, 1525
.   : milestone, 1500,
profiling (1.515 ms) : 1491, 1540
.   : milestone, 1515,
tracing (1.485 ms) : 1460, 1511
.   : milestone, 1485,
section candidate
no_agent (1.354 ms) : 1333, 1374
.   : milestone, 1354,
appsec (1.786 ms) : 1763, 1809
.   : milestone, 1786,
appsec_no_iast (1.763 ms) : 1739, 1786
.   : milestone, 1763,
iast (1.486 ms) : 1463, 1509
.   : milestone, 1486,
profiling (1.517 ms) : 1494, 1540
.   : milestone, 1517,
tracing (1.504 ms) : 1479, 1529
.   : milestone, 1504,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.357 ms [1.337 ms, 1.378 ms] -
appsec 1.724 ms [1.7 ms, 1.748 ms] 366.555 µs (27.0%)
appsec_no_iast 1.766 ms [1.741 ms, 1.792 ms] 409.048 µs (30.1%)
iast 1.5 ms [1.476 ms, 1.525 ms] 143.178 µs (10.5%)
profiling 1.515 ms [1.491 ms, 1.54 ms] 158.1 µs (11.6%)
tracing 1.485 ms [1.46 ms, 1.511 ms] 128.214 µs (9.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.354 ms [1.333 ms, 1.374 ms] -
appsec 1.786 ms [1.763 ms, 1.809 ms] 431.95 µs (31.9%)
appsec_no_iast 1.763 ms [1.739 ms, 1.786 ms] 408.901 µs (30.2%)
iast 1.486 ms [1.463 ms, 1.509 ms] 132.102 µs (9.8%)
profiling 1.517 ms [1.494 ms, 1.54 ms] 163.17 µs (12.1%)
tracing 1.504 ms [1.479 ms, 1.529 ms] 150.046 µs (11.1%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~af569223da, baseline=1.46.0-SNAPSHOT~296ed7bdd3
    dateFormat X
    axisFormat %s
section baseline
no_agent (381.489 µs) : 361, 402
.   : milestone, 381,
iast (502.682 µs) : 481, 524
.   : milestone, 503,
iast_FULL (742.806 µs) : 721, 765
.   : milestone, 743,
iast_GLOBAL (552.923 µs) : 531, 575
.   : milestone, 553,
iast_HARDCODED_SECRET_DISABLED (515.335 µs) : 493, 537
.   : milestone, 515,
iast_INACTIVE (463.077 µs) : 441, 485
.   : milestone, 463,
iast_TELEMETRY_OFF (498.094 µs) : 476, 520
.   : milestone, 498,
tracing (455.8 µs) : 435, 477
.   : milestone, 456,
section candidate
no_agent (381.764 µs) : 362, 402
.   : milestone, 382,
iast (499.918 µs) : 478, 522
.   : milestone, 500,
iast_FULL (661.365 µs) : 640, 683
.   : milestone, 661,
iast_GLOBAL (528.667 µs) : 506, 551
.   : milestone, 529,
iast_HARDCODED_SECRET_DISABLED (501.675 µs) : 480, 523
.   : milestone, 502,
iast_INACTIVE (461.41 µs) : 440, 483
.   : milestone, 461,
iast_TELEMETRY_OFF (493.33 µs) : 471, 516
.   : milestone, 493,
tracing (454.968 µs) : 434, 476
.   : milestone, 455,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 381.489 µs [361.222 µs, 401.756 µs] -
iast 502.682 µs [481.271 µs, 524.093 µs] 121.193 µs (31.8%)
iast_FULL 742.806 µs [720.97 µs, 764.642 µs] 361.317 µs (94.7%)
iast_GLOBAL 552.923 µs [531.143 µs, 574.702 µs] 171.434 µs (44.9%)
iast_HARDCODED_SECRET_DISABLED 515.335 µs [493.211 µs, 537.459 µs] 133.846 µs (35.1%)
iast_INACTIVE 463.077 µs [441.216 µs, 484.937 µs] 81.588 µs (21.4%)
iast_TELEMETRY_OFF 498.094 µs [476.175 µs, 520.013 µs] 116.606 µs (30.6%)
tracing 455.8 µs [434.905 µs, 476.696 µs] 74.312 µs (19.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 381.764 µs [361.816 µs, 401.713 µs] -
iast 499.918 µs [478.291 µs, 521.545 µs] 118.154 µs (30.9%)
iast_FULL 661.365 µs [639.531 µs, 683.199 µs] 279.601 µs (73.2%)
iast_GLOBAL 528.667 µs [506.339 µs, 550.996 µs] 146.903 µs (38.5%)
iast_HARDCODED_SECRET_DISABLED 501.675 µs [480.118 µs, 523.231 µs] 119.91 µs (31.4%)
iast_INACTIVE 461.41 µs [439.9 µs, 482.92 µs] 79.646 µs (20.9%)
iast_TELEMETRY_OFF 493.33 µs [471.041 µs, 515.618 µs] 111.565 µs (29.2%)
tracing 454.968 µs [434.152 µs, 475.784 µs] 73.203 µs (19.2%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master daniel.mohedano/weaver-support
git_commit_date 1737025133 1737027043
git_commit_sha 296ed7b af56922
release_version 1.46.0-SNAPSHOT~296ed7bdd3 1.46.0-SNAPSHOT~af569223da
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1737029131 1737029131
ci_job_id 768776188 768776188
ci_pipeline_id 53170233 53170233
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 12 metrics, 0 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~af569223da, baseline=1.46.0-SNAPSHOT~296ed7bdd3
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.475 ms) : 1463, 1487
.   : milestone, 1475,
appsec (2.365 ms) : 2322, 2407
.   : milestone, 2365,
iast (2.117 ms) : 2063, 2171
.   : milestone, 2117,
iast_GLOBAL (2.168 ms) : 2113, 2223
.   : milestone, 2168,
profiling (1.976 ms) : 1933, 2020
.   : milestone, 1976,
tracing (1.946 ms) : 1904, 1988
.   : milestone, 1946,
section candidate
no_agent (1.477 ms) : 1466, 1489
.   : milestone, 1477,
appsec (2.373 ms) : 2330, 2416
.   : milestone, 2373,
iast (2.114 ms) : 2060, 2169
.   : milestone, 2114,
iast_GLOBAL (2.161 ms) : 2107, 2216
.   : milestone, 2161,
profiling (1.989 ms) : 1945, 2033
.   : milestone, 1989,
tracing (1.951 ms) : 1909, 1993
.   : milestone, 1951,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.463 ms, 1.487 ms] -
appsec 2.365 ms [2.322 ms, 2.407 ms] 889.688 µs (60.3%)
iast 2.117 ms [2.063 ms, 2.171 ms] 641.699 µs (43.5%)
iast_GLOBAL 2.168 ms [2.113 ms, 2.223 ms] 693.194 µs (47.0%)
profiling 1.976 ms [1.933 ms, 2.02 ms] 501.414 µs (34.0%)
tracing 1.946 ms [1.904 ms, 1.988 ms] 470.982 µs (31.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.477 ms [1.466 ms, 1.489 ms] -
appsec 2.373 ms [2.33 ms, 2.416 ms] 895.561 µs (60.6%)
iast 2.114 ms [2.06 ms, 2.169 ms] 636.898 µs (43.1%)
iast_GLOBAL 2.161 ms [2.107 ms, 2.216 ms] 683.868 µs (46.3%)
profiling 1.989 ms [1.945 ms, 2.033 ms] 511.434 µs (34.6%)
tracing 1.951 ms [1.909 ms, 1.993 ms] 473.432 µs (32.0%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~af569223da, baseline=1.46.0-SNAPSHOT~296ed7bdd3
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.455 s) : 15455000, 15455000
.   : milestone, 15455000,
appsec (15.122 s) : 15122000, 15122000
.   : milestone, 15122000,
iast (18.715 s) : 18715000, 18715000
.   : milestone, 18715000,
iast_GLOBAL (17.996 s) : 17996000, 17996000
.   : milestone, 17996000,
profiling (15.249 s) : 15249000, 15249000
.   : milestone, 15249000,
tracing (15.03 s) : 15030000, 15030000
.   : milestone, 15030000,
section candidate
no_agent (14.931 s) : 14931000, 14931000
.   : milestone, 14931000,
appsec (15.013 s) : 15013000, 15013000
.   : milestone, 15013000,
iast (18.678 s) : 18678000, 18678000
.   : milestone, 18678000,
iast_GLOBAL (17.872 s) : 17872000, 17872000
.   : milestone, 17872000,
profiling (15.003 s) : 15003000, 15003000
.   : milestone, 15003000,
tracing (14.965 s) : 14965000, 14965000
.   : milestone, 14965000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.455 s [15.455 s, 15.455 s] -
appsec 15.122 s [15.122 s, 15.122 s] -333.0 ms (-2.2%)
iast 18.715 s [18.715 s, 18.715 s] 3.26 s (21.1%)
iast_GLOBAL 17.996 s [17.996 s, 17.996 s] 2.541 s (16.4%)
profiling 15.249 s [15.249 s, 15.249 s] -206.0 ms (-1.3%)
tracing 15.03 s [15.03 s, 15.03 s] -425.0 ms (-2.7%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.931 s [14.931 s, 14.931 s] -
appsec 15.013 s [15.013 s, 15.013 s] 82.0 ms (0.5%)
iast 18.678 s [18.678 s, 18.678 s] 3.747 s (25.1%)
iast_GLOBAL 17.872 s [17.872 s, 17.872 s] 2.941 s (19.7%)
profiling 15.003 s [15.003 s, 15.003 s] 72.0 ms (0.5%)
tracing 14.965 s [14.965 s, 14.965 s] 34.0 ms (0.2%)

Copy link
Contributor

@nikita-tkachenko-datadog nikita-tkachenko-datadog left a comment

Choose a reason for hiding this comment

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

Left a couple of minor comments, other than that looks good!

@Nullable String testMethodName,
@Nullable Method testMethod,
boolean isRetry,
@Nullable Long startTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's just add this startTime parameter to the existing method to keep the interface simple. You can use Refactor -> Change Signature (cmd+F6) in Intellij, it will do all the work for you (you can specify the default value of null for the new parameter, and the IDE will update all the callers of the method).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored also TestSuite start and end handling to accept time parameters, to keep the interface consistent.

}

@Override
public boolean isApplicable(Set<TargetSystem> enabledSystems) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no need to override this method, since all it does is delegating to the parent class

@@ -504,6 +504,7 @@ include ':dd-java-agent:instrumentation:redisson'
include ':dd-java-agent:instrumentation:redisson:redisson-2.0.0'
include ':dd-java-agent:instrumentation:redisson:redisson-2.3.0'
include ':dd-java-agent:instrumentation:redisson:redisson-3.10.3'
include ':dd-java-agent:instrumentation:weaver'
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also update isTestingInstrumentation in gradle/configure_tests.gradle

@majk-p
Copy link

majk-p commented Jan 16, 2025

Hi! Original feature request author here. I'm excited to see this being worked on, and as far as I can tell, the changes look great!

I would suggest adding a few extra tests beyond the SimpleIOSuite. Specifically, testing the IOSuite with suite resource sharing and IOSuite using global resource would be beneficial. Examples from the documentation should be sufficient for these test cases.

If you need more details on Weaver, I’m happy to help!

@daniel-mohedano
Copy link
Contributor Author

Thanks @majk-p ! I'll take into account. In order for us to prioritize future work once these changes are merged, are there any specific features you'd be interested in (with regards to CIVis/TestOptimization)?

@majk-p
Copy link

majk-p commented Jan 16, 2025

I need to double check with my team on the requirements. For context it's worth noting that my team specifically builds a framework on top of weaver. For sure 3 things come to my mind:

  1. Ensuring that ignored tests are marked properly in DataDog

To overcome the missing weaver support we implemented CI Visibility by following this guide https://docs.datadoghq.com/tests/setup/java/?tab=ciproviderwithautoinstrumentationsupport#using-manual-testing-api.
One of the things we had to do to make sure the ignored tests are marked properly was to check failed test threw weaver.IgnoredException. Here's Scala snippet that we used:

        if (!testName.tags.contains(TestName.Tags.ignore))
          error match {
            case ignored: weaver.IgnoredException => ignored.reason.foreach(test.setSkipReason(_))
            case other                            => test.setErrorInfo(other)
          }
  1. Ensure we can set tags on test/suite/module level

When using test visibility api directly we were spawning objects like DDTestSuite on which we would be setting custom tags like test.setTag("my_testing_framework.version", frameworkVersion).
Judging by the documentation I guess I should be able to do something like:

final Span span = GlobalTracer.get().activeSpan();
if (span != null) {
  span.setTag("test_owner", "my_team");
}

For context, weaver uses Cats Effect so the tests are executed in parallel on something like green threads. Can you confirm this approach is thread safe?

  1. Have access to traceId

One of the limitations of my current approach is that I cannot link the test visibility Tracing tab to the http requests done during the test. What I'd like to be able to do is to somehow obtain the trace id of the test being executed and pass it in http headers to see them rendered in tracing tab of test execution on the web panel.

@daniel-mohedano
Copy link
Contributor Author

Thanks for letting us know! Point 1 should already be handled by the changes in this PR, so both ignored and canceled tests should be correctly marked as skipped in DataDog. Points 2 and 3 are a bit more tricky, and won't work for now with the current changes. But we will focus on them next in order to support the functionality.

@majk-p
Copy link

majk-p commented Jan 16, 2025

Great, I'm looking forward for all those changes! If there's a snapshot version available I'm happy to give it a try and share my feedback

@daniel-mohedano
Copy link
Contributor Author

Of course! You can access a snapshot version here. Let me know if you have any issues.

@majk-p
Copy link

majk-p commented Jan 17, 2025

I was trying hard to make to try it out, but I must be doing something wrong because I see no test runs with @test.framework:weaver

Here's what I did:

  1. I used https://github.com/sbt/sbt-javaagent as I do to add DataDog agent
  2. Changed my regular dependency to the one from your link via from "https://output.circle-artifacts.com/output/job/e6a221ef-d47a-4427-acdb-8b689a451481/artifacts/0/libs/dd-java-agent-1.46.0-SNAPSHOT.jar"
  3. Started sbt with:
DD_SERVICE=myservcice DD_ENV=local DD_SITE=datadoghq.com DD_CI_VISIBILITY_AGENTLESS_ENABLED=true DD_CIVISIBILITY_ENABLED=true sbt

I made sure that DD_API_KEY is also correctly set in my env

  1. Launched the tests with myModule/test
  2. Went to https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20test.framework%3Aweaver and saw no results

Am I misconfiguring the env?


Here are the logs printed by the agent:

[dd.trace 2025-01-17 11:02:36:568 +0100] [main] INFO datadog.trace.agent.common.writer.WriterFactory - Using 'EnsureTrace' prioritization type. (Do not use this type if your application is running in production mode)
[dd.trace 2025-01-17 11:02:36:579 +0100] [main] INFO datadog.trace.agent.common.writer.WriterFactory - CI Visibility functionality is limited. Please upgrade to Agent v6.40+ or v7.40+ or enable Agentless mode.
[dd.trace 2025-01-17 11:02:36:710 +0100] [main] WARN datadog.communication.BackendApiFactory - Cannot create backend API client since agentless mode is disabled, and agent does not support EVP proxy 
[dd.trace 2025-01-17 11:02:36:930 +0100] [main] WARN datadog.trace.civisibility.CiVisibilityRepoServices - Git tree data upload will be skipped since backend API client could not be created         
[dd.trace 2025-01-17 11:02:36:937 +0100] [main] WARN datadog.trace.civisibility.CiVisibilityRepoServices - Remote config and skippable tests requests will be skipped since backend API client could not be created
[dd.trace 2025-01-17 11:02:36:943 +0100] [main] INFO datadog.trace.civisibility.config.ExecutionSettingsFactoryImpl - CI Visibility settings (/path/to/project/, OpenJDK Runtime Environment/21.0.4/Amazon.com Inc.):                                     
Intelligent Test Runner - false,                                                                                                    
Per-test code coverage - false,                                                                                                     
Tests skipping - false,                                                                                                             
Early flakiness detection - false,                                                                                                  
Auto test retries - false                                         
[dd.trace 2025-01-17 11:02:37:141 +0100] [dd-task-scheduler] INFO datadog.trace.agent.core.StatusLogger - DATADOG TRACER CONFIGURATION {
    "version": "1.46.0-SNAPSHOT~ad3623edd6",
    "os_name": "Linux",
    "os_version": "REDACTED",
    "architecture": "amd64",
    "lang": "jvm",
    "lang_version": "21.0.4",
    "jvm_vendor": "Amazon.com Inc.",
    "jvm_version": "21.0.4+7-LTS",
    "java_class_version": "65.0",
    "http_nonProxyHosts": "null",
    "http_proxyHost": "null",
    "enabled": true,
    "service": "REDACTED",
    "agent_url": "http://localhost:8126",
    "agent_error": true,
    "debug": false,
    "trace_propagation_style_extract": [
        "datadog",
        "tracecontext"
    ],
    "trace_propagation_style_inject": [
        "datadog",
        "tracecontext"
    ],
    "analytics_enabled": false,
    "priority_sampling_enabled": true,
    "logs_correlation_enabled": true,
    "profiling_enabled": false,
    "remote_config_enabled": false,
    "debugger_enabled": false,
    "debugger_exception_enabled": false,
    "debugger_span_origin_enabled": false,
    "appsec_enabled": "FULLY_DISABLED",
    "rasp_enabled": true,
    "telemetry_enabled": true,
    "telemetry_dependency_collection_enabled": true,
    "telemetry_log_collection_enabled": true,
    "dd_version": "",
    "health_checks_enabled": true,
    "configuration_file": "no config file present",
    "runtime_id": "3b8d9377-9fe1-4a2f-b10a-9d62a0b0b444",
    "logging_settings": {
        "levelInBrackets": false,
        "dateTimeFormat": "'[dd.trace 'yyyy-MM-dd HH:mm:ss:SSS Z']'",
        "logFile": "System.err",
        "configurationFile": "simplelogger.properties",
        "showShortLogName": false,
        "showDateTime": true,
        "showLogName": true,
        "showThreadName": true,
        "defaultLogLevel": "INFO",
        "warnLevelString": "WARN",
        "embedException": false
    },
    "cws_enabled": false,
    "cws_tls_refresh": 5000,
    "datadog_profiler_enabled": false,
    "datadog_profiler_safe": true,
    "datadog_profiler_enabled_overridden": false,
    "data_streams_enabled": false
}
[dd.trace 2025-01-17 11:02:37:479 +0100] [dd-telemetry] WARN datadog.telemetry.TelemetryRouter - Got FAILURE sending telemetry request to http://localhost:8126/telemetry/proxy/api/v2/apmtelemetry.
[dd.trace 2025-01-17 11:02:37:479 +0100] [dd-telemetry] INFO datadog.telemetry.TelemetryRouter - Agent Telemetry endpoint failed. Telemetry will be sent to Intake.

@daniel-mohedano
Copy link
Contributor Author

No problem! Try with DD_CIVISIBILITY_AGENTLESS_ENABLED=true instead of DD_CI_VISIBILITY_AGENTLESS_ENABLED=true. That should enable the agentless mode correctly so the data can be reported to DataDog. Let me know if you encounter any more issues!

@majk-p
Copy link

majk-p commented Jan 17, 2025

Thanks for the tip, you were right. It worked locally!

To test this on CI, do you think there's a way to tell the agent script that we install via https://install.datadoghq.com/scripts/install_script_agent7.sh to use this specific build?

@majk-p
Copy link

majk-p commented Jan 17, 2025

On a related note, when weaver is officially supported it will probably get listed on https://docs.datadoghq.com/tests/setup/java. Do you the https://docs.datadoghq.com/tests/setup/java/?tab=gradle#running-your-tests section can be extended with sbt? The steps from the comment above #8189 (comment) should be enough, but I can also share a more detailed description

@daniel-mohedano
Copy link
Contributor Author

That's great news! Unfortunately, the single-step instrumentation script doesn't allow to install the tracer from an arbitrary URL. To test the changes in CI right now you would have to update your pipeline to download the tracer and configure the env vars as indicated in the docs. With that said, the changes should be available with the next release of the tracer, scheduled for the first week of February (or even sooner than that if there is a minor release).

The documentation will be updated too to reflect the changes. I still have to discuss with the team how we want to approach adding sbt as a build tool but I'll let you know if we need any more information, thanks!

@majk-p
Copy link

majk-p commented Jan 17, 2025

Thanks Daniel! I managed to work around the script setting things up manually and confirmed the instrumentation works on CI as well. Now that I know it works in both envs, I'm happy to wait for the release. Great job!

As for documentation that's totally understandable. I'm happy to share feedback and examples of what was working for us for sbt & Scala setup.

@daniel-mohedano
Copy link
Contributor Author

Glad to hear that! And thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: ci visibility Continuous Integration Visibility type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants