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 capabilities tagging #8499

Merged
merged 44 commits into from
Mar 7, 2025

Conversation

daniel-mohedano
Copy link
Contributor

@daniel-mohedano daniel-mohedano commented Mar 4, 2025

What Does This Do

Implements capabilities tagging for all CiVisibility/Test Optimization advanced features. The tagging follows the logic:

  1. If library had the capability for this test session and it was enabled, set the tag to “true“
  2. If library had the capability for this test session but it was disabled, set the tag to “false“
  3. If library did not have the capability for this test, omit the tag

Motivation

This tags allow us to give some feedback to the customers about which advanced features they can enable and which ones they have enabled.

Contributor Checklist

Jira ticket: SDTEST-1616

# Conflicts:
#	dd-java-agent/agent-ci-visibility/src/testFixtures/groovy/datadog/trace/civisibility/CiVisibilityInstrumentationTest.groovy
@daniel-mohedano daniel-mohedano added type: enhancement comp: ci visibility Continuous Integration Visibility labels Mar 4, 2025
}

private static class ListItem extends ArrayList<Item> implements Item {
private ListItem() {}
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

}
}

buffer.append("]");
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
buffer.append("]");
buffer.append(']');
Do not append a string literal that contains only a single char (...read more)

Do not append a string with single character to a StringBuffer. Instead, append a character type. This is better practice and results in better performance. While this is negligible if the operation occurs once, it has performance impact if done at scale.

Learn More

View in Datadog  Leave us feedback  Documentation


private String toListString() {
StringBuilder buffer = new StringBuilder();
buffer.append("[");
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
buffer.append("[");
buffer.append('[');
Do not append a string literal that contains only a single char (...read more)

Do not append a string with single character to a StringBuffer. Instead, append a character type. This is better practice and results in better performance. While this is negligible if the operation occurs once, it has performance impact if done at scale.

Learn More

View in Datadog  Leave us feedback  Documentation

@pr-commenter
Copy link

pr-commenter bot commented Mar 4, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master daniel.mohedano/library-capabilities-tagging
git_commit_date 1741216058 1741250697
git_commit_sha 4eaa53b 02fa357
release_version 1.48.0-SNAPSHOT~4eaa53be19 1.48.0-SNAPSHOT~02fa357a1d
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1741253353 1741253353
ci_job_id 835191859 835191859
ci_pipeline_id 57899212 57899212
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-642whzhj-project-304-concurrent-0-bc3zhl74 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-642whzhj-project-304-concurrent-0-bc3zhl74 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 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 56 metrics, 7 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.48.0-SNAPSHOT~02fa357a1d, baseline=1.48.0-SNAPSHOT~4eaa53be19

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.046 s) : 0, 1046382
Total [baseline] (8.681 s) : 0, 8680563
Agent [candidate] (1.044 s) : 0, 1044432
Total [candidate] (8.656 s) : 0, 8656047
section iast
Agent [baseline] (1.17 s) : 0, 1169774
Total [baseline] (9.226 s) : 0, 9225983
Agent [candidate] (1.172 s) : 0, 1172017
Total [candidate] (9.258 s) : 0, 9258079
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.176 s) : 0, 1176397
Total [baseline] (9.212 s) : 0, 9211735
Agent [candidate] (1.174 s) : 0, 1174376
Total [candidate] (9.22 s) : 0, 9219601
section iast_TELEMETRY_OFF
Agent [baseline] (1.173 s) : 0, 1173232
Total [baseline] (9.247 s) : 0, 9246979
Agent [candidate] (1.178 s) : 0, 1177518
Total [candidate] (9.251 s) : 0, 9250578
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.046 s -
Agent iast 1.17 s 123.392 ms (11.8%)
Agent iast_HARDCODED_SECRET_DISABLED 1.176 s 130.015 ms (12.4%)
Agent iast_TELEMETRY_OFF 1.173 s 126.85 ms (12.1%)
Total tracing 8.681 s -
Total iast 9.226 s 545.421 ms (6.3%)
Total iast_HARDCODED_SECRET_DISABLED 9.212 s 531.173 ms (6.1%)
Total iast_TELEMETRY_OFF 9.247 s 566.416 ms (6.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.044 s -
Agent iast 1.172 s 127.585 ms (12.2%)
Agent iast_HARDCODED_SECRET_DISABLED 1.174 s 129.944 ms (12.4%)
Agent iast_TELEMETRY_OFF 1.178 s 133.087 ms (12.7%)
Total tracing 8.656 s -
Total iast 9.258 s 602.032 ms (7.0%)
Total iast_HARDCODED_SECRET_DISABLED 9.22 s 563.554 ms (6.5%)
Total iast_TELEMETRY_OFF 9.251 s 594.531 ms (6.9%)
gantt
    title insecure-bank - break down per module: candidate=1.48.0-SNAPSHOT~02fa357a1d, baseline=1.48.0-SNAPSHOT~4eaa53be19

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (720.863 ms) : 0, 720863
BytebuddyAgent [candidate] (721.991 ms) : 0, 721991
GlobalTracer [baseline] (240.112 ms) : 0, 240112
GlobalTracer [candidate] (241.049 ms) : 0, 241049
AppSec [baseline] (55.775 ms) : 0, 55775
AppSec [candidate] (55.647 ms) : 0, 55647
Remote Config [baseline] (703.182 µs) : 0, 703
Remote Config [candidate] (695.625 µs) : 0, 696
Telemetry [baseline] (13.83 ms) : 0, 13830
Telemetry [candidate] (10.038 ms) : 0, 10038
section iast
BytebuddyAgent [baseline] (836.685 ms) : 0, 836685
BytebuddyAgent [candidate] (837.182 ms) : 0, 837182
GlobalTracer [baseline] (229.998 ms) : 0, 229998
GlobalTracer [candidate] (230.567 ms) : 0, 230567
IAST [baseline] (22.707 ms) : 0, 22707
IAST [candidate] (22.949 ms) : 0, 22949
AppSec [baseline] (56.272 ms) : 0, 56272
AppSec [candidate] (56.92 ms) : 0, 56920
Remote Config [baseline] (618.203 µs) : 0, 618
Remote Config [candidate] (619.859 µs) : 0, 620
Telemetry [baseline] (8.601 ms) : 0, 8601
Telemetry [candidate] (8.798 ms) : 0, 8798
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (841.728 ms) : 0, 841728
BytebuddyAgent [candidate] (839.712 ms) : 0, 839712
GlobalTracer [baseline] (230.398 ms) : 0, 230398
GlobalTracer [candidate] (230.78 ms) : 0, 230780
IAST [baseline] (23.031 ms) : 0, 23031
IAST [candidate] (22.857 ms) : 0, 22857
AppSec [baseline] (56.86 ms) : 0, 56860
AppSec [candidate] (56.664 ms) : 0, 56664
Remote Config [baseline] (613.16 µs) : 0, 613
Remote Config [candidate] (618.34 µs) : 0, 618
Telemetry [baseline] (8.679 ms) : 0, 8679
Telemetry [candidate] (8.704 ms) : 0, 8704
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (838.742 ms) : 0, 838742
BytebuddyAgent [candidate] (842.249 ms) : 0, 842249
GlobalTracer [baseline] (231.023 ms) : 0, 231023
GlobalTracer [candidate] (231.611 ms) : 0, 231611
IAST [baseline] (22.357 ms) : 0, 22357
IAST [candidate] (25.642 ms) : 0, 25642
AppSec [baseline] (56.79 ms) : 0, 56790
AppSec [candidate] (53.596 ms) : 0, 53596
Remote Config [baseline] (621.749 µs) : 0, 622
Remote Config [candidate] (624.002 µs) : 0, 624
Telemetry [baseline] (8.653 ms) : 0, 8653
Telemetry [candidate] (8.691 ms) : 0, 8691
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.48.0-SNAPSHOT~02fa357a1d, baseline=1.48.0-SNAPSHOT~4eaa53be19

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.039 s) : 0, 1038900
Total [baseline] (10.442 s) : 0, 10442111
Agent [candidate] (1.05 s) : 0, 1049659
Total [candidate] (10.521 s) : 0, 10520899
section appsec
Agent [baseline] (1.183 s) : 0, 1183254
Total [baseline] (10.772 s) : 0, 10772018
Agent [candidate] (1.188 s) : 0, 1188470
Total [candidate] (10.831 s) : 0, 10831380
section iast
Agent [baseline] (1.172 s) : 0, 1171619
Total [baseline] (10.971 s) : 0, 10971092
Agent [candidate] (1.17 s) : 0, 1170023
Total [candidate] (10.954 s) : 0, 10954245
section profiling
Agent [baseline] (1.27 s) : 0, 1269773
Total [baseline] (10.891 s) : 0, 10890971
Agent [candidate] (1.26 s) : 0, 1259846
Total [candidate] (10.843 s) : 0, 10843251
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.039 s -
Agent appsec 1.183 s 144.354 ms (13.9%)
Agent iast 1.172 s 132.719 ms (12.8%)
Agent profiling 1.27 s 230.873 ms (22.2%)
Total tracing 10.442 s -
Total appsec 10.772 s 329.907 ms (3.2%)
Total iast 10.971 s 528.981 ms (5.1%)
Total profiling 10.891 s 448.86 ms (4.3%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.05 s -
Agent appsec 1.188 s 138.811 ms (13.2%)
Agent iast 1.17 s 120.364 ms (11.5%)
Agent profiling 1.26 s 210.187 ms (20.0%)
Total tracing 10.521 s -
Total appsec 10.831 s 310.481 ms (3.0%)
Total iast 10.954 s 433.345 ms (4.1%)
Total profiling 10.843 s 322.352 ms (3.1%)
gantt
    title petclinic - break down per module: candidate=1.48.0-SNAPSHOT~02fa357a1d, baseline=1.48.0-SNAPSHOT~4eaa53be19

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (715.763 ms) : 0, 715763
BytebuddyAgent [candidate] (722.65 ms) : 0, 722650
GlobalTracer [baseline] (239.361 ms) : 0, 239361
GlobalTracer [candidate] (241.252 ms) : 0, 241252
AppSec [baseline] (55.227 ms) : 0, 55227
AppSec [candidate] (55.41 ms) : 0, 55410
Remote Config [baseline] (686.808 µs) : 0, 687
Remote Config [candidate] (692.188 µs) : 0, 692
Telemetry [baseline] (12.891 ms) : 0, 12891
Telemetry [candidate] (14.58 ms) : 0, 14580
section appsec
BytebuddyAgent [baseline] (735.088 ms) : 0, 735088
BytebuddyAgent [candidate] (738.119 ms) : 0, 738119
GlobalTracer [baseline] (236.196 ms) : 0, 236196
GlobalTracer [candidate] (237.599 ms) : 0, 237599
AppSec [baseline] (177.333 ms) : 0, 177333
AppSec [candidate] (177.465 ms) : 0, 177465
Remote Config [baseline] (663.297 µs) : 0, 663
Remote Config [candidate] (682.673 µs) : 0, 683
Telemetry [baseline] (8.289 ms) : 0, 8289
Telemetry [candidate] (8.727 ms) : 0, 8727
IAST [baseline] (21.555 ms) : 0, 21555
IAST [candidate] (21.84 ms) : 0, 21840
section iast
BytebuddyAgent [baseline] (837.523 ms) : 0, 837523
BytebuddyAgent [candidate] (836.295 ms) : 0, 836295
GlobalTracer [baseline] (230.608 ms) : 0, 230608
GlobalTracer [candidate] (229.998 ms) : 0, 229998
AppSec [baseline] (53.969 ms) : 0, 53969
AppSec [candidate] (56.852 ms) : 0, 56852
Remote Config [baseline] (617.122 µs) : 0, 617
Remote Config [candidate] (615.846 µs) : 0, 616
Telemetry [baseline] (8.657 ms) : 0, 8657
Telemetry [candidate] (8.645 ms) : 0, 8645
IAST [baseline] (25.23 ms) : 0, 25230
IAST [candidate] (22.729 ms) : 0, 22729
section profiling
BytebuddyAgent [baseline] (715.024 ms) : 0, 715024
BytebuddyAgent [candidate] (709.366 ms) : 0, 709366
GlobalTracer [baseline] (351.625 ms) : 0, 351625
GlobalTracer [candidate] (350.181 ms) : 0, 350181
AppSec [baseline] (55.492 ms) : 0, 55492
AppSec [candidate] (54.079 ms) : 0, 54079
Remote Config [baseline] (693.518 µs) : 0, 694
Remote Config [candidate] (668.63 µs) : 0, 669
Telemetry [baseline] (9.025 ms) : 0, 9025
Telemetry [candidate] (8.995 ms) : 0, 8995
ProfilingAgent [baseline] (97.238 ms) : 0, 97238
ProfilingAgent [candidate] (96.193 ms) : 0, 96193
Profiling [baseline] (97.265 ms) : 0, 97265
Profiling [candidate] (96.218 ms) : 0, 96218
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-03-06T08:59:30 2025-03-06T09:07:16
git_branch master daniel.mohedano/library-capabilities-tagging
git_commit_date 1741216058 1741250697
git_commit_sha 4eaa53b 02fa357
release_version 1.48.0-SNAPSHOT~4eaa53be19 1.48.0-SNAPSHOT~02fa357a1d
start_time 2025-03-06T08:59:16 2025-03-06T09:07:02
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1741252437 1741252437
ci_job_id 835191860 835191860
ci_pipeline_id 57899212 57899212
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-642whzhj-project-304-concurrent-1-e8bob63z 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-642whzhj-project-304-concurrent-1-e8bob63z 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant iast iast

Summary

Found 0 performance improvements and 1 performance regressions! Performance is the same for 13 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:petclinic:profiling worse
[+39.710µs; +91.943µs] or [+2.653%; +6.143%]
unstable
[-779.868op/s; +305.794op/s] or [-24.371%; +9.556%]
1.562ms 2962.963op/s 1.497ms 3200.000op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~02fa357a1d, baseline=1.48.0-SNAPSHOT~4eaa53be19
    dateFormat X
    axisFormat %s
section baseline
no_agent (383.64 µs) : 364, 403
.   : milestone, 384,
iast (517.036 µs) : 495, 539
.   : milestone, 517,
iast_FULL (738.833 µs) : 717, 761
.   : milestone, 739,
iast_GLOBAL (566.186 µs) : 544, 588
.   : milestone, 566,
iast_HARDCODED_SECRET_DISABLED (521.829 µs) : 499, 544
.   : milestone, 522,
iast_INACTIVE (468.442 µs) : 447, 490
.   : milestone, 468,
iast_TELEMETRY_OFF (504.232 µs) : 482, 526
.   : milestone, 504,
tracing (461.176 µs) : 441, 482
.   : milestone, 461,
section candidate
no_agent (384.707 µs) : 365, 404
.   : milestone, 385,
iast (518.291 µs) : 496, 540
.   : milestone, 518,
iast_FULL (737.098 µs) : 715, 759
.   : milestone, 737,
iast_GLOBAL (572.27 µs) : 551, 594
.   : milestone, 572,
iast_HARDCODED_SECRET_DISABLED (518.948 µs) : 497, 541
.   : milestone, 519,
iast_INACTIVE (469.011 µs) : 447, 491
.   : milestone, 469,
iast_TELEMETRY_OFF (502.991 µs) : 480, 526
.   : milestone, 503,
tracing (459.748 µs) : 439, 481
.   : milestone, 460,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 383.64 µs [363.973 µs, 403.307 µs] -
iast 517.036 µs [494.894 µs, 539.177 µs] 133.396 µs (34.8%)
iast_FULL 738.833 µs [716.816 µs, 760.85 µs] 355.193 µs (92.6%)
iast_GLOBAL 566.186 µs [544.365 µs, 588.006 µs] 182.546 µs (47.6%)
iast_HARDCODED_SECRET_DISABLED 521.829 µs [499.269 µs, 544.39 µs] 138.189 µs (36.0%)
iast_INACTIVE 468.442 µs [447.2 µs, 489.684 µs] 84.802 µs (22.1%)
iast_TELEMETRY_OFF 504.232 µs [482.312 µs, 526.152 µs] 120.592 µs (31.4%)
tracing 461.176 µs [440.574 µs, 481.778 µs] 77.536 µs (20.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 384.707 µs [365.084 µs, 404.331 µs] -
iast 518.291 µs [496.447 µs, 540.135 µs] 133.584 µs (34.7%)
iast_FULL 737.098 µs [715.096 µs, 759.1 µs] 352.391 µs (91.6%)
iast_GLOBAL 572.27 µs [550.618 µs, 593.922 µs] 187.563 µs (48.8%)
iast_HARDCODED_SECRET_DISABLED 518.948 µs [497.16 µs, 540.736 µs] 134.241 µs (34.9%)
iast_INACTIVE 469.011 µs [447.498 µs, 490.524 µs] 84.304 µs (21.9%)
iast_TELEMETRY_OFF 502.991 µs [480.301 µs, 525.681 µs] 118.284 µs (30.7%)
tracing 459.748 µs [438.929 µs, 480.567 µs] 75.041 µs (19.5%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~02fa357a1d, baseline=1.48.0-SNAPSHOT~4eaa53be19
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.355 ms) : 1335, 1376
.   : milestone, 1355,
appsec (1.734 ms) : 1710, 1757
.   : milestone, 1734,
appsec_no_iast (1.751 ms) : 1727, 1776
.   : milestone, 1751,
code_origins (1.687 ms) : 1653, 1721
.   : milestone, 1687,
iast (1.517 ms) : 1492, 1542
.   : milestone, 1517,
profiling (1.497 ms) : 1473, 1520
.   : milestone, 1497,
tracing (1.49 ms) : 1465, 1516
.   : milestone, 1490,
section candidate
no_agent (1.381 ms) : 1361, 1401
.   : milestone, 1381,
appsec (1.742 ms) : 1717, 1766
.   : milestone, 1742,
appsec_no_iast (1.743 ms) : 1718, 1768
.   : milestone, 1743,
code_origins (1.687 ms) : 1653, 1721
.   : milestone, 1687,
iast (1.52 ms) : 1496, 1544
.   : milestone, 1520,
profiling (1.562 ms) : 1538, 1587
.   : milestone, 1562,
tracing (1.498 ms) : 1472, 1523
.   : milestone, 1498,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.355 ms [1.335 ms, 1.376 ms] -
appsec 1.734 ms [1.71 ms, 1.757 ms] 378.376 µs (27.9%)
appsec_no_iast 1.751 ms [1.727 ms, 1.776 ms] 396.142 µs (29.2%)
code_origins 1.687 ms [1.653 ms, 1.721 ms] 331.681 µs (24.5%)
iast 1.517 ms [1.492 ms, 1.542 ms] 162.115 µs (12.0%)
profiling 1.497 ms [1.473 ms, 1.52 ms] 141.388 µs (10.4%)
tracing 1.49 ms [1.465 ms, 1.516 ms] 135.158 µs (10.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.381 ms [1.361 ms, 1.401 ms] -
appsec 1.742 ms [1.717 ms, 1.766 ms] 360.694 µs (26.1%)
appsec_no_iast 1.743 ms [1.718 ms, 1.768 ms] 361.872 µs (26.2%)
code_origins 1.687 ms [1.653 ms, 1.721 ms] 305.968 µs (22.2%)
iast 1.52 ms [1.496 ms, 1.544 ms] 138.892 µs (10.1%)
profiling 1.562 ms [1.538 ms, 1.587 ms] 181.335 µs (13.1%)
tracing 1.498 ms [1.472 ms, 1.523 ms] 116.399 µs (8.4%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master daniel.mohedano/library-capabilities-tagging
git_commit_date 1741216058 1741250697
git_commit_sha 4eaa53b 02fa357
release_version 1.48.0-SNAPSHOT~4eaa53be19 1.48.0-SNAPSHOT~02fa357a1d
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1741252964 1741252964
ci_job_id 835191861 835191861
ci_pipeline_id 57899212 57899212
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-3ysmm6qi-project-304-concurrent-0-g8bc3mwj 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-3ysmm6qi-project-304-concurrent-0-g8bc3mwj 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 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~02fa357a1d, baseline=1.48.0-SNAPSHOT~4eaa53be19
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.458 s) : 15458000, 15458000
.   : milestone, 15458000,
appsec (14.957 s) : 14957000, 14957000
.   : milestone, 14957000,
iast (18.177 s) : 18177000, 18177000
.   : milestone, 18177000,
iast_GLOBAL (17.884 s) : 17884000, 17884000
.   : milestone, 17884000,
profiling (14.913 s) : 14913000, 14913000
.   : milestone, 14913000,
tracing (15.118 s) : 15118000, 15118000
.   : milestone, 15118000,
section candidate
no_agent (15.396 s) : 15396000, 15396000
.   : milestone, 15396000,
appsec (14.714 s) : 14714000, 14714000
.   : milestone, 14714000,
iast (18.679 s) : 18679000, 18679000
.   : milestone, 18679000,
iast_GLOBAL (18.2 s) : 18200000, 18200000
.   : milestone, 18200000,
profiling (15.244 s) : 15244000, 15244000
.   : milestone, 15244000,
tracing (14.849 s) : 14849000, 14849000
.   : milestone, 14849000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.458 s [15.458 s, 15.458 s] -
appsec 14.957 s [14.957 s, 14.957 s] -501.0 ms (-3.2%)
iast 18.177 s [18.177 s, 18.177 s] 2.719 s (17.6%)
iast_GLOBAL 17.884 s [17.884 s, 17.884 s] 2.426 s (15.7%)
profiling 14.913 s [14.913 s, 14.913 s] -545.0 ms (-3.5%)
tracing 15.118 s [15.118 s, 15.118 s] -340.0 ms (-2.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.396 s [15.396 s, 15.396 s] -
appsec 14.714 s [14.714 s, 14.714 s] -682.0 ms (-4.4%)
iast 18.679 s [18.679 s, 18.679 s] 3.283 s (21.3%)
iast_GLOBAL 18.2 s [18.2 s, 18.2 s] 2.804 s (18.2%)
profiling 15.244 s [15.244 s, 15.244 s] -152.0 ms (-1.0%)
tracing 14.849 s [14.849 s, 14.849 s] -547.0 ms (-3.6%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~02fa357a1d, baseline=1.48.0-SNAPSHOT~4eaa53be19
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.472 ms) : 1461, 1484
.   : milestone, 1472,
appsec (2.344 ms) : 2300, 2387
.   : milestone, 2344,
iast (2.11 ms) : 2055, 2165
.   : milestone, 2110,
iast_GLOBAL (2.158 ms) : 2103, 2213
.   : milestone, 2158,
profiling (1.987 ms) : 1943, 2031
.   : milestone, 1987,
tracing (1.946 ms) : 1904, 1988
.   : milestone, 1946,
section candidate
no_agent (1.471 ms) : 1459, 1482
.   : milestone, 1471,
appsec (2.347 ms) : 2304, 2391
.   : milestone, 2347,
iast (2.11 ms) : 2055, 2165
.   : milestone, 2110,
iast_GLOBAL (2.157 ms) : 2101, 2212
.   : milestone, 2157,
profiling (1.991 ms) : 1946, 2035
.   : milestone, 1991,
tracing (1.945 ms) : 1903, 1986
.   : milestone, 1945,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.472 ms [1.461 ms, 1.484 ms] -
appsec 2.344 ms [2.3 ms, 2.387 ms] 871.474 µs (59.2%)
iast 2.11 ms [2.055 ms, 2.165 ms] 637.743 µs (43.3%)
iast_GLOBAL 2.158 ms [2.103 ms, 2.213 ms] 685.76 µs (46.6%)
profiling 1.987 ms [1.943 ms, 2.031 ms] 515.028 µs (35.0%)
tracing 1.946 ms [1.904 ms, 1.988 ms] 473.948 µs (32.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.471 ms [1.459 ms, 1.482 ms] -
appsec 2.347 ms [2.304 ms, 2.391 ms] 876.574 µs (59.6%)
iast 2.11 ms [2.055 ms, 2.165 ms] 639.527 µs (43.5%)
iast_GLOBAL 2.157 ms [2.101 ms, 2.212 ms] 685.702 µs (46.6%)
profiling 1.991 ms [1.946 ms, 2.035 ms] 519.875 µs (35.3%)
tracing 1.945 ms [1.903 ms, 1.986 ms] 473.795 µs (32.2%)

@@ -167,9 +169,11 @@ private TestEventsHandlerFactory(
public <SuiteKey, TestKey> TestEventsHandler<SuiteKey, TestKey> create(
String component,
@Nullable ContextStore<SuiteKey, DDTestSuite> suiteStore,
@Nullable ContextStore<TestKey, DDTest> testStore) {
@Nullable ContextStore<TestKey, DDTest> testStore,
Collection<LibraryCapability> availableCapabilities) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd argue that a capability is available by definition :)

Suggested change
Collection<LibraryCapability> availableCapabilities) {
Collection<LibraryCapability> capabilities) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very true 👍

@@ -144,6 +148,11 @@ public TestImpl(
span.setTag(Tags.ITR_CORRELATION_ID, itrCorrelationId);
}

for (Map.Entry<LibraryCapability, Boolean> entry : libraryCapabilities.entrySet()) {
String capabilityTag = LibraryCapabilityUtils.CAPABILITY_TAG_MAP.get(entry.getKey());
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than doing a map lookup, can't we store the tag as a field in LibraryCapability instances and then do something like entry.getKey().asTag()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I separated the LibraryCapability from the tags for encapsulation in the internal api, but I agree that it ended up making everything quite complicated to follow, so probably best to do as you say to also remove LibraryCapabilityUtils


private void propagateTestTags(AgentSpan testSpan) {
SpanUtils.propagateCiVisibilityTags(span, testSpan);
SpanUtils.propagateLibraryCapabilities(span, testSpan);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we call propagateLibraryCapabilities from propagateCiVisibilityTags? That'd allow us to centralise the logic and have less places to update

Copy link
Contributor

Choose a reason for hiding this comment

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

On the other hand, if capabilities are already available in session, module, and suite, why do we propagate them from a child span rather than setting them directly in constructor along with the other tags?

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed offline, let's remove the propagation altogether, as the spec only mandates that the capabilities be present in the test events

@@ -144,6 +148,11 @@ public TestImpl(
span.setTag(Tags.ITR_CORRELATION_ID, itrCorrelationId);
}

for (Map.Entry<LibraryCapability, Boolean> entry : libraryCapabilities.entrySet()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understood correctly, we might end up with a null here (coming from the ManualApiTestModule) and fail with a NullPointerException.
I'd say we should mark the argument as @Nonnull to let the compiler warn us about these things

@@ -220,6 +223,30 @@ private LinesResolver.Lines getLines(Method testMethod) {
}
}

public Map<LibraryCapability, Boolean> getCapabilitiesStatus() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd make this method accept a collection of capabilities and would do the filtering inside it (that way we can get rid of LibraryCapabilitiesUtils which seems kind of clumsy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Moreover, we could add a Predicate<ExecutionSettings> field to LibraryCapability, then the method would look like:

public Map<LibraryCapability, Boolean> getCapabilitiesStatus(Collection<LibraryCapability> capabilities) {
    Map<LibraryCapability, Boolean> status = new EnumMap<>(LibraryCapability.class);
    for (LibraryCapability c : capabilities) {
        status.put(c, c.status(executionSettings));
    }
    return status;
}

It may look a bit involved, but the advantage is that whenever you add a new LibraryCapability you will be forced to provide the predicate, and this method will stay untouched. This is more in line with the open-closed OOP principle

@@ -31,7 +31,10 @@ public static synchronized void start(TestFrameworkInstrumentation framework) {
HANDLERS.put(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say let's make the start method accept the list of capabilities. And then locate the hardcoded lists in the utility classes for each corresponding framework (JUnit, MUnit, Cucumber). Having MUnit and Cucumber capabilities hard-coded in JUnit utils feels off

Copy link
Contributor

Choose a reason for hiding this comment

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

Same goes for JUnit5

DDTags.LIBRARY_CAPABILITIES_EFD,
DDTags.LIBRARY_CAPABILITIES_IMPACTED_TESTS,
DDTags.LIBRARY_CAPABILITIES_QUARANTINE,
DDTags.LIBRARY_CAPABILITIES_ATTEMPT_TO_FIX
Copy link
Contributor

Choose a reason for hiding this comment

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

Once we have the list of capabilities hardcoded in MUnit utils we can rewrite the tests to avoid hardcoding the tags:

  public abstract class MUnitUtils {
    public static final Collection<LibraryCapability> CAPABILITIES = Arrays.asList(LibraryCapability.A, LibraryCapability.B);
  }

  public void test() {
    arePresent(Arrays.stream(LibraryCapability.values()).map(LibraryCapability::asTag).collect(Collectors.toList()));
    areNotPresent(Arrays.stream(LibraryCapability.values()).filter(capability -> !MUnitUtils.CAPABILITIES.contains(capability)).map(LibraryCapability::asTag).collect(Collectors.toList()));
  }

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, we should be asserting the tags on test events, not sessions

Co-authored-by: Nikita Tkachenko <121111529+nikita-tkachenko-datadog@users.noreply.github.com>
@daniel-mohedano daniel-mohedano marked this pull request as ready for review March 6, 2025 16:52
@daniel-mohedano daniel-mohedano requested review from a team as code owners March 6, 2025 16:52
@daniel-mohedano daniel-mohedano merged commit b34cd6d into master Mar 7, 2025
210 checks passed
@daniel-mohedano daniel-mohedano deleted the daniel.mohedano/library-capabilities-tagging branch March 7, 2025 10:49
@github-actions github-actions bot added this to the 1.48.0 milestone Mar 7, 2025
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.

2 participants