Skip to content

Migrate Config system to environment component #9191

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

Merged
merged 3 commits into from
Jul 29, 2025

Conversation

PerfectSlayer
Copy link
Contributor

@PerfectSlayer PerfectSlayer commented Jul 17, 2025

What Does This Do

This PR migrates the config system to the environment component.
It additionally improves the environment component with:

  • the addition of SystemProperties.clear()
  • better null handling on SystemProperties for the set and clear methods.

Motivation

Safely interact with the env var and system properties by handling security manager exception and possible NPE.

Additional Notes

Environment component related stacked PRs:

Contributor Checklist

Jira ticket: LANGPLAT-458

@PerfectSlayer PerfectSlayer added the type: enhancement Enhancements and improvements label Jul 17, 2025
@PerfectSlayer PerfectSlayer requested a review from a team as a code owner July 17, 2025 06:57
@PerfectSlayer PerfectSlayer added the comp: core Tracer core label Jul 17, 2025
@PerfectSlayer PerfectSlayer requested a review from mcculls July 17, 2025 06:57
@PerfectSlayer PerfectSlayer added the tag: no release notes Changes to exclude from release notes label Jul 17, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jul 17, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/environment-step3
git_commit_date 1753705327 1753717009
git_commit_sha 938e591 476cb5f
release_version 1.51.1-SNAPSHOT~938e591e2c 1.51.1-SNAPSHOT~476cb5fd01
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1753718815 1753718815
ci_job_id 1050727465 1050727465
ci_pipeline_id 71906386 71906386
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-4-2m6ztqcd 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-4-2m6ztqcd 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 0 performance improvements and 0 performance regressions! Performance is the same for 47 metrics, 12 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.51.1-SNAPSHOT~476cb5fd01, baseline=1.51.1-SNAPSHOT~938e591e2c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.051 s) : 0, 1050598
Total [baseline] (8.617 s) : 0, 8616646
Agent [candidate] (1.043 s) : 0, 1042645
Total [candidate] (8.617 s) : 0, 8617118
section iast
Agent [baseline] (1.172 s) : 0, 1171872
Total [baseline] (9.356 s) : 0, 9355918
Agent [candidate] (1.181 s) : 0, 1181108
Total [candidate] (9.398 s) : 0, 9398111
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.051 s -
Agent iast 1.172 s 121.274 ms (11.5%)
Total tracing 8.617 s -
Total iast 9.356 s 739.272 ms (8.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.043 s -
Agent iast 1.181 s 138.463 ms (13.3%)
Total tracing 8.617 s -
Total iast 9.398 s 780.993 ms (9.1%)
gantt
    title insecure-bank - break down per module: candidate=1.51.1-SNAPSHOT~476cb5fd01, baseline=1.51.1-SNAPSHOT~938e591e2c

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.438 ms) : 0, 1438
crashtracking [candidate] (1.427 ms) : 0, 1427
BytebuddyAgent [baseline] (735.023 ms) : 0, 735023
BytebuddyAgent [candidate] (729.102 ms) : 0, 729102
GlobalTracer [baseline] (242.832 ms) : 0, 242832
GlobalTracer [candidate] (241.423 ms) : 0, 241423
AppSec [baseline] (30.761 ms) : 0, 30761
AppSec [candidate] (30.305 ms) : 0, 30305
Debugger [baseline] (6.095 ms) : 0, 6095
Debugger [candidate] (6.011 ms) : 0, 6011
Remote Config [baseline] (663.294 µs) : 0, 663
Remote Config [candidate] (663.538 µs) : 0, 664
Telemetry [baseline] (12.725 ms) : 0, 12725
Telemetry [candidate] (12.763 ms) : 0, 12763
section iast
crashtracking [baseline] (1.424 ms) : 0, 1424
crashtracking [candidate] (1.451 ms) : 0, 1451
BytebuddyAgent [baseline] (846.343 ms) : 0, 846343
BytebuddyAgent [candidate] (852.536 ms) : 0, 852536
GlobalTracer [baseline] (231.124 ms) : 0, 231124
GlobalTracer [candidate] (232.273 ms) : 0, 232273
IAST [baseline] (31.369 ms) : 0, 31369
IAST [candidate] (30.193 ms) : 0, 30193
AppSec [baseline] (25.493 ms) : 0, 25493
AppSec [candidate] (27.873 ms) : 0, 27873
Debugger [baseline] (6.696 ms) : 0, 6696
Debugger [candidate] (6.834 ms) : 0, 6834
Remote Config [baseline] (586.968 µs) : 0, 587
Remote Config [candidate] (592.705 µs) : 0, 593
Telemetry [baseline] (8.012 ms) : 0, 8012
Telemetry [candidate] (8.211 ms) : 0, 8211
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.51.1-SNAPSHOT~476cb5fd01, baseline=1.51.1-SNAPSHOT~938e591e2c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.039 s) : 0, 1039134
Total [baseline] (10.822 s) : 0, 10821691
Agent [candidate] (1.052 s) : 0, 1051706
Total [candidate] (10.854 s) : 0, 10853521
section appsec
Agent [baseline] (1.215 s) : 0, 1215432
Total [baseline] (10.774 s) : 0, 10773931
Agent [candidate] (1.22 s) : 0, 1219928
Total [candidate] (10.808 s) : 0, 10808011
section iast
Agent [baseline] (1.175 s) : 0, 1175359
Total [baseline] (10.929 s) : 0, 10928983
Agent [candidate] (1.176 s) : 0, 1175723
Total [candidate] (10.902 s) : 0, 10901508
section profiling
Agent [baseline] (1.189 s) : 0, 1189215
Total [baseline] (10.864 s) : 0, 10864485
Agent [candidate] (1.206 s) : 0, 1205758
Total [candidate] (10.946 s) : 0, 10945861
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.039 s -
Agent appsec 1.215 s 176.298 ms (17.0%)
Agent iast 1.175 s 136.225 ms (13.1%)
Agent profiling 1.189 s 150.081 ms (14.4%)
Total tracing 10.822 s -
Total appsec 10.774 s -47.761 ms (-0.4%)
Total iast 10.929 s 107.292 ms (1.0%)
Total profiling 10.864 s 42.794 ms (0.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.052 s -
Agent appsec 1.22 s 168.222 ms (16.0%)
Agent iast 1.176 s 124.017 ms (11.8%)
Agent profiling 1.206 s 154.052 ms (14.6%)
Total tracing 10.854 s -
Total appsec 10.808 s -45.51 ms (-0.4%)
Total iast 10.902 s 47.987 ms (0.4%)
Total profiling 10.946 s 92.34 ms (0.9%)
gantt
    title petclinic - break down per module: candidate=1.51.1-SNAPSHOT~476cb5fd01, baseline=1.51.1-SNAPSHOT~938e591e2c

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.427 ms) : 0, 1427
crashtracking [candidate] (1.443 ms) : 0, 1443
BytebuddyAgent [baseline] (727.892 ms) : 0, 727892
BytebuddyAgent [candidate] (736.996 ms) : 0, 736996
GlobalTracer [baseline] (241.209 ms) : 0, 241209
GlobalTracer [candidate] (243.231 ms) : 0, 243231
AppSec [baseline] (30.33 ms) : 0, 30330
AppSec [candidate] (30.729 ms) : 0, 30729
Debugger [baseline] (6.032 ms) : 0, 6032
Debugger [candidate] (6.085 ms) : 0, 6085
Remote Config [baseline] (655.944 µs) : 0, 656
Remote Config [candidate] (654.752 µs) : 0, 655
Telemetry [baseline] (10.615 ms) : 0, 10615
Telemetry [candidate] (11.431 ms) : 0, 11431
section appsec
crashtracking [baseline] (1.44 ms) : 0, 1440
crashtracking [candidate] (1.426 ms) : 0, 1426
BytebuddyAgent [baseline] (749.137 ms) : 0, 749137
BytebuddyAgent [candidate] (753.054 ms) : 0, 753054
GlobalTracer [baseline] (234.418 ms) : 0, 234418
GlobalTracer [candidate] (234.677 ms) : 0, 234677
IAST [baseline] (23.545 ms) : 0, 23545
IAST [candidate] (23.605 ms) : 0, 23605
AppSec [baseline] (166.557 ms) : 0, 166557
AppSec [candidate] (168.385 ms) : 0, 168385
Debugger [baseline] (8.703 ms) : 0, 8703
Debugger [candidate] (6.509 ms) : 0, 6509
Remote Config [baseline] (614.712 µs) : 0, 615
Remote Config [candidate] (624.324 µs) : 0, 624
Telemetry [baseline] (9.774 ms) : 0, 9774
Telemetry [candidate] (10.544 ms) : 0, 10544
section iast
crashtracking [baseline] (1.462 ms) : 0, 1462
crashtracking [candidate] (1.429 ms) : 0, 1429
BytebuddyAgent [baseline] (848.52 ms) : 0, 848520
BytebuddyAgent [candidate] (848.107 ms) : 0, 848107
GlobalTracer [baseline] (231.6 ms) : 0, 231600
GlobalTracer [candidate] (232.773 ms) : 0, 232773
IAST [baseline] (30.738 ms) : 0, 30738
IAST [candidate] (27.602 ms) : 0, 27602
AppSec [baseline] (25.614 ms) : 0, 25614
AppSec [candidate] (29.179 ms) : 0, 29179
Debugger [baseline] (7.636 ms) : 0, 7636
Debugger [candidate] (6.712 ms) : 0, 6712
Remote Config [baseline] (596.084 µs) : 0, 596
Remote Config [candidate] (590.55 µs) : 0, 591
Telemetry [baseline] (8.13 ms) : 0, 8130
Telemetry [candidate] (8.249 ms) : 0, 8249
section profiling
crashtracking [baseline] (1.398 ms) : 0, 1398
crashtracking [candidate] (1.417 ms) : 0, 1417
BytebuddyAgent [baseline] (757.829 ms) : 0, 757829
BytebuddyAgent [candidate] (768.113 ms) : 0, 768113
GlobalTracer [baseline] (220.173 ms) : 0, 220173
GlobalTracer [candidate] (222.795 ms) : 0, 222795
AppSec [baseline] (30.096 ms) : 0, 30096
AppSec [candidate] (30.992 ms) : 0, 30992
Debugger [baseline] (6.23 ms) : 0, 6230
Debugger [candidate] (7.132 ms) : 0, 7132
Remote Config [baseline] (678.778 µs) : 0, 679
Remote Config [candidate] (685.138 µs) : 0, 685
Telemetry [baseline] (15.831 ms) : 0, 15831
Telemetry [candidate] (15.402 ms) : 0, 15402
ProfilingAgent [baseline] (107.841 ms) : 0, 107841
ProfilingAgent [candidate] (109.217 ms) : 0, 109217
Profiling [baseline] (108.464 ms) : 0, 108464
Profiling [candidate] (109.934 ms) : 0, 109934
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/environment-step3
git_commit_date 1753734420 1753717009
git_commit_sha 76639fb 476cb5f
release_version 1.51.1-SNAPSHOT~76639fbbfd 1.51.1-SNAPSHOT~476cb5fd01
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1753773994 1753773994
ci_job_id 1052047574 1052047574
ci_pipeline_id 71906386 71906386
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-znssrhrv 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-znssrhrv 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 2 performance improvements and 4 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:no_agent:high_load better
[-301.159µs; -180.637µs] or [-6.719%; -4.030%]
unstable
[-70.270op/s; +185.020op/s] or [-6.860%; +18.063%]
4.241ms 1081.688op/s 4.482ms 1024.312op/s
scenario:load:insecure-bank:tracing:high_load worse
[+429.664µs; +690.322µs] or [+5.660%; +9.093%]
unstable
[-124.980op/s; +42.105op/s] or [-20.487%; +6.902%]
8.152ms 568.594op/s 7.592ms 610.031op/s
scenario:load:insecure-bank:profiling:high_load worse
[+287.854µs; +614.782µs] or [+3.218%; +6.874%]
unstable
[-97.631op/s; +48.319op/s] or [-18.825%; +9.317%]
9.395ms 493.969op/s 8.944ms 518.625op/s
scenario:load:petclinic:no_agent:high_load worse
[+2.298ms; +2.932ms] or [+6.464%; +8.248%]
unstable
[-18.100op/s; +0.200op/s] or [-13.764%; +0.152%]
38.161ms 122.550op/s 35.546ms 131.500op/s
scenario:load:petclinic:tracing:high_load better
[-2.207ms; -1.423ms] or [-4.990%; -3.217%]
unstable
[-3.396op/s; +12.371op/s] or [-3.211%; +11.697%]
42.425ms 110.250op/s 44.240ms 105.763op/s
scenario:load:petclinic:iast:high_load worse
[+1.737ms; +2.568ms] or [+3.934%; +5.818%]
unstable
[-12.336op/s; +2.436op/s] or [-11.636%; +2.297%]
46.290ms 101.062op/s 44.138ms 106.013op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.51.1-SNAPSHOT~476cb5fd01, baseline=1.51.1-SNAPSHOT~76639fbbfd
    dateFormat X
    axisFormat %s
section baseline
no_agent (35.546 ms) : 35266, 35826
.   : milestone, 35546,
appsec (46.821 ms) : 46414, 47229
.   : milestone, 46821,
code_origins (45.269 ms) : 44872, 45667
.   : milestone, 45269,
iast (44.138 ms) : 43758, 44518
.   : milestone, 44138,
profiling (49.326 ms) : 48839, 49813
.   : milestone, 49326,
tracing (44.24 ms) : 43873, 44606
.   : milestone, 44240,
section candidate
no_agent (38.161 ms) : 37852, 38470
.   : milestone, 38161,
appsec (46.623 ms) : 46207, 47038
.   : milestone, 46623,
code_origins (46.211 ms) : 45802, 46619
.   : milestone, 46211,
iast (46.29 ms) : 45898, 46683
.   : milestone, 46290,
profiling (50.591 ms) : 50107, 51075
.   : milestone, 50591,
tracing (42.425 ms) : 42062, 42787
.   : milestone, 42425,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 35.546 ms [35.266 ms, 35.826 ms] -
appsec 46.821 ms [46.414 ms, 47.229 ms] 11.275 ms (31.7%)
code_origins 45.269 ms [44.872 ms, 45.667 ms] 9.723 ms (27.4%)
iast 44.138 ms [43.758 ms, 44.518 ms] 8.592 ms (24.2%)
profiling 49.326 ms [48.839 ms, 49.813 ms] 13.78 ms (38.8%)
tracing 44.24 ms [43.873 ms, 44.606 ms] 8.694 ms (24.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 38.161 ms [37.852 ms, 38.47 ms] -
appsec 46.623 ms [46.207 ms, 47.038 ms] 8.462 ms (22.2%)
code_origins 46.211 ms [45.802 ms, 46.619 ms] 8.05 ms (21.1%)
iast 46.29 ms [45.898 ms, 46.683 ms] 8.13 ms (21.3%)
profiling 50.591 ms [50.107 ms, 51.075 ms] 12.43 ms (32.6%)
tracing 42.425 ms [42.062 ms, 42.787 ms] 4.264 ms (11.2%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.51.1-SNAPSHOT~476cb5fd01, baseline=1.51.1-SNAPSHOT~76639fbbfd
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.482 ms) : 4422, 4541
.   : milestone, 4482,
iast (9.308 ms) : 9159, 9457
.   : milestone, 9308,
iast_FULL (14.001 ms) : 13723, 14279
.   : milestone, 14001,
iast_GLOBAL (10.042 ms) : 9862, 10222
.   : milestone, 10042,
profiling (8.944 ms) : 8799, 9090
.   : milestone, 8944,
tracing (7.592 ms) : 7480, 7703
.   : milestone, 7592,
section candidate
no_agent (4.241 ms) : 4189, 4293
.   : milestone, 4241,
iast (9.351 ms) : 9198, 9505
.   : milestone, 9351,
iast_FULL (14.017 ms) : 13738, 14296
.   : milestone, 14017,
iast_GLOBAL (9.852 ms) : 9682, 10023
.   : milestone, 9852,
profiling (9.395 ms) : 9237, 9553
.   : milestone, 9395,
tracing (8.152 ms) : 8022, 8281
.   : milestone, 8152,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.482 ms [4.422 ms, 4.541 ms] -
iast 9.308 ms [9.159 ms, 9.457 ms] 4.826 ms (107.7%)
iast_FULL 14.001 ms [13.723 ms, 14.279 ms] 9.519 ms (212.4%)
iast_GLOBAL 10.042 ms [9.862 ms, 10.222 ms] 5.56 ms (124.1%)
profiling 8.944 ms [8.799 ms, 9.09 ms] 4.462 ms (99.6%)
tracing 7.592 ms [7.48 ms, 7.703 ms] 3.11 ms (69.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.241 ms [4.189 ms, 4.293 ms] -
iast 9.351 ms [9.198 ms, 9.505 ms] 5.11 ms (120.5%)
iast_FULL 14.017 ms [13.738 ms, 14.296 ms] 9.776 ms (230.5%)
iast_GLOBAL 9.852 ms [9.682 ms, 10.023 ms] 5.611 ms (132.3%)
profiling 9.395 ms [9.237 ms, 9.553 ms] 5.154 ms (121.5%)
tracing 8.152 ms [8.022 ms, 8.281 ms] 3.911 ms (92.2%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/environment-step3
git_commit_date 1753705327 1753717009
git_commit_sha 938e591 476cb5f
release_version 1.51.1-SNAPSHOT~938e591e2c 1.51.1-SNAPSHOT~476cb5fd01
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1753718908 1753718908
ci_job_id 1050727467 1050727467
ci_pipeline_id 71906386 71906386
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-yad7zjbv 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-yad7zjbv 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.51.1-SNAPSHOT~476cb5fd01, baseline=1.51.1-SNAPSHOT~938e591e2c
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.63 s) : 15630000, 15630000
.   : milestone, 15630000,
appsec (14.899 s) : 14899000, 14899000
.   : milestone, 14899000,
iast (18.709 s) : 18709000, 18709000
.   : milestone, 18709000,
iast_GLOBAL (18.065 s) : 18065000, 18065000
.   : milestone, 18065000,
profiling (15.714 s) : 15714000, 15714000
.   : milestone, 15714000,
tracing (14.937 s) : 14937000, 14937000
.   : milestone, 14937000,
section candidate
no_agent (14.921 s) : 14921000, 14921000
.   : milestone, 14921000,
appsec (14.856 s) : 14856000, 14856000
.   : milestone, 14856000,
iast (18.207 s) : 18207000, 18207000
.   : milestone, 18207000,
iast_GLOBAL (17.823 s) : 17823000, 17823000
.   : milestone, 17823000,
profiling (15.492 s) : 15492000, 15492000
.   : milestone, 15492000,
tracing (15.025 s) : 15025000, 15025000
.   : milestone, 15025000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.63 s [15.63 s, 15.63 s] -
appsec 14.899 s [14.899 s, 14.899 s] -731.0 ms (-4.7%)
iast 18.709 s [18.709 s, 18.709 s] 3.079 s (19.7%)
iast_GLOBAL 18.065 s [18.065 s, 18.065 s] 2.435 s (15.6%)
profiling 15.714 s [15.714 s, 15.714 s] 84.0 ms (0.5%)
tracing 14.937 s [14.937 s, 14.937 s] -693.0 ms (-4.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.921 s [14.921 s, 14.921 s] -
appsec 14.856 s [14.856 s, 14.856 s] -65.0 ms (-0.4%)
iast 18.207 s [18.207 s, 18.207 s] 3.286 s (22.0%)
iast_GLOBAL 17.823 s [17.823 s, 17.823 s] 2.902 s (19.4%)
profiling 15.492 s [15.492 s, 15.492 s] 571.0 ms (3.8%)
tracing 15.025 s [15.025 s, 15.025 s] 104.0 ms (0.7%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.51.1-SNAPSHOT~476cb5fd01, baseline=1.51.1-SNAPSHOT~938e591e2c
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.477 ms) : 1466, 1489
.   : milestone, 1477,
appsec (3.58 ms) : 3367, 3792
.   : milestone, 3580,
iast (2.2 ms) : 2137, 2263
.   : milestone, 2200,
iast_GLOBAL (2.242 ms) : 2179, 2306
.   : milestone, 2242,
profiling (2.067 ms) : 2015, 2119
.   : milestone, 2067,
tracing (2.014 ms) : 1965, 2063
.   : milestone, 2014,
section candidate
no_agent (1.48 ms) : 1469, 1492
.   : milestone, 1480,
appsec (3.616 ms) : 3401, 3831
.   : milestone, 3616,
iast (2.204 ms) : 2141, 2267
.   : milestone, 2204,
iast_GLOBAL (2.257 ms) : 2193, 2321
.   : milestone, 2257,
profiling (2.052 ms) : 2001, 2103
.   : milestone, 2052,
tracing (2.016 ms) : 1967, 2065
.   : milestone, 2016,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.477 ms [1.466 ms, 1.489 ms] -
appsec 3.58 ms [3.367 ms, 3.792 ms] 2.102 ms (142.3%)
iast 2.2 ms [2.137 ms, 2.263 ms] 722.897 µs (48.9%)
iast_GLOBAL 2.242 ms [2.179 ms, 2.306 ms] 764.632 µs (51.8%)
profiling 2.067 ms [2.015 ms, 2.119 ms] 589.854 µs (39.9%)
tracing 2.014 ms [1.965 ms, 2.063 ms] 536.897 µs (36.3%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.48 ms [1.469 ms, 1.492 ms] -
appsec 3.616 ms [3.401 ms, 3.831 ms] 2.136 ms (144.3%)
iast 2.204 ms [2.141 ms, 2.267 ms] 723.533 µs (48.9%)
iast_GLOBAL 2.257 ms [2.193 ms, 2.321 ms] 776.724 µs (52.5%)
profiling 2.052 ms [2.001 ms, 2.103 ms] 571.475 µs (38.6%)
tracing 2.016 ms [1.967 ms, 2.065 ms] 535.446 µs (36.2%)

@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step2 branch from 78ad76f to 9d287cb Compare July 17, 2025 13:42
@PerfectSlayer PerfectSlayer requested a review from a team as a code owner July 17, 2025 13:42
@PerfectSlayer PerfectSlayer requested review from bric3 and removed request for a team July 17, 2025 13:42
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from b6c331b to 2512a49 Compare July 17, 2025 13:43
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step2 branch from 9d287cb to d374062 Compare July 17, 2025 15:50
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from 2512a49 to fe762c4 Compare July 18, 2025 08:37
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step2 branch from 3cca925 to 8647cfd Compare July 18, 2025 08:51
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from fe762c4 to 41de4a2 Compare July 18, 2025 08:55
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step2 branch from 8647cfd to e085472 Compare July 18, 2025 09:24
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from 41de4a2 to 42d109e Compare July 18, 2025 09:24
@@ -205,7 +204,7 @@ private static Properties loadOtelConfigFile() {
String path = getProperty("otel.javaagent.configuration-file");
if (null != path && !path.isEmpty()) {
if (path.charAt(0) == '~') {
path = System.getProperty("user.home") + path.substring(1);
path = SystemProperties.getOrDefault("user.home", "") + path.substring(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a minor question: why getOrDefault ? is it possible not to have user.home?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the security manager prevents access to this property, SystemProperties.get() will return null.
So using getOrDefault(key, '') should avoid NPE or "null" in path.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. But just curious, how previous code worked?
And would it make sense to build a path that will be not correct?
I have a feeling that we need method in SystemProperties class that will throw IllegalStateException in case when we must have a value.
Here instead of NPE we will introduce logic error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. But just curious, how previous code worked?

I think the whole OTel config source init fails, then config init fails.

And would it make sense to build a path that will be not correct?

That would be a question for @mcculls 😉

I have a feeling that we need method in SystemProperties class that will throw IllegalStateException in case when we must have a value.

We can still check if a value is missing using null check and no default value. The question stays: how should we deal with this case then if we don't want to have a logic error?

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 finally went with a safer approach: only do the ~ substitution if env.home property is set and retrieved.
I applied the same logic to the ConfigProvider (around line 475)

Copy link
Contributor

Choose a reason for hiding this comment

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

The OTel code doesn't handle this condition: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ConfigurationFile.java#L57 - so we can choose.

TBH I doubt that anyone except maybe developers uses the ~ prefix for OTel configuration files, instead preferring the more stable absolute path. This scenario is specific to someone who wants to use an external config file, declares the path to that file using ~, and has a security manager installed that disallows system property access.

This is so unlikely I think using "" is ok as a fallback - but TBH I would also be fine with letting it throw an exception, because this falls into the category of an exceptional situation where it might be safer to not try to second guess...

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. But just curious, how previous code worked?

I doubt the tracer would have got this far - if such a strict security manager was installed and the tracer hadn't been granted this permission, then it would have bailed out earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I revert to an IllegalStateException then?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with your current approach of just not doing the substitution

@@ -205,7 +204,7 @@ private static Properties loadOtelConfigFile() {
String path = getProperty("otel.javaagent.configuration-file");
if (null != path && !path.isEmpty()) {
if (path.charAt(0) == '~') {
path = System.getProperty("user.home") + path.substring(1);
path = SystemProperties.getOrDefault("user.home", "") + path.substring(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. But just curious, how previous code worked?
And would it make sense to build a path that will be not correct?
I have a feeling that we need method in SystemProperties class that will throw IllegalStateException in case when we must have a value.
Here instead of NPE we will introduce logic error.

@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from 42d109e to 68fc6ca Compare July 18, 2025 15:25
Base automatically changed from bbujon/environment-step2 to master July 21, 2025 08:04
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch 2 times, most recently from e7cb973 to a3d54e9 Compare July 21, 2025 08:48
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from a3d54e9 to 9ae7f6a Compare July 21, 2025 11:22
@PerfectSlayer PerfectSlayer enabled auto-merge (squash) July 21, 2025 15:37
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from 9ae7f6a to d61ab39 Compare July 28, 2025 11:47
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from d61ab39 to d83f869 Compare July 28, 2025 12:36
Copy link
Contributor

@mhlidd mhlidd left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 ! I'm wondering if it's worthwhile to have a followup PR add a ForbiddenAPIs rule to prevent the usages of System.setProperty() and System.clearProperty() to encourage the usage of the Environment component. This is something I'm already doing for System.getenv() for Config Inversion :).

@PerfectSlayer
Copy link
Contributor Author

Yes, this is something we should be doing.
I have 15+ stacked PRs that continues the migration and expect to put it in place only when fully migrated.
Will you be handling it then?

@mhlidd
Copy link
Contributor

mhlidd commented Jul 28, 2025

Yes, this is something we should be doing. I have 15+ stacked PRs that continues the migration and expect to put it in place only when fully migrated. Will you be handling it then?

I don't plan on doing it as a part of the Config Inversion effort as it only affects Environment Variables. I can make a separate PR to address System Properties once this is merged though!

Copy link
Contributor

@mcculls mcculls left a comment

Choose a reason for hiding this comment

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

+1 ... just a query about the behaviour change in addByteBuddyRawSetting

@PerfectSlayer PerfectSlayer disabled auto-merge July 28, 2025 15:07
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from d83f869 to 476cb5f Compare July 28, 2025 15:37
@PerfectSlayer PerfectSlayer enabled auto-merge (squash) July 28, 2025 15:47
@PerfectSlayer PerfectSlayer merged commit 24db888 into master Jul 29, 2025
504 checks passed
@PerfectSlayer PerfectSlayer deleted the bbujon/environment-step3 branch July 29, 2025 07:33
@github-actions github-actions bot added this to the 1.52.0 milestone Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: core Tracer core tag: no release notes Changes to exclude from release notes type: enhancement Enhancements and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants