Skip to content

Conversation

mhlidd
Copy link
Contributor

@mhlidd mhlidd commented Sep 15, 2025

What Does This Do

This PR implements basic Config Inversion, aiming to document all DD/OTEL environment variables used in the repo in a supported-configurations.json file.

Components:

  • ConfigInversionStrictStyle.java
    • Enum for how strict to run Config Inversion with.
    • Options are Strict which does not allow any usage of an unknown DD/OTEL environment variable, Warning which allows the usage but sends telemetry about unknown environment variables, and Test which allows the usage of unknown environment variables without sending telemetry.
    • Default value for Strictness is Warning
  • ConfigHelper.java
    • Layer of abstraction between Environment Variable Source and Environment Component that directly compares data loaded from supported-configurations.json to ensure the environment variable queried for is "known"
    • Determines what behavior to take given the ConfigInversionStrictStyle that is set.

Motivation

This PR supports the general Config Inversion theme that has already been implemented in dd-trace-js and currently being implemented in dd-trace-go and dd-trace-rb. Here is the RFC that documents what this project entails.

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@mhlidd mhlidd force-pushed the mhlidd/config_inversion_base branch 2 times, most recently from 1a576ea to 512b2c6 Compare September 15, 2025 21:34
@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mhlidd/config_inversion_base
git_commit_date 1758306588 1758318407
git_commit_sha 3a389f5 89ee457
release_version 1.54.0-SNAPSHOT~3a389f573c 1.54.0-SNAPSHOT~89ee457a98
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1758320210 1758320210
ci_job_id 1139466879 1139466879
ci_pipeline_id 77049626 77049626
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-k5wloc1r 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-k5wloc1r 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 4 performance improvements and 12 performance regressions! Performance is the same for 32 metrics, 11 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:insecure-bank:iast:Agent.start worse
[+32.115ms; +72.731ms] or [+2.785%; +6.307%]
1.206s 1.153s
scenario:startup:insecure-bank:iast:BytebuddyAgent worse
[+38.965ms; +75.243ms] or [+4.821%; +9.310%]
865.263ms 808.159ms
scenario:startup:insecure-bank:tracing:Agent.start worse
[+38.331ms; +47.654ms] or [+3.764%; +4.680%]
1.061s 1.018s
scenario:startup:insecure-bank:tracing:BytebuddyAgent worse
[+44.091ms; +50.617ms] or [+6.428%; +7.379%]
733.308ms 685.953ms
scenario:startup:insecure-bank:tracing:AppSec better
[-1120.740µs; -651.759µs] or [-3.552%; -2.066%]
30.665ms 31.551ms
scenario:startup:petclinic:appsec:BytebuddyAgent worse
[+28.242ms; +49.593ms] or [+3.939%; +6.917%]
755.897ms 716.979ms
scenario:startup:petclinic:appsec:IAST better
[-1.901ms; -0.965ms] or [-7.544%; -3.831%]
23.763ms 25.196ms
scenario:startup:petclinic:iast:BytebuddyAgent worse
[+28.905ms; +51.383ms] or [+3.550%; +6.310%]
854.438ms 814.294ms
scenario:startup:petclinic:profiling:Agent.start worse
[+37.451ms; +60.946ms] or [+3.210%; +5.224%]
1.216s 1.167s
scenario:startup:petclinic:profiling:ProfilingAgent worse
[+6.413ms; +9.993ms] or [+6.274%; +9.776%]
110.414ms 102.212ms
scenario:startup:petclinic:profiling:BytebuddyAgent worse
[+35.717ms; +49.422ms] or [+4.957%; +6.859%]
763.102ms 720.532ms
scenario:startup:petclinic:profiling:Profiling worse
[+6.408ms; +10.007ms] or [+6.233%; +9.734%]
111.014ms 102.807ms
scenario:startup:petclinic:tracing:Agent.start worse
[+31.068ms; +41.899ms] or [+3.041%; +4.101%]
1.058s 1.022s
scenario:startup:petclinic:tracing:BytebuddyAgent worse
[+38.408ms; +45.341ms] or [+5.580%; +6.587%]
730.171ms 688.297ms
scenario:startup:petclinic:tracing:GlobalTracer better
[-8.597ms; -5.912ms] or [-3.320%; -2.283%]
251.669ms 258.924ms
scenario:startup:petclinic:tracing:AppSec better
[-1.522ms; -0.884ms] or [-4.808%; -2.792%]
30.443ms 31.646ms
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.54.0-SNAPSHOT~89ee457a98, baseline=1.54.0-SNAPSHOT~3a389f573c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.022 s) : 0, 1021747
Total [baseline] (10.65 s) : 0, 10649722
Agent [candidate] (1.058 s) : 0, 1058230
Total [candidate] (10.726 s) : 0, 10725816
section appsec
Agent [baseline] (1.207 s) : 0, 1207053
Total [baseline] (11.059 s) : 0, 11058636
Agent [candidate] (1.234 s) : 0, 1234191
Total [candidate] (11.006 s) : 0, 11006487
section iast
Agent [baseline] (1.164 s) : 0, 1164440
Total [baseline] (11.031 s) : 0, 11031442
Agent [candidate] (1.194 s) : 0, 1193656
Total [candidate] (11.024 s) : 0, 11024232
section profiling
Agent [baseline] (1.167 s) : 0, 1166584
Total [baseline] (11.051 s) : 0, 11051225
Agent [candidate] (1.216 s) : 0, 1215782
Total [candidate] (10.973 s) : 0, 10973489
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.022 s -
Agent appsec 1.207 s 185.306 ms (18.1%)
Agent iast 1.164 s 142.694 ms (14.0%)
Agent profiling 1.167 s 144.837 ms (14.2%)
Total tracing 10.65 s -
Total appsec 11.059 s 408.914 ms (3.8%)
Total iast 11.031 s 381.721 ms (3.6%)
Total profiling 11.051 s 401.504 ms (3.8%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.058 s -
Agent appsec 1.234 s 175.961 ms (16.6%)
Agent iast 1.194 s 135.426 ms (12.8%)
Agent profiling 1.216 s 157.552 ms (14.9%)
Total tracing 10.726 s -
Total appsec 11.006 s 280.671 ms (2.6%)
Total iast 11.024 s 298.416 ms (2.8%)
Total profiling 10.973 s 247.673 ms (2.3%)
gantt
    title petclinic - break down per module: candidate=1.54.0-SNAPSHOT~89ee457a98, baseline=1.54.0-SNAPSHOT~3a389f573c

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.461 ms) : 0, 1461
crashtracking [candidate] (1.461 ms) : 0, 1461
BytebuddyAgent [baseline] (688.297 ms) : 0, 688297
BytebuddyAgent [candidate] (730.171 ms) : 0, 730171
GlobalTracer [baseline] (258.924 ms) : 0, 258924
GlobalTracer [candidate] (251.669 ms) : 0, 251669
AppSec [baseline] (31.646 ms) : 0, 31646
AppSec [candidate] (30.443 ms) : 0, 30443
Debugger [baseline] (6.356 ms) : 0, 6356
Debugger [candidate] (6.331 ms) : 0, 6331
Remote Config [baseline] (685.747 µs) : 0, 686
Remote Config [candidate] (697.578 µs) : 0, 698
Telemetry [baseline] (13.315 ms) : 0, 13315
Telemetry [candidate] (16.323 ms) : 0, 16323
section appsec
crashtracking [baseline] (1.484 ms) : 0, 1484
crashtracking [candidate] (1.451 ms) : 0, 1451
BytebuddyAgent [baseline] (716.979 ms) : 0, 716979
BytebuddyAgent [candidate] (755.897 ms) : 0, 755897
GlobalTracer [baseline] (253.118 ms) : 0, 253118
GlobalTracer [candidate] (245.301 ms) : 0, 245301
AppSec [baseline] (169.683 ms) : 0, 169683
AppSec [candidate] (171.372 ms) : 0, 171372
Debugger [baseline] (6.173 ms) : 0, 6173
Debugger [candidate] (5.997 ms) : 0, 5997
Remote Config [baseline] (633.855 µs) : 0, 634
Remote Config [candidate] (628.299 µs) : 0, 628
Telemetry [baseline] (12.484 ms) : 0, 12484
Telemetry [candidate] (8.533 ms) : 0, 8533
IAST [baseline] (25.196 ms) : 0, 25196
IAST [candidate] (23.763 ms) : 0, 23763
section iast
crashtracking [baseline] (1.47 ms) : 0, 1470
crashtracking [candidate] (1.458 ms) : 0, 1458
BytebuddyAgent [baseline] (814.294 ms) : 0, 814294
BytebuddyAgent [candidate] (854.438 ms) : 0, 854438
GlobalTracer [baseline] (252.115 ms) : 0, 252115
GlobalTracer [candidate] (244.856 ms) : 0, 244856
AppSec [baseline] (30.478 ms) : 0, 30478
AppSec [candidate] (28.795 ms) : 0, 28795
Debugger [baseline] (6.205 ms) : 0, 6205
Debugger [candidate] (6.068 ms) : 0, 6068
Remote Config [baseline] (610.816 µs) : 0, 611
Remote Config [candidate] (588.84 µs) : 0, 589
Telemetry [baseline] (8.357 ms) : 0, 8357
Telemetry [candidate] (8.301 ms) : 0, 8301
IAST [baseline] (29.664 ms) : 0, 29664
IAST [candidate] (28.064 ms) : 0, 28064
section profiling
crashtracking [baseline] (1.446 ms) : 0, 1446
crashtracking [candidate] (1.441 ms) : 0, 1441
BytebuddyAgent [baseline] (720.532 ms) : 0, 720532
BytebuddyAgent [candidate] (763.102 ms) : 0, 763102
GlobalTracer [baseline] (236.066 ms) : 0, 236066
GlobalTracer [candidate] (234.572 ms) : 0, 234572
AppSec [baseline] (31.283 ms) : 0, 31283
AppSec [candidate] (30.726 ms) : 0, 30726
Debugger [baseline] (6.489 ms) : 0, 6489
Debugger [candidate] (13.926 ms) : 0, 13926
Remote Config [baseline] (718.525 µs) : 0, 719
Remote Config [candidate] (727.421 µs) : 0, 727
Telemetry [baseline] (16.519 ms) : 0, 16519
Telemetry [candidate] (9.437 ms) : 0, 9437
ProfilingAgent [baseline] (102.212 ms) : 0, 102212
ProfilingAgent [candidate] (110.414 ms) : 0, 110414
Profiling [baseline] (102.807 ms) : 0, 102807
Profiling [candidate] (111.014 ms) : 0, 111014
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.54.0-SNAPSHOT~89ee457a98, baseline=1.54.0-SNAPSHOT~3a389f573c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.018 s) : 0, 1018264
Total [baseline] (8.637 s) : 0, 8637085
Agent [candidate] (1.061 s) : 0, 1061256
Total [candidate] (8.671 s) : 0, 8671278
section iast
Agent [baseline] (1.153 s) : 0, 1153149
Total [baseline] (9.349 s) : 0, 9349351
Agent [candidate] (1.206 s) : 0, 1205572
Total [candidate] (9.337 s) : 0, 9336748
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.018 s -
Agent iast 1.153 s 134.885 ms (13.2%)
Total tracing 8.637 s -
Total iast 9.349 s 712.266 ms (8.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.061 s -
Agent iast 1.206 s 144.316 ms (13.6%)
Total tracing 8.671 s -
Total iast 9.337 s 665.47 ms (7.7%)
gantt
    title insecure-bank - break down per module: candidate=1.54.0-SNAPSHOT~89ee457a98, baseline=1.54.0-SNAPSHOT~3a389f573c

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.464 ms) : 0, 1464
crashtracking [candidate] (1.468 ms) : 0, 1468
BytebuddyAgent [baseline] (685.953 ms) : 0, 685953
BytebuddyAgent [candidate] (733.308 ms) : 0, 733308
GlobalTracer [baseline] (257.883 ms) : 0, 257883
GlobalTracer [candidate] (252.131 ms) : 0, 252131
AppSec [baseline] (31.551 ms) : 0, 31551
AppSec [candidate] (30.665 ms) : 0, 30665
Debugger [baseline] (6.306 ms) : 0, 6306
Debugger [candidate] (6.378 ms) : 0, 6378
Remote Config [baseline] (681.995 µs) : 0, 682
Remote Config [candidate] (687.973 µs) : 0, 688
Telemetry [baseline] (13.464 ms) : 0, 13464
Telemetry [candidate] (15.639 ms) : 0, 15639
section iast
crashtracking [baseline] (1.463 ms) : 0, 1463
crashtracking [candidate] (1.474 ms) : 0, 1474
BytebuddyAgent [baseline] (808.159 ms) : 0, 808159
BytebuddyAgent [candidate] (865.263 ms) : 0, 865263
GlobalTracer [baseline] (248.81 ms) : 0, 248810
GlobalTracer [candidate] (246.805 ms) : 0, 246805
AppSec [baseline] (26.474 ms) : 0, 26474
AppSec [candidate] (29.195 ms) : 0, 29195
Debugger [baseline] (6.093 ms) : 0, 6093
Debugger [candidate] (6.115 ms) : 0, 6115
Remote Config [baseline] (608.406 µs) : 0, 608
Remote Config [candidate] (606.902 µs) : 0, 607
Telemetry [baseline] (8.06 ms) : 0, 8060
Telemetry [candidate] (8.328 ms) : 0, 8328
IAST [baseline] (32.547 ms) : 0, 32547
IAST [candidate] (26.637 ms) : 0, 26637
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mhlidd/config_inversion_base
git_commit_date 1758306588 1758318407
git_commit_sha 3a389f5 89ee457
release_version 1.54.0-SNAPSHOT~3a389f573c 1.54.0-SNAPSHOT~89ee457a98
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1758319877 1758319877
ci_job_id 1139466880 1139466880
ci_pipeline_id 77049626 77049626
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-oq2ckokq 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-oq2ckokq 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 3 performance improvements and 0 performance regressions! Performance is the same for 9 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:iast_FULL:high_load better
[-1227.761µs; -601.160µs] or [-8.192%; -4.011%]
unstable
[-19.979op/s; +60.104op/s] or [-6.423%; +19.322%]
14.074ms 331.125op/s 14.988ms 311.062op/s
scenario:load:insecure-bank:profiling:high_load better
[-482.499µs; -184.466µs] or [-5.329%; -2.037%]
unstable
[-53.056op/s; +91.494op/s] or [-10.350%; +17.848%]
8.720ms 531.844op/s 9.054ms 512.625op/s
scenario:load:petclinic:iast:high_load better
[-2.304ms; -1.456ms] or [-5.007%; -3.164%]
unstable
[-3.436op/s; +12.086op/s] or [-3.379%; +11.888%]
44.137ms 105.987op/s 46.017ms 101.662op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~89ee457a98, baseline=1.54.0-SNAPSHOT~3a389f573c
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.384 ms) : 4335, 4432
.   : milestone, 4384,
iast (9.592 ms) : 9433, 9752
.   : milestone, 9592,
iast_FULL (14.988 ms) : 14688, 15289
.   : milestone, 14988,
iast_GLOBAL (10.179 ms) : 10003, 10355
.   : milestone, 10179,
profiling (9.054 ms) : 8913, 9194
.   : milestone, 9054,
tracing (7.58 ms) : 7466, 7694
.   : milestone, 7580,
section candidate
no_agent (4.326 ms) : 4277, 4374
.   : milestone, 4326,
iast (9.296 ms) : 9141, 9450
.   : milestone, 9296,
iast_FULL (14.074 ms) : 13792, 14355
.   : milestone, 14074,
iast_GLOBAL (9.96 ms) : 9789, 10132
.   : milestone, 9960,
profiling (8.72 ms) : 8584, 8856
.   : milestone, 8720,
tracing (7.655 ms) : 7539, 7771
.   : milestone, 7655,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.384 ms [4.335 ms, 4.432 ms] -
iast 9.592 ms [9.433 ms, 9.752 ms] 5.209 ms (118.8%)
iast_FULL 14.988 ms [14.688 ms, 15.289 ms] 10.604 ms (241.9%)
iast_GLOBAL 10.179 ms [10.003 ms, 10.355 ms] 5.795 ms (132.2%)
profiling 9.054 ms [8.913 ms, 9.194 ms] 4.67 ms (106.5%)
tracing 7.58 ms [7.466 ms, 7.694 ms] 3.197 ms (72.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.326 ms [4.277 ms, 4.374 ms] -
iast 9.296 ms [9.141 ms, 9.45 ms] 4.97 ms (114.9%)
iast_FULL 14.074 ms [13.792 ms, 14.355 ms] 9.748 ms (225.4%)
iast_GLOBAL 9.96 ms [9.789 ms, 10.132 ms] 5.635 ms (130.3%)
profiling 8.72 ms [8.584 ms, 8.856 ms] 4.395 ms (101.6%)
tracing 7.655 ms [7.539 ms, 7.771 ms] 3.329 ms (77.0%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~89ee457a98, baseline=1.54.0-SNAPSHOT~3a389f573c
    dateFormat X
    axisFormat %s
section baseline
no_agent (37.297 ms) : 36998, 37596
.   : milestone, 37297,
appsec (48.467 ms) : 48042, 48893
.   : milestone, 48467,
code_origins (46.308 ms) : 45900, 46716
.   : milestone, 46308,
iast (46.017 ms) : 45613, 46422
.   : milestone, 46017,
profiling (48.823 ms) : 48309, 49337
.   : milestone, 48823,
tracing (44.61 ms) : 44230, 44989
.   : milestone, 44610,
section candidate
no_agent (37.275 ms) : 36977, 37572
.   : milestone, 37275,
appsec (47.161 ms) : 46748, 47573
.   : milestone, 47161,
code_origins (45.561 ms) : 45171, 45952
.   : milestone, 45561,
iast (44.137 ms) : 43754, 44520
.   : milestone, 44137,
profiling (49.636 ms) : 49150, 50121
.   : milestone, 49636,
tracing (44.501 ms) : 44120, 44882
.   : milestone, 44501,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.297 ms [36.998 ms, 37.596 ms] -
appsec 48.467 ms [48.042 ms, 48.893 ms] 11.17 ms (29.9%)
code_origins 46.308 ms [45.9 ms, 46.716 ms] 9.011 ms (24.2%)
iast 46.017 ms [45.613 ms, 46.422 ms] 8.72 ms (23.4%)
profiling 48.823 ms [48.309 ms, 49.337 ms] 11.526 ms (30.9%)
tracing 44.61 ms [44.23 ms, 44.989 ms] 7.312 ms (19.6%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.275 ms [36.977 ms, 37.572 ms] -
appsec 47.161 ms [46.748 ms, 47.573 ms] 9.886 ms (26.5%)
code_origins 45.561 ms [45.171 ms, 45.952 ms] 8.287 ms (22.2%)
iast 44.137 ms [43.754 ms, 44.52 ms] 6.863 ms (18.4%)
profiling 49.636 ms [49.15 ms, 50.121 ms] 12.361 ms (33.2%)
tracing 44.501 ms [44.12 ms, 44.882 ms] 7.227 ms (19.4%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mhlidd/config_inversion_base
git_commit_date 1758306588 1758318407
git_commit_sha 3a389f5 89ee457
release_version 1.54.0-SNAPSHOT~3a389f573c 1.54.0-SNAPSHOT~89ee457a98
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1758320400 1758320400
ci_job_id 1139466881 1139466881
ci_pipeline_id 77049626 77049626
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-w2y622wd 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-w2y622wd 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.54.0-SNAPSHOT~89ee457a98, baseline=1.54.0-SNAPSHOT~3a389f573c
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.475 ms) : 1463, 1486
.   : milestone, 1475,
appsec (2.463 ms) : 2413, 2514
.   : milestone, 2463,
iast (2.203 ms) : 2141, 2266
.   : milestone, 2203,
iast_GLOBAL (2.255 ms) : 2192, 2318
.   : milestone, 2255,
profiling (2.052 ms) : 2001, 2103
.   : milestone, 2052,
tracing (2.028 ms) : 1978, 2077
.   : milestone, 2028,
section candidate
no_agent (1.477 ms) : 1465, 1488
.   : milestone, 1477,
appsec (3.66 ms) : 3445, 3875
.   : milestone, 3660,
iast (2.203 ms) : 2141, 2266
.   : milestone, 2203,
iast_GLOBAL (2.24 ms) : 2177, 2302
.   : milestone, 2240,
profiling (2.086 ms) : 2033, 2139
.   : milestone, 2086,
tracing (2.031 ms) : 1982, 2080
.   : milestone, 2031,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.463 ms, 1.486 ms] -
appsec 2.463 ms [2.413 ms, 2.514 ms] 988.375 µs (67.0%)
iast 2.203 ms [2.141 ms, 2.266 ms] 728.431 µs (49.4%)
iast_GLOBAL 2.255 ms [2.192 ms, 2.318 ms] 780.117 µs (52.9%)
profiling 2.052 ms [2.001 ms, 2.103 ms] 577.125 µs (39.1%)
tracing 2.028 ms [1.978 ms, 2.077 ms] 552.788 µs (37.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.477 ms [1.465 ms, 1.488 ms] -
appsec 3.66 ms [3.445 ms, 3.875 ms] 2.183 ms (147.8%)
iast 2.203 ms [2.141 ms, 2.266 ms] 726.629 µs (49.2%)
iast_GLOBAL 2.24 ms [2.177 ms, 2.302 ms] 762.721 µs (51.6%)
profiling 2.086 ms [2.033 ms, 2.139 ms] 609.309 µs (41.3%)
tracing 2.031 ms [1.982 ms, 2.08 ms] 554.211 µs (37.5%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~89ee457a98, baseline=1.54.0-SNAPSHOT~3a389f573c
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.968 s) : 14968000, 14968000
.   : milestone, 14968000,
appsec (14.844 s) : 14844000, 14844000
.   : milestone, 14844000,
iast (18.524 s) : 18524000, 18524000
.   : milestone, 18524000,
iast_GLOBAL (17.845 s) : 17845000, 17845000
.   : milestone, 17845000,
profiling (15.449 s) : 15449000, 15449000
.   : milestone, 15449000,
tracing (14.897 s) : 14897000, 14897000
.   : milestone, 14897000,
section candidate
no_agent (15.085 s) : 15085000, 15085000
.   : milestone, 15085000,
appsec (14.989 s) : 14989000, 14989000
.   : milestone, 14989000,
iast (18.576 s) : 18576000, 18576000
.   : milestone, 18576000,
iast_GLOBAL (18.148 s) : 18148000, 18148000
.   : milestone, 18148000,
profiling (15.452 s) : 15452000, 15452000
.   : milestone, 15452000,
tracing (14.879 s) : 14879000, 14879000
.   : milestone, 14879000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.968 s [14.968 s, 14.968 s] -
appsec 14.844 s [14.844 s, 14.844 s] -124.0 ms (-0.8%)
iast 18.524 s [18.524 s, 18.524 s] 3.556 s (23.8%)
iast_GLOBAL 17.845 s [17.845 s, 17.845 s] 2.877 s (19.2%)
profiling 15.449 s [15.449 s, 15.449 s] 481.0 ms (3.2%)
tracing 14.897 s [14.897 s, 14.897 s] -71.0 ms (-0.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.085 s [15.085 s, 15.085 s] -
appsec 14.989 s [14.989 s, 14.989 s] -96.0 ms (-0.6%)
iast 18.576 s [18.576 s, 18.576 s] 3.491 s (23.1%)
iast_GLOBAL 18.148 s [18.148 s, 18.148 s] 3.063 s (20.3%)
profiling 15.452 s [15.452 s, 15.452 s] 367.0 ms (2.4%)
tracing 14.879 s [14.879 s, 14.879 s] -206.0 ms (-1.4%)

Copy link

datadog-official bot commented Sep 16, 2025

🎯 Code Coverage
Patch Coverage: 76.00%
Total Coverage: 57.21%

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 89ee457 | Docs | Was this helpful? Give us feedback!

@mhlidd mhlidd changed the title Mhlidd/config inversion base Implement Config Inversion with Default Strictness of Warning Sep 17, 2025
@mhlidd mhlidd marked this pull request as ready for review September 18, 2025 15:13
@mhlidd mhlidd requested review from a team as code owners September 18, 2025 15:13
@mhlidd mhlidd requested review from AlexeyKuznetsov-DD and mcculls and removed request for a team September 18, 2025 15:13
Copy link
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@mhlidd mhlidd added type: enhancement Enhancements and improvements type: documentation comp: api Tracer public API labels Sep 18, 2025
@mhlidd mhlidd changed the base branch from master to mhlidd/config_inversion_plugins September 18, 2025 21:25
@mhlidd mhlidd force-pushed the mhlidd/config_inversion_base branch from aa18112 to 606dfd0 Compare September 18, 2025 21:32
@mhlidd mhlidd changed the base branch from mhlidd/config_inversion_plugins to mhlidd/migrate_config-utils_tests September 18, 2025 22:06
@mhlidd mhlidd force-pushed the mhlidd/config_inversion_base branch from 606dfd0 to 7cea99b Compare September 18, 2025 22:09
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

👏 praise: ‏Thanks for splitting the PR related to your config changes, that really helps to review 👍

🎯 suggestion: ‏I would recommend trying to decrease the overall (cognitive) complexity by refactoring using new few methods to de-duplicate code and give more meaning.

For example this should have its own function with a meaningful name:

if (key.startsWith("DD_")
          || key.startsWith("OTEL_")
          || configSource.getAliasMapping().containsKey(key))

import java.util.List;
import java.util.Map;

public class ConfigHelper {
Copy link
Contributor

Choose a reason for hiding this comment

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

🎯 suggestion: ‏Helper class usually are final and have a private constructor.

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 was also wondering if this could be made into a singleton as well... and if so there would be no reason to have static methods under it. Not sure if that is the right or wrong direction to go in

Copy link
Contributor

Choose a reason for hiding this comment

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

Usually, an helper class does not have a state. So if you have a state but only one instance, that would be a singleton.
Here might be a big ambiguous because most of the state is immutable, right? It's more like a big static data table and calling the helper methods won't mutate it. But as you have the StrictStyle thing that can change the behavior, I would with a singleton.

Keep in mind helper class / methods should be easier to test than singleton that usually are painful to deal with on test scenario.

configs.put(key, value);
// If this environment variable is the alias of another, and we haven't processed the
// original environment variable yet, handle it here.
} else if (configSource.getAliasMapping().containsKey(key)
Copy link
Contributor

Choose a reason for hiding this comment

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

🎯 suggestion: ‏The lookup is done twice. There should be a way to cache it.
Edit: three time if you consider the get()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case and the one below, would caching the value mainly be for readability and code cleanliness? The lookup itself should take constant time.

Copy link
Contributor

Choose a reason for hiding this comment

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

The main concern would be performance. 3 constant time access is still worth than 1, especially since they are all done from the same method.
The readability is a bonus where it will provide a meaningful variable name and avoid calls like:
List<String> aliasList = configSource.getAliases().get(configSource.getAliasMapping().get(key));

For example, what I would write would be:
List<String> aliases = source.aliases.get(mapping);

  • configSource -> source: yet another "config" does not bring any info from a ConfigInversion class in config package and config module
  • getAliases() -> aliases (or maybe aliases()): there is no need to respect the bean convention if there is no set. Java records even get rid of the getXxx convention as they are immutable
  • configSource.getAliasMapping().get(key) -> mapping: introducing meaningful variable name would decrease cognitive load.

An ever better step would be to have an aliases(String key) method from the ConfigSource class.
Doing so, you don't expose internal collections but intent on the data they hold.

It then becomes:
List<String> aliases = source.aliases(mapping);

+ (configSource.getAliasMapping().containsKey(key)
? "Please use " + configSource.getAliasMapping().get(key) + " instead."
: configSource.getDeprecatedConfigurations().get(key));
System.err.println(warning);
Copy link
Contributor

Choose a reason for hiding this comment

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

/

❔ question: ‏Is it expected to log on System.err?

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 changed it to a log just now. (I remember there was something weird with logging when I first implemented but that might have been due to something separate.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, there is issue with the initializing the logging framework too early. This will depend on the usage that's done of the config helper. It might break in bootstrap for example, while reporting to system.err won't be great once we bootstrap.
There might be some new design constraints here... 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: api Tracer public API type: documentation type: enhancement Enhancements and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants