-
Notifications
You must be signed in to change notification settings - Fork 317
Map OpenTelemetry muzzle references to Datadog equivalent #7142
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
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 15 unstable metrics. Startup time reports for insecure-bankgantt
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
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
Startup time reports for petclinicgantt
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
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
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for petclinicgantt
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,
Request duration reports for insecure-bankgantt
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,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
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,
Execution time for tomcatgantt
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,
|
PerfectSlayer
left a comment
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
loadStaticMuzzleReferencesto load the static class (empty for OTel extensions) - and then applies the runtime reference provider
- this calls our
buildReferencesmethod, which calls the generated OTelgetMuzzleReferencesmethod getMuzzleReferencescreates aClassRefBuilder(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 aroundReference - we collect the underlying
References and return them toMuzzleCheck
04fa9c6 to
f613d36
Compare
(they will contribute Muzzle references via the dynamic provider)
a8d49dd to
50953df
Compare
* 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
* 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
* 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
This PR generates a
Muzzleclass for each OpenTelemetry instrumentation. This class creates an emptyReferenceMatcherwhich is then populated by muzzle references translated from the OpenTelemetry API viaruntimeMuzzleReferences.Jira ticket: APMAPI-6