Skip to content

Conversation

@mcculls
Copy link
Contributor

@mcculls mcculls commented Jun 8, 2024

This PR generates a Muzzle class for each OpenTelemetry instrumentation. This class creates an empty ReferenceMatcher which is then populated by muzzle references translated from the OpenTelemetry API via runtimeMuzzleReferences.

Jira ticket: APMAPI-6

@mcculls mcculls added the inst: opentelemetry OpenTelemetry instrumentation label Jun 8, 2024
@mcculls mcculls marked this pull request as ready for review June 8, 2024 11:31
@mcculls mcculls requested a review from a team as a code owner June 8, 2024 11:31
@mcculls mcculls requested review from PerfectSlayer and am312 June 8, 2024 11:31
@pr-commenter
Copy link

pr-commenter bot commented Jun 8, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/map-otel-muzzle-refs
git_commit_date 1718019311 1718018878
git_commit_sha 57d6042 50953df
release_version 1.36.0-SNAPSHOT~57d6042c7f 1.36.0-SNAPSHOT~50953dfd49
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1718021781 1718021781
ci_job_id 537372118 537372118
ci_pipeline_id 36266711 36266711
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 15 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.36.0-SNAPSHOT~50953dfd49, baseline=1.36.0-SNAPSHOT~57d6042c7f

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.061 s) : 0, 1061369
Total [baseline] (8.541 s) : 0, 8541028
Agent [candidate] (1.065 s) : 0, 1065500
Total [candidate] (8.532 s) : 0, 8532121
section iast
Agent [baseline] (1.166 s) : 0, 1166492
Total [baseline] (8.987 s) : 0, 8986824
Agent [candidate] (1.166 s) : 0, 1165880
Total [candidate] (8.991 s) : 0, 8991201
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.166 s) : 0, 1165776
Total [baseline] (8.963 s) : 0, 8962661
Agent [candidate] (1.165 s) : 0, 1164924
Total [candidate] (8.97 s) : 0, 8970378
section iast_TELEMETRY_OFF
Agent [baseline] (1.166 s) : 0, 1166028
Total [baseline] (8.975 s) : 0, 8975351
Agent [candidate] (1.172 s) : 0, 1171794
Total [candidate] (8.983 s) : 0, 8983461
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.061 s -
Agent iast 1.166 s 105.123 ms (9.9%)
Agent iast_HARDCODED_SECRET_DISABLED 1.166 s 104.407 ms (9.8%)
Agent iast_TELEMETRY_OFF 1.166 s 104.659 ms (9.9%)
Total tracing 8.541 s -
Total iast 8.987 s 445.795 ms (5.2%)
Total iast_HARDCODED_SECRET_DISABLED 8.963 s 421.633 ms (4.9%)
Total iast_TELEMETRY_OFF 8.975 s 434.323 ms (5.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.065 s -
Agent iast 1.166 s 100.38 ms (9.4%)
Agent iast_HARDCODED_SECRET_DISABLED 1.165 s 99.425 ms (9.3%)
Agent iast_TELEMETRY_OFF 1.172 s 106.295 ms (10.0%)
Total tracing 8.532 s -
Total iast 8.991 s 459.08 ms (5.4%)
Total iast_HARDCODED_SECRET_DISABLED 8.97 s 438.257 ms (5.1%)
Total iast_TELEMETRY_OFF 8.983 s 451.34 ms (5.3%)
gantt
    title insecure-bank - break down per module: candidate=1.36.0-SNAPSHOT~50953dfd49, baseline=1.36.0-SNAPSHOT~57d6042c7f

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (664.48 ms) : 0, 664480
BytebuddyAgent [candidate] (667.237 ms) : 0, 667237
GlobalTracer [baseline] (303.6 ms) : 0, 303600
GlobalTracer [candidate] (304.643 ms) : 0, 304643
AppSec [baseline] (50.228 ms) : 0, 50228
AppSec [candidate] (50.314 ms) : 0, 50314
Logs Intake [baseline] (401.665 µs) : 0, 402
Logs Intake [candidate] (399.588 µs) : 0, 400
Remote Config [baseline] (673.489 µs) : 0, 673
Remote Config [candidate] (680.523 µs) : 0, 681
Telemetry [baseline] (7.502 ms) : 0, 7502
Telemetry [candidate] (7.575 ms) : 0, 7575
section iast
BytebuddyAgent [baseline] (778.242 ms) : 0, 778242
BytebuddyAgent [candidate] (776.951 ms) : 0, 776951
GlobalTracer [baseline] (293.327 ms) : 0, 293327
GlobalTracer [candidate] (292.274 ms) : 0, 292274
AppSec [baseline] (46.972 ms) : 0, 46972
AppSec [candidate] (46.959 ms) : 0, 46959
IAST [baseline] (25.32 ms) : 0, 25320
IAST [candidate] (27.909 ms) : 0, 27909
Logs Intake [baseline] (300.605 µs) : 0, 301
Logs Intake [candidate] (302.706 µs) : 0, 303
Remote Config [baseline] (574.345 µs) : 0, 574
Remote Config [candidate] (575.176 µs) : 0, 575
Telemetry [baseline] (8.48 ms) : 0, 8480
Telemetry [candidate] (7.622 ms) : 0, 7622
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (777.711 ms) : 0, 777711
BytebuddyAgent [candidate] (777.125 ms) : 0, 777125
GlobalTracer [baseline] (292.988 ms) : 0, 292988
GlobalTracer [candidate] (292.848 ms) : 0, 292848
AppSec [baseline] (46.676 ms) : 0, 46676
AppSec [candidate] (46.5 ms) : 0, 46500
IAST [baseline] (25.812 ms) : 0, 25812
IAST [candidate] (26.748 ms) : 0, 26748
Logs Intake [baseline] (301.671 µs) : 0, 302
Logs Intake [candidate] (297.861 µs) : 0, 298
Remote Config [baseline] (583.372 µs) : 0, 583
Remote Config [candidate] (557.35 µs) : 0, 557
Telemetry [baseline] (8.397 ms) : 0, 8397
Telemetry [candidate] (7.553 ms) : 0, 7553
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (778.579 ms) : 0, 778579
BytebuddyAgent [candidate] (781.144 ms) : 0, 781144
GlobalTracer [baseline] (293.547 ms) : 0, 293547
GlobalTracer [candidate] (294.978 ms) : 0, 294978
AppSec [baseline] (47.166 ms) : 0, 47166
AppSec [candidate] (46.805 ms) : 0, 46805
IAST [baseline] (22.73 ms) : 0, 22730
IAST [candidate] (27.017 ms) : 0, 27017
Logs Intake [baseline] (301.932 µs) : 0, 302
Logs Intake [candidate] (305.005 µs) : 0, 305
Remote Config [baseline] (568.039 µs) : 0, 568
Remote Config [candidate] (574.694 µs) : 0, 575
Telemetry [baseline] (9.777 ms) : 0, 9777
Telemetry [candidate] (7.584 ms) : 0, 7584
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.36.0-SNAPSHOT~50953dfd49, baseline=1.36.0-SNAPSHOT~57d6042c7f

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.06 s) : 0, 1059752
Total [baseline] (10.498 s) : 0, 10498110
Agent [candidate] (1.06 s) : 0, 1060397
Total [candidate] (10.368 s) : 0, 10368300
section appsec
Agent [baseline] (1.183 s) : 0, 1182766
Total [baseline] (10.493 s) : 0, 10492892
Agent [candidate] (1.178 s) : 0, 1177586
Total [candidate] (10.448 s) : 0, 10447505
section iast
Agent [baseline] (1.168 s) : 0, 1167840
Total [baseline] (10.662 s) : 0, 10661573
Agent [candidate] (1.169 s) : 0, 1169041
Total [candidate] (10.755 s) : 0, 10754577
section profiling
Agent [baseline] (1.266 s) : 0, 1266365
Total [baseline] (10.641 s) : 0, 10641096
Agent [candidate] (1.264 s) : 0, 1264426
Total [candidate] (10.663 s) : 0, 10662550
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent appsec 1.183 s 123.013 ms (11.6%)
Agent iast 1.168 s 108.088 ms (10.2%)
Agent profiling 1.266 s 206.613 ms (19.5%)
Total tracing 10.498 s -
Total appsec 10.493 s -5.218 ms (-0.0%)
Total iast 10.662 s 163.463 ms (1.6%)
Total profiling 10.641 s 142.986 ms (1.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent appsec 1.178 s 117.189 ms (11.1%)
Agent iast 1.169 s 108.643 ms (10.2%)
Agent profiling 1.264 s 204.029 ms (19.2%)
Total tracing 10.368 s -
Total appsec 10.448 s 79.205 ms (0.8%)
Total iast 10.755 s 386.277 ms (3.7%)
Total profiling 10.663 s 294.251 ms (2.8%)
gantt
    title petclinic - break down per module: candidate=1.36.0-SNAPSHOT~50953dfd49, baseline=1.36.0-SNAPSHOT~57d6042c7f

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (663.386 ms) : 0, 663386
BytebuddyAgent [candidate] (663.66 ms) : 0, 663660
GlobalTracer [baseline] (303.294 ms) : 0, 303294
GlobalTracer [candidate] (303.761 ms) : 0, 303761
AppSec [baseline] (50.089 ms) : 0, 50089
AppSec [candidate] (50.071 ms) : 0, 50071
Logs Intake [baseline] (391.631 µs) : 0, 392
Logs Intake [candidate] (405.696 µs) : 0, 406
Remote Config [baseline] (677.29 µs) : 0, 677
Remote Config [candidate] (667.145 µs) : 0, 667
Telemetry [baseline] (7.578 ms) : 0, 7578
Telemetry [candidate] (7.444 ms) : 0, 7444
section appsec
BytebuddyAgent [baseline] (677.962 ms) : 0, 677962
BytebuddyAgent [candidate] (673.745 ms) : 0, 673745
GlobalTracer [baseline] (297.93 ms) : 0, 297930
GlobalTracer [candidate] (296.37 ms) : 0, 296370
AppSec [baseline] (152.822 ms) : 0, 152822
AppSec [candidate] (152.511 ms) : 0, 152511
Logs Intake [baseline] (333.72 µs) : 0, 334
Logs Intake [candidate] (336.02 µs) : 0, 336
Remote Config [baseline] (636.812 µs) : 0, 637
Remote Config [candidate] (626.761 µs) : 0, 627
Telemetry [baseline] (7.866 ms) : 0, 7866
Telemetry [candidate] (9.315 ms) : 0, 9315
IAST [baseline] (21.233 ms) : 0, 21233
IAST [candidate] (20.685 ms) : 0, 20685
section iast
BytebuddyAgent [baseline] (778.34 ms) : 0, 778340
BytebuddyAgent [candidate] (778.938 ms) : 0, 778938
GlobalTracer [baseline] (293.288 ms) : 0, 293288
GlobalTracer [candidate] (293.112 ms) : 0, 293112
AppSec [baseline] (47.222 ms) : 0, 47222
AppSec [candidate] (47.098 ms) : 0, 47098
Logs Intake [baseline] (302.221 µs) : 0, 302
Logs Intake [candidate] (300.173 µs) : 0, 300
Remote Config [baseline] (582.117 µs) : 0, 582
Remote Config [candidate] (1.292 ms) : 0, 1292
Telemetry [baseline] (8.382 ms) : 0, 8382
Telemetry [candidate] (8.479 ms) : 0, 8479
IAST [baseline] (26.478 ms) : 0, 26478
IAST [candidate] (26.514 ms) : 0, 26514
section profiling
ProfilingAgent [baseline] (96.025 ms) : 0, 96025
ProfilingAgent [candidate] (95.704 ms) : 0, 95704
BytebuddyAgent [baseline] (666.223 ms) : 0, 666223
BytebuddyAgent [candidate] (665.219 ms) : 0, 665219
GlobalTracer [baseline] (387.89 ms) : 0, 387890
GlobalTracer [candidate] (387.358 ms) : 0, 387358
AppSec [baseline] (50.799 ms) : 0, 50799
AppSec [candidate] (50.758 ms) : 0, 50758
Logs Intake [baseline] (333.63 µs) : 0, 334
Logs Intake [candidate] (332.564 µs) : 0, 333
Remote Config [baseline] (745.897 µs) : 0, 746
Remote Config [candidate] (747.524 µs) : 0, 748
Telemetry [baseline] (7.378 ms) : 0, 7378
Telemetry [candidate] (7.403 ms) : 0, 7403
Profiling [baseline] (96.049 ms) : 0, 96049
Profiling [candidate] (95.728 ms) : 0, 95728
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-06-10T11:47:09 2024-06-10T11:53:57
git_branch master mcculls/map-otel-muzzle-refs
git_commit_date 1718019311 1718018878
git_commit_sha 57d6042 50953df
release_version 1.36.0-SNAPSHOT~57d6042c7f 1.36.0-SNAPSHOT~50953dfd49
start_time 2024-06-10T11:46:55 2024-06-10T11:53:44
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1718020781 1718020781
ci_job_id 537372119 537372119
ci_pipeline_id 36266711 36266711
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics.

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~50953dfd49, baseline=1.36.0-SNAPSHOT~57d6042c7f
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.328 ms) : 1307, 1348
.   : milestone, 1328,
appsec (1.708 ms) : 1683, 1733
.   : milestone, 1708,
appsec_no_iast (1.698 ms) : 1672, 1723
.   : milestone, 1698,
iast (1.483 ms) : 1460, 1506
.   : milestone, 1483,
profiling (1.483 ms) : 1460, 1507
.   : milestone, 1483,
tracing (1.469 ms) : 1445, 1492
.   : milestone, 1469,
section candidate
no_agent (1.338 ms) : 1319, 1358
.   : milestone, 1338,
appsec (1.731 ms) : 1707, 1754
.   : milestone, 1731,
appsec_no_iast (1.709 ms) : 1684, 1734
.   : milestone, 1709,
iast (1.477 ms) : 1455, 1499
.   : milestone, 1477,
profiling (1.489 ms) : 1464, 1514
.   : milestone, 1489,
tracing (1.463 ms) : 1439, 1487
.   : milestone, 1463,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.328 ms [1.307 ms, 1.348 ms] -
appsec 1.708 ms [1.683 ms, 1.733 ms] 380.444 µs (28.7%)
appsec_no_iast 1.698 ms [1.672 ms, 1.723 ms] 369.987 µs (27.9%)
iast 1.483 ms [1.46 ms, 1.506 ms] 155.688 µs (11.7%)
profiling 1.483 ms [1.46 ms, 1.507 ms] 155.751 µs (11.7%)
tracing 1.469 ms [1.445 ms, 1.492 ms] 141.371 µs (10.6%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.338 ms [1.319 ms, 1.358 ms] -
appsec 1.731 ms [1.707 ms, 1.754 ms] 392.22 µs (29.3%)
appsec_no_iast 1.709 ms [1.684 ms, 1.734 ms] 370.911 µs (27.7%)
iast 1.477 ms [1.455 ms, 1.499 ms] 138.941 µs (10.4%)
profiling 1.489 ms [1.464 ms, 1.514 ms] 150.608 µs (11.3%)
tracing 1.463 ms [1.439 ms, 1.487 ms] 124.42 µs (9.3%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~50953dfd49, baseline=1.36.0-SNAPSHOT~57d6042c7f
    dateFormat X
    axisFormat %s
section baseline
no_agent (371.192 µs) : 351, 391
.   : milestone, 371,
iast (480.802 µs) : 460, 502
.   : milestone, 481,
iast_FULL (552.577 µs) : 531, 574
.   : milestone, 553,
iast_GLOBAL (506.238 µs) : 485, 527
.   : milestone, 506,
iast_HARDCODED_SECRET_DISABLED (481.307 µs) : 460, 502
.   : milestone, 481,
iast_INACTIVE (456.393 µs) : 435, 478
.   : milestone, 456,
iast_TELEMETRY_OFF (472.999 µs) : 452, 494
.   : milestone, 473,
tracing (445.537 µs) : 424, 467
.   : milestone, 446,
section candidate
no_agent (369.717 µs) : 350, 389
.   : milestone, 370,
iast (481.432 µs) : 460, 503
.   : milestone, 481,
iast_FULL (552.059 µs) : 531, 573
.   : milestone, 552,
iast_GLOBAL (516.512 µs) : 495, 538
.   : milestone, 517,
iast_HARDCODED_SECRET_DISABLED (477.307 µs) : 457, 498
.   : milestone, 477,
iast_INACTIVE (454.927 µs) : 434, 476
.   : milestone, 455,
iast_TELEMETRY_OFF (471.981 µs) : 451, 493
.   : milestone, 472,
tracing (449.364 µs) : 428, 471
.   : milestone, 449,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 371.192 µs [351.264 µs, 391.12 µs] -
iast 480.802 µs [459.77 µs, 501.834 µs] 109.61 µs (29.5%)
iast_FULL 552.577 µs [531.196 µs, 573.958 µs] 181.385 µs (48.9%)
iast_GLOBAL 506.238 µs [485.434 µs, 527.043 µs] 135.046 µs (36.4%)
iast_HARDCODED_SECRET_DISABLED 481.307 µs [460.177 µs, 502.437 µs] 110.115 µs (29.7%)
iast_INACTIVE 456.393 µs [434.674 µs, 478.112 µs] 85.201 µs (23.0%)
iast_TELEMETRY_OFF 472.999 µs [451.981 µs, 494.017 µs] 101.807 µs (27.4%)
tracing 445.537 µs [424.11 µs, 466.964 µs] 74.345 µs (20.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 369.717 µs [350.265 µs, 389.169 µs] -
iast 481.432 µs [460.268 µs, 502.595 µs] 111.715 µs (30.2%)
iast_FULL 552.059 µs [530.712 µs, 573.406 µs] 182.342 µs (49.3%)
iast_GLOBAL 516.512 µs [494.707 µs, 538.317 µs] 146.795 µs (39.7%)
iast_HARDCODED_SECRET_DISABLED 477.307 µs [456.619 µs, 497.995 µs] 107.59 µs (29.1%)
iast_INACTIVE 454.927 µs [433.98 µs, 475.874 µs] 85.21 µs (23.0%)
iast_TELEMETRY_OFF 471.981 µs [450.6 µs, 493.362 µs] 102.264 µs (27.7%)
tracing 449.364 µs [427.887 µs, 470.84 µs] 79.647 µs (21.5%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/map-otel-muzzle-refs
git_commit_date 1718019311 1718018878
git_commit_sha 57d6042 50953df
release_version 1.36.0-SNAPSHOT~57d6042c7f 1.36.0-SNAPSHOT~50953dfd49
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1718021941 1718021941
ci_job_id 537372121 537372121
ci_pipeline_id 36266711 36266711
cpu_model Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~50953dfd49, baseline=1.36.0-SNAPSHOT~57d6042c7f
    dateFormat X
    axisFormat %s
section baseline
no_agent (20.332 s) : 20332000, 20332000
.   : milestone, 20332000,
appsec (21.33 s) : 21330000, 21330000
.   : milestone, 21330000,
iast (24.094 s) : 24094000, 24094000
.   : milestone, 24094000,
iast_GLOBAL (24.995 s) : 24995000, 24995000
.   : milestone, 24995000,
profiling (20.748 s) : 20748000, 20748000
.   : milestone, 20748000,
tracing (21.423 s) : 21423000, 21423000
.   : milestone, 21423000,
section candidate
no_agent (20.57 s) : 20570000, 20570000
.   : milestone, 20570000,
appsec (21.505 s) : 21505000, 21505000
.   : milestone, 21505000,
iast (24.218 s) : 24218000, 24218000
.   : milestone, 24218000,
iast_GLOBAL (24.916 s) : 24916000, 24916000
.   : milestone, 24916000,
profiling (20.529 s) : 20529000, 20529000
.   : milestone, 20529000,
tracing (20.54 s) : 20540000, 20540000
.   : milestone, 20540000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 20.332 s [20.332 s, 20.332 s] -
appsec 21.33 s [21.33 s, 21.33 s] 998.0 ms (4.9%)
iast 24.094 s [24.094 s, 24.094 s] 3.762 s (18.5%)
iast_GLOBAL 24.995 s [24.995 s, 24.995 s] 4.663 s (22.9%)
profiling 20.748 s [20.748 s, 20.748 s] 416.0 ms (2.0%)
tracing 21.423 s [21.423 s, 21.423 s] 1.091 s (5.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 20.57 s [20.57 s, 20.57 s] -
appsec 21.505 s [21.505 s, 21.505 s] 935.0 ms (4.5%)
iast 24.218 s [24.218 s, 24.218 s] 3.648 s (17.7%)
iast_GLOBAL 24.916 s [24.916 s, 24.916 s] 4.346 s (21.1%)
profiling 20.529 s [20.529 s, 20.529 s] -41.0 ms (-0.2%)
tracing 20.54 s [20.54 s, 20.54 s] -30.0 ms (-0.1%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~50953dfd49, baseline=1.36.0-SNAPSHOT~57d6042c7f
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.544 ms) : 1531, 1556
.   : milestone, 1544,
appsec (2.693 ms) : 2633, 2753
.   : milestone, 2693,
iast (2.357 ms) : 2286, 2428
.   : milestone, 2357,
iast_GLOBAL (2.397 ms) : 2326, 2467
.   : milestone, 2397,
profiling (2.211 ms) : 2149, 2273
.   : milestone, 2211,
tracing (2.16 ms) : 2103, 2218
.   : milestone, 2160,
section candidate
no_agent (1.537 ms) : 1524, 1549
.   : milestone, 1537,
appsec (2.68 ms) : 2620, 2740
.   : milestone, 2680,
iast (2.362 ms) : 2291, 2434
.   : milestone, 2362,
iast_GLOBAL (2.397 ms) : 2325, 2469
.   : milestone, 2397,
profiling (2.215 ms) : 2154, 2276
.   : milestone, 2215,
tracing (2.17 ms) : 2112, 2228
.   : milestone, 2170,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.544 ms [1.531 ms, 1.556 ms] -
appsec 2.693 ms [2.633 ms, 2.753 ms] 1.149 ms (74.4%)
iast 2.357 ms [2.286 ms, 2.428 ms] 813.346 µs (52.7%)
iast_GLOBAL 2.397 ms [2.326 ms, 2.467 ms] 852.976 µs (55.3%)
profiling 2.211 ms [2.149 ms, 2.273 ms] 667.312 µs (43.2%)
tracing 2.16 ms [2.103 ms, 2.218 ms] 616.359 µs (39.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.537 ms [1.524 ms, 1.549 ms] -
appsec 2.68 ms [2.62 ms, 2.74 ms] 1.143 ms (74.4%)
iast 2.362 ms [2.291 ms, 2.434 ms] 825.381 µs (53.7%)
iast_GLOBAL 2.397 ms [2.325 ms, 2.469 ms] 859.927 µs (56.0%)
profiling 2.215 ms [2.154 ms, 2.276 ms] 678.092 µs (44.1%)
tracing 2.17 ms [2.112 ms, 2.228 ms] 633.149 µs (41.2%)

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.

Sounds good! Just a minor question to make sure I get everything right 🙏

@SuppressWarnings({"unchecked", "rawtypes"})
public Iterable<Reference> buildReferences(TypePool ignored) {
if (null == muzzleReferences) {
Map<String, ClassRef> muzzleMap = getMuzzleReferences();
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling getMuzzleReferences() will call some OTel instrumentation code to build references that is remapped the DD OtelMuzzleRefBuilder which builds our own tooling ClassRef.
As getMuzzleReferences() returns a Map and there is type erasure, JVM don't complain at runtime we are now returning a Map with DD ClassRef instances as values, rather than the original OTel ClassRef, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We map all references to the original OTel ClassRef in OtelInstrumentationMapper to our replacement ClassRef. This replacement is binary compatible with the original, but it lets us adapt the data being built up using these ClassRefs to our expected Reference type. So from the JVM's perspective it's still dealing with a map of ClassRefs, just one that we control.

Note the getMuzzleReferences() method generated by OTel uses a builder called ClassRefBuilder, which is bootstrapped from ClassRef.builder(className) - so the process is as follows:

  • we find a potential type match involving the drop-in instrumentation
  • we want to check muzzle is ok, so we call MuzzleCheck
  • this calls loadStaticMuzzleReferences to load the static class (empty for OTel extensions)
  • and then applies the runtime reference provider
  • this calls our buildReferences method, which calls the generated OTel getMuzzleReferences method
  • getMuzzleReferences creates a ClassRefBuilder (which is binary compatible with the original OTel one) and feeds it reference data
  • we use that data to populate our ClassRefs - which are just a thin layer around Reference
  • we collect the underlying References and return them to MuzzleCheck

@mcculls mcculls force-pushed the mcculls/map-otel-virtual-fields branch from 04fa9c6 to f613d36 Compare June 10, 2024 10:34
Base automatically changed from mcculls/map-otel-virtual-fields to master June 10, 2024 11:26
@mcculls mcculls force-pushed the mcculls/map-otel-muzzle-refs branch from a8d49dd to 50953df Compare June 10, 2024 11:28
@mcculls mcculls merged commit b7b9e69 into master Jun 10, 2024
@mcculls mcculls deleted the mcculls/map-otel-muzzle-refs branch June 10, 2024 12:28
@github-actions github-actions bot added this to the 1.36.0 milestone Jun 10, 2024
mcculls added a commit that referenced this pull request Jun 12, 2024
* Use extended class-loader to lookup static Muzzle classes
* Generate empty static Muzzle classes for OpenTelemetry extensions
  (they will contribute Muzzle references via the dynamic provider)
* Retain original getMuzzleReferences method
* Map unshaded ASM package to the shaded copy in byte-buddy
* Provide Datadog equivalent of OpenTelemetry ClassRefBuilder
* Map OpenTelemetry ClassRefBuilder to OtelMuzzleRefBuilder and related types
* Lazily build OpenTelemetry muzzle references
* Remove injected helper classes from OpenTelemetry's generated muzzle map
amarziali pushed a commit that referenced this pull request Jun 12, 2024
* Use extended class-loader to lookup static Muzzle classes
* Generate empty static Muzzle classes for OpenTelemetry extensions
  (they will contribute Muzzle references via the dynamic provider)
* Retain original getMuzzleReferences method
* Map unshaded ASM package to the shaded copy in byte-buddy
* Provide Datadog equivalent of OpenTelemetry ClassRefBuilder
* Map OpenTelemetry ClassRefBuilder to OtelMuzzleRefBuilder and related types
* Lazily build OpenTelemetry muzzle references
* Remove injected helper classes from OpenTelemetry's generated muzzle map
mcculls added a commit that referenced this pull request Jun 12, 2024
* Use extended class-loader to lookup static Muzzle classes
* Generate empty static Muzzle classes for OpenTelemetry extensions
  (they will contribute Muzzle references via the dynamic provider)
* Retain original getMuzzleReferences method
* Map unshaded ASM package to the shaded copy in byte-buddy
* Provide Datadog equivalent of OpenTelemetry ClassRefBuilder
* Map OpenTelemetry ClassRefBuilder to OtelMuzzleRefBuilder and related types
* Lazily build OpenTelemetry muzzle references
* Remove injected helper classes from OpenTelemetry's generated muzzle map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: opentelemetry OpenTelemetry instrumentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants