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

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

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 1752771474 1752844543
git_commit_sha 887ea39 68fc6ca
release_version 1.52.0-SNAPSHOT~887ea397cc 1.52.0-SNAPSHOT~68fc6caee7
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752854307 1752854307
ci_job_id 1036558910 1036558910
ci_pipeline_id 71015796 71015796
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-dthyk7gj 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-dthyk7gj 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 50 metrics, 9 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.52.0-SNAPSHOT~68fc6caee7, baseline=1.52.0-SNAPSHOT~887ea397cc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.043 s) : 0, 1043185
Total [baseline] (8.629 s) : 0, 8628841
Agent [candidate] (1.038 s) : 0, 1037632
Total [candidate] (8.591 s) : 0, 8591453
section iast
Agent [baseline] (1.18 s) : 0, 1179721
Total [baseline] (9.276 s) : 0, 9276243
Agent [candidate] (1.171 s) : 0, 1170925
Total [candidate] (9.301 s) : 0, 9301212
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.043 s -
Agent iast 1.18 s 136.536 ms (13.1%)
Total tracing 8.629 s -
Total iast 9.276 s 647.402 ms (7.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.038 s -
Agent iast 1.171 s 133.294 ms (12.8%)
Total tracing 8.591 s -
Total iast 9.301 s 709.759 ms (8.3%)
gantt
    title insecure-bank - break down per module: candidate=1.52.0-SNAPSHOT~68fc6caee7, baseline=1.52.0-SNAPSHOT~887ea397cc

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.432 ms) : 0, 1432
crashtracking [candidate] (1.431 ms) : 0, 1431
BytebuddyAgent [baseline] (730.805 ms) : 0, 730805
BytebuddyAgent [candidate] (729.124 ms) : 0, 729124
GlobalTracer [baseline] (243.943 ms) : 0, 243943
GlobalTracer [candidate] (240.962 ms) : 0, 240962
AppSec [baseline] (30.874 ms) : 0, 30874
AppSec [candidate] (30.363 ms) : 0, 30363
Debugger [baseline] (6.119 ms) : 0, 6119
Debugger [candidate] (6.017 ms) : 0, 6017
Remote Config [baseline] (665.601 µs) : 0, 666
Remote Config [candidate] (657.239 µs) : 0, 657
Telemetry [baseline] (8.377 ms) : 0, 8377
Telemetry [candidate] (8.178 ms) : 0, 8178
section iast
crashtracking [baseline] (1.439 ms) : 0, 1439
crashtracking [candidate] (1.422 ms) : 0, 1422
BytebuddyAgent [baseline] (851.889 ms) : 0, 851889
BytebuddyAgent [candidate] (845.684 ms) : 0, 845684
GlobalTracer [baseline] (232.363 ms) : 0, 232363
GlobalTracer [candidate] (230.87 ms) : 0, 230870
IAST [baseline] (29.232 ms) : 0, 29232
IAST [candidate] (30.559 ms) : 0, 30559
AppSec [baseline] (27.478 ms) : 0, 27478
AppSec [candidate] (26.424 ms) : 0, 26424
Debugger [baseline] (7.699 ms) : 0, 7699
Debugger [candidate] (6.702 ms) : 0, 6702
Remote Config [baseline] (589.34 µs) : 0, 589
Remote Config [candidate] (584.045 µs) : 0, 584
Telemetry [baseline] (8.001 ms) : 0, 8001
Telemetry [candidate] (7.852 ms) : 0, 7852
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.52.0-SNAPSHOT~68fc6caee7, baseline=1.52.0-SNAPSHOT~887ea397cc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.046 s) : 0, 1045739
Total [baseline] (10.623 s) : 0, 10623202
Agent [candidate] (1.04 s) : 0, 1040318
Total [candidate] (10.691 s) : 0, 10690807
section appsec
Agent [baseline] (1.218 s) : 0, 1218487
Total [baseline] (10.762 s) : 0, 10762249
Agent [candidate] (1.216 s) : 0, 1215991
Total [candidate] (10.755 s) : 0, 10755221
section iast
Agent [baseline] (1.175 s) : 0, 1174660
Total [baseline] (10.911 s) : 0, 10911384
Agent [candidate] (1.173 s) : 0, 1172982
Total [candidate] (10.937 s) : 0, 10936965
section profiling
Agent [baseline] (1.183 s) : 0, 1182999
Total [baseline] (10.825 s) : 0, 10824705
Agent [candidate] (1.182 s) : 0, 1182176
Total [candidate] (10.816 s) : 0, 10816182
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.046 s -
Agent appsec 1.218 s 172.748 ms (16.5%)
Agent iast 1.175 s 128.921 ms (12.3%)
Agent profiling 1.183 s 137.259 ms (13.1%)
Total tracing 10.623 s -
Total appsec 10.762 s 139.047 ms (1.3%)
Total iast 10.911 s 288.182 ms (2.7%)
Total profiling 10.825 s 201.503 ms (1.9%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.04 s -
Agent appsec 1.216 s 175.674 ms (16.9%)
Agent iast 1.173 s 132.664 ms (12.8%)
Agent profiling 1.182 s 141.858 ms (13.6%)
Total tracing 10.691 s -
Total appsec 10.755 s 64.414 ms (0.6%)
Total iast 10.937 s 246.159 ms (2.3%)
Total profiling 10.816 s 125.375 ms (1.2%)
gantt
    title petclinic - break down per module: candidate=1.52.0-SNAPSHOT~68fc6caee7, baseline=1.52.0-SNAPSHOT~887ea397cc

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.436 ms) : 0, 1436
crashtracking [candidate] (1.442 ms) : 0, 1442
BytebuddyAgent [baseline] (734.51 ms) : 0, 734510
BytebuddyAgent [candidate] (731.427 ms) : 0, 731427
GlobalTracer [baseline] (242.513 ms) : 0, 242513
GlobalTracer [candidate] (241.146 ms) : 0, 241146
AppSec [baseline] (30.56 ms) : 0, 30560
AppSec [candidate] (30.464 ms) : 0, 30464
Debugger [baseline] (6.046 ms) : 0, 6046
Debugger [candidate] (5.999 ms) : 0, 5999
Remote Config [baseline] (649.402 µs) : 0, 649
Remote Config [candidate] (641.034 µs) : 0, 641
Telemetry [baseline] (9.017 ms) : 0, 9017
Telemetry [candidate] (8.179 ms) : 0, 8179
section appsec
crashtracking [baseline] (1.433 ms) : 0, 1433
crashtracking [candidate] (1.42 ms) : 0, 1420
BytebuddyAgent [baseline] (753.466 ms) : 0, 753466
BytebuddyAgent [candidate] (751.025 ms) : 0, 751025
GlobalTracer [baseline] (233.975 ms) : 0, 233975
GlobalTracer [candidate] (233.984 ms) : 0, 233984
IAST [baseline] (23.493 ms) : 0, 23493
IAST [candidate] (23.47 ms) : 0, 23470
AppSec [baseline] (168.261 ms) : 0, 168261
AppSec [candidate] (168.314 ms) : 0, 168314
Debugger [baseline] (7.844 ms) : 0, 7844
Debugger [candidate] (7.866 ms) : 0, 7866
Remote Config [baseline] (621.873 µs) : 0, 622
Remote Config [candidate] (611.141 µs) : 0, 611
Telemetry [baseline] (8.127 ms) : 0, 8127
Telemetry [candidate] (8.054 ms) : 0, 8054
section iast
crashtracking [baseline] (1.426 ms) : 0, 1426
crashtracking [candidate] (1.438 ms) : 0, 1438
BytebuddyAgent [baseline] (848.073 ms) : 0, 848073
BytebuddyAgent [candidate] (846.951 ms) : 0, 846951
GlobalTracer [baseline] (231.852 ms) : 0, 231852
GlobalTracer [candidate] (231.348 ms) : 0, 231348
IAST [baseline] (27.443 ms) : 0, 27443
IAST [candidate] (29.796 ms) : 0, 29796
AppSec [baseline] (29.686 ms) : 0, 29686
AppSec [candidate] (25.772 ms) : 0, 25772
Debugger [baseline] (6.637 ms) : 0, 6637
Debugger [candidate] (8.249 ms) : 0, 8249
Remote Config [baseline] (581.809 µs) : 0, 582
Remote Config [candidate] (583.542 µs) : 0, 584
Telemetry [baseline] (7.979 ms) : 0, 7979
Telemetry [candidate] (7.865 ms) : 0, 7865
section profiling
crashtracking [baseline] (1.391 ms) : 0, 1391
crashtracking [candidate] (1.394 ms) : 0, 1394
BytebuddyAgent [baseline] (759.082 ms) : 0, 759082
BytebuddyAgent [candidate] (757.817 ms) : 0, 757817
GlobalTracer [baseline] (220.171 ms) : 0, 220171
GlobalTracer [candidate] (219.617 ms) : 0, 219617
AppSec [baseline] (30.287 ms) : 0, 30287
AppSec [candidate] (30.162 ms) : 0, 30162
Debugger [baseline] (6.252 ms) : 0, 6252
Debugger [candidate] (6.28 ms) : 0, 6280
Remote Config [baseline] (662.873 µs) : 0, 663
Remote Config [candidate] (673.12 µs) : 0, 673
Telemetry [baseline] (12.628 ms) : 0, 12628
Telemetry [candidate] (11.78 ms) : 0, 11780
ProfilingAgent [baseline] (104.065 ms) : 0, 104065
ProfilingAgent [candidate] (106.041 ms) : 0, 106041
Profiling [baseline] (104.088 ms) : 0, 104088
Profiling [candidate] (106.064 ms) : 0, 106064
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/environment-step3
git_commit_date 1752771474 1752844543
git_commit_sha 887ea39 68fc6ca
release_version 1.52.0-SNAPSHOT~887ea397cc 1.52.0-SNAPSHOT~68fc6caee7
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752853980 1752853980
ci_job_id 1036558911 1036558911
ci_pipeline_id 71015796 71015796
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-xv0m9yew 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-xv0m9yew 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 2 performance regressions! Performance is the same for 8 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 worse
[+99.582µs; +209.107µs] or [+2.245%; +4.714%]
unstable
[-136.586op/s; +68.149op/s] or [-13.192%; +6.582%]
4.590ms 1001.156op/s 4.436ms 1035.375op/s
scenario:load:insecure-bank:iast_GLOBAL:high_load worse
[+364.150µs; +758.701µs] or [+3.590%; +7.479%]
unstable
[-71.699op/s; +24.262op/s] or [-15.656%; +5.298%]
10.706ms 434.250op/s 10.144ms 457.969op/s
scenario:load:petclinic:no_agent:high_load better
[-1.551ms; -0.893ms] or [-4.105%; -2.363%]
unstable
[-4.688op/s; +12.913op/s] or [-3.786%; +10.429%]
36.557ms 127.925op/s 37.778ms 123.812op/s
scenario:load:petclinic:code_origins:high_load better
[-2.166ms; -1.373ms] or [-4.847%; -3.072%]
unstable
[-3.285op/s; +11.960op/s] or [-3.138%; +11.426%]
42.924ms 109.013op/s 44.694ms 104.675op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~68fc6caee7, baseline=1.52.0-SNAPSHOT~887ea397cc
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.436 ms) : 4386, 4485
.   : milestone, 4436,
iast (9.27 ms) : 9113, 9427
.   : milestone, 9270,
iast_FULL (13.523 ms) : 13257, 13790
.   : milestone, 13523,
iast_GLOBAL (10.144 ms) : 9966, 10323
.   : milestone, 10144,
profiling (8.404 ms) : 8276, 8533
.   : milestone, 8404,
tracing (7.518 ms) : 7407, 7630
.   : milestone, 7518,
section candidate
no_agent (4.59 ms) : 4538, 4642
.   : milestone, 4590,
iast (9.402 ms) : 9248, 9557
.   : milestone, 9402,
iast_FULL (13.91 ms) : 13635, 14186
.   : milestone, 13910,
iast_GLOBAL (10.706 ms) : 10518, 10894
.   : milestone, 10706,
profiling (8.597 ms) : 8466, 8729
.   : milestone, 8597,
tracing (7.634 ms) : 7524, 7744
.   : milestone, 7634,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.436 ms [4.386 ms, 4.485 ms] -
iast 9.27 ms [9.113 ms, 9.427 ms] 4.834 ms (109.0%)
iast_FULL 13.523 ms [13.257 ms, 13.79 ms] 9.088 ms (204.9%)
iast_GLOBAL 10.144 ms [9.966 ms, 10.323 ms] 5.709 ms (128.7%)
profiling 8.404 ms [8.276 ms, 8.533 ms] 3.969 ms (89.5%)
tracing 7.518 ms [7.407 ms, 7.63 ms] 3.083 ms (69.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.59 ms [4.538 ms, 4.642 ms] -
iast 9.402 ms [9.248 ms, 9.557 ms] 4.812 ms (104.8%)
iast_FULL 13.91 ms [13.635 ms, 14.186 ms] 9.32 ms (203.1%)
iast_GLOBAL 10.706 ms [10.518 ms, 10.894 ms] 6.116 ms (133.2%)
profiling 8.597 ms [8.466 ms, 8.729 ms] 4.007 ms (87.3%)
tracing 7.634 ms [7.524 ms, 7.744 ms] 3.044 ms (66.3%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~68fc6caee7, baseline=1.52.0-SNAPSHOT~887ea397cc
    dateFormat X
    axisFormat %s
section baseline
no_agent (37.778 ms) : 37463, 38094
.   : milestone, 37778,
appsec (48.757 ms) : 48304, 49210
.   : milestone, 48757,
code_origins (44.694 ms) : 44309, 45079
.   : milestone, 44694,
iast (44.841 ms) : 44451, 45231
.   : milestone, 44841,
profiling (47.623 ms) : 47191, 48055
.   : milestone, 47623,
tracing (43.412 ms) : 43043, 43781
.   : milestone, 43412,
section candidate
no_agent (36.557 ms) : 36261, 36852
.   : milestone, 36557,
appsec (47.674 ms) : 47225, 48122
.   : milestone, 47674,
code_origins (42.924 ms) : 42572, 43276
.   : milestone, 42924,
iast (44.892 ms) : 44486, 45297
.   : milestone, 44892,
profiling (48.774 ms) : 48304, 49245
.   : milestone, 48774,
tracing (43.89 ms) : 43520, 44259
.   : milestone, 43890,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.778 ms [37.463 ms, 38.094 ms] -
appsec 48.757 ms [48.304 ms, 49.21 ms] 10.979 ms (29.1%)
code_origins 44.694 ms [44.309 ms, 45.079 ms] 6.915 ms (18.3%)
iast 44.841 ms [44.451 ms, 45.231 ms] 7.062 ms (18.7%)
profiling 47.623 ms [47.191 ms, 48.055 ms] 9.844 ms (26.1%)
tracing 43.412 ms [43.043 ms, 43.781 ms] 5.633 ms (14.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 36.557 ms [36.261 ms, 36.852 ms] -
appsec 47.674 ms [47.225 ms, 48.122 ms] 11.117 ms (30.4%)
code_origins 42.924 ms [42.572 ms, 43.276 ms] 6.367 ms (17.4%)
iast 44.892 ms [44.486 ms, 45.297 ms] 8.335 ms (22.8%)
profiling 48.774 ms [48.304 ms, 49.245 ms] 12.218 ms (33.4%)
tracing 43.89 ms [43.52 ms, 44.259 ms] 7.333 ms (20.1%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/environment-step3
git_commit_date 1752771474 1752844543
git_commit_sha 887ea39 68fc6ca
release_version 1.52.0-SNAPSHOT~887ea397cc 1.52.0-SNAPSHOT~68fc6caee7
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1752854504 1752854504
ci_job_id 1036558912 1036558912
ci_pipeline_id 71015796 71015796
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-zsqg59r4 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-zsqg59r4 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 tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~68fc6caee7, baseline=1.52.0-SNAPSHOT~887ea397cc
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.473 ms) : 1461, 1484
.   : milestone, 1473,
appsec (3.691 ms) : 3472, 3910
.   : milestone, 3691,
iast (2.226 ms) : 2161, 2291
.   : milestone, 2226,
iast_GLOBAL (2.278 ms) : 2212, 2344
.   : milestone, 2278,
profiling (2.08 ms) : 2026, 2134
.   : milestone, 2080,
tracing (2.032 ms) : 1981, 2083
.   : milestone, 2032,
section candidate
no_agent (1.476 ms) : 1465, 1488
.   : milestone, 1476,
appsec (3.674 ms) : 3457, 3892
.   : milestone, 3674,
iast (2.223 ms) : 2157, 2288
.   : milestone, 2223,
iast_GLOBAL (2.256 ms) : 2191, 2322
.   : milestone, 2256,
profiling (2.063 ms) : 2011, 2116
.   : milestone, 2063,
tracing (2.038 ms) : 1987, 2089
.   : milestone, 2038,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.473 ms [1.461 ms, 1.484 ms] -
appsec 3.691 ms [3.472 ms, 3.91 ms] 2.218 ms (150.6%)
iast 2.226 ms [2.161 ms, 2.291 ms] 753.114 µs (51.1%)
iast_GLOBAL 2.278 ms [2.212 ms, 2.344 ms] 805.497 µs (54.7%)
profiling 2.08 ms [2.026 ms, 2.134 ms] 607.095 µs (41.2%)
tracing 2.032 ms [1.981 ms, 2.083 ms] 559.737 µs (38.0%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.476 ms [1.465 ms, 1.488 ms] -
appsec 3.674 ms [3.457 ms, 3.892 ms] 2.198 ms (148.9%)
iast 2.223 ms [2.157 ms, 2.288 ms] 746.467 µs (50.6%)
iast_GLOBAL 2.256 ms [2.191 ms, 2.322 ms] 779.985 µs (52.8%)
profiling 2.063 ms [2.011 ms, 2.116 ms] 587.051 µs (39.8%)
tracing 2.038 ms [1.987 ms, 2.089 ms] 561.507 µs (38.0%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~68fc6caee7, baseline=1.52.0-SNAPSHOT~887ea397cc
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.455 s) : 15455000, 15455000
.   : milestone, 15455000,
appsec (14.749 s) : 14749000, 14749000
.   : milestone, 14749000,
iast (18.039 s) : 18039000, 18039000
.   : milestone, 18039000,
iast_GLOBAL (17.604 s) : 17604000, 17604000
.   : milestone, 17604000,
profiling (15.221 s) : 15221000, 15221000
.   : milestone, 15221000,
tracing (14.912 s) : 14912000, 14912000
.   : milestone, 14912000,
section candidate
no_agent (15.65 s) : 15650000, 15650000
.   : milestone, 15650000,
appsec (14.837 s) : 14837000, 14837000
.   : milestone, 14837000,
iast (18.393 s) : 18393000, 18393000
.   : milestone, 18393000,
iast_GLOBAL (17.899 s) : 17899000, 17899000
.   : milestone, 17899000,
profiling (15.425 s) : 15425000, 15425000
.   : milestone, 15425000,
tracing (14.807 s) : 14807000, 14807000
.   : milestone, 14807000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.455 s [15.455 s, 15.455 s] -
appsec 14.749 s [14.749 s, 14.749 s] -706.0 ms (-4.6%)
iast 18.039 s [18.039 s, 18.039 s] 2.584 s (16.7%)
iast_GLOBAL 17.604 s [17.604 s, 17.604 s] 2.149 s (13.9%)
profiling 15.221 s [15.221 s, 15.221 s] -234.0 ms (-1.5%)
tracing 14.912 s [14.912 s, 14.912 s] -543.0 ms (-3.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.65 s [15.65 s, 15.65 s] -
appsec 14.837 s [14.837 s, 14.837 s] -813.0 ms (-5.2%)
iast 18.393 s [18.393 s, 18.393 s] 2.743 s (17.5%)
iast_GLOBAL 17.899 s [17.899 s, 17.899 s] 2.249 s (14.4%)
profiling 15.425 s [15.425 s, 15.425 s] -225.0 ms (-1.4%)
tracing 14.807 s [14.807 s, 14.807 s] -843.0 ms (-5.4%)

@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...

@@ -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 from 68fc6ca to e7cb973 Compare July 21, 2025 08:39
@PerfectSlayer PerfectSlayer force-pushed the bbujon/environment-step3 branch from e7cb973 to a3d54e9 Compare July 21, 2025 08:48
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.

3 participants