-
Notifications
You must be signed in to change notification settings - Fork 277
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
Fix CI Visibility Gradle plugin to be compatible with Gradle build scans #6913
Fix CI Visibility Gradle plugin to be compatible with Gradle build scans #6913
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 15 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.33.0-SNAPSHOT~c007c15acc, baseline=1.34.0-SNAPSHOT~5c8d55ca87
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.084 s) : 0, 1083770
Total [baseline] (10.475 s) : 0, 10475255
Agent [candidate] (1.083 s) : 0, 1082945
Total [candidate] (10.372 s) : 0, 10372118
section appsec
Agent [baseline] (1.209 s) : 0, 1209067
Total [baseline] (10.524 s) : 0, 10523880
Agent [candidate] (1.201 s) : 0, 1201129
Total [candidate] (10.524 s) : 0, 10524361
section iast
Agent [baseline] (1.208 s) : 0, 1208376
Total [baseline] (10.757 s) : 0, 10757002
Agent [candidate] (1.202 s) : 0, 1202054
Total [candidate] (10.79 s) : 0, 10790069
section profiling
Agent [baseline] (1.293 s) : 0, 1292803
Total [baseline] (10.694 s) : 0, 10694136
Agent [candidate] (1.273 s) : 0, 1273064
Total [candidate] (10.64 s) : 0, 10639863
gantt
title petclinic - break down per module: candidate=1.33.0-SNAPSHOT~c007c15acc, baseline=1.34.0-SNAPSHOT~5c8d55ca87
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (679.893 ms) : 0, 679893
BytebuddyAgent [candidate] (678.064 ms) : 0, 678064
GlobalTracer [baseline] (311.533 ms) : 0, 311533
GlobalTracer [candidate] (312.209 ms) : 0, 312209
AppSec [baseline] (49.437 ms) : 0, 49437
AppSec [candidate] (49.737 ms) : 0, 49737
Remote Config [baseline] (661.63 µs) : 0, 662
Remote Config [candidate] (664.596 µs) : 0, 665
Telemetry [baseline] (7.599 ms) : 0, 7599
Telemetry [candidate] (7.618 ms) : 0, 7618
section appsec
BytebuddyAgent [baseline] (700.455 ms) : 0, 700455
BytebuddyAgent [candidate] (697.502 ms) : 0, 697502
GlobalTracer [baseline] (293.58 ms) : 0, 293580
GlobalTracer [candidate] (292.897 ms) : 0, 292897
AppSec [baseline] (149.858 ms) : 0, 149858
AppSec [candidate] (149.939 ms) : 0, 149939
IAST [baseline] (19.41 ms) : 0, 19410
IAST [candidate] (18.935 ms) : 0, 18935
Remote Config [baseline] (612.009 µs) : 0, 612
Remote Config [candidate] (608.424 µs) : 0, 608
Telemetry [baseline] (10.599 ms) : 0, 10599
Telemetry [candidate] (6.832 ms) : 0, 6832
section iast
BytebuddyAgent [baseline] (801.573 ms) : 0, 801573
BytebuddyAgent [candidate] (795.815 ms) : 0, 795815
GlobalTracer [baseline] (290.06 ms) : 0, 290060
GlobalTracer [candidate] (289.533 ms) : 0, 289533
AppSec [baseline] (50.973 ms) : 0, 50973
AppSec [candidate] (48.355 ms) : 0, 48355
IAST [baseline] (23.356 ms) : 0, 23356
IAST [candidate] (24.528 ms) : 0, 24528
Remote Config [baseline] (569.05 µs) : 0, 569
Remote Config [candidate] (572.266 µs) : 0, 572
Telemetry [baseline] (7.397 ms) : 0, 7397
Telemetry [candidate] (8.916 ms) : 0, 8916
section profiling
BytebuddyAgent [baseline] (690.205 ms) : 0, 690205
BytebuddyAgent [candidate] (679.814 ms) : 0, 679814
GlobalTracer [baseline] (387.823 ms) : 0, 387823
GlobalTracer [candidate] (382.775 ms) : 0, 382775
AppSec [baseline] (51.249 ms) : 0, 51249
AppSec [candidate] (50.291 ms) : 0, 50291
Remote Config [baseline] (728.708 µs) : 0, 729
Remote Config [candidate] (704.335 µs) : 0, 704
Telemetry [baseline] (7.68 ms) : 0, 7680
Telemetry [candidate] (7.473 ms) : 0, 7473
ProfilingAgent [baseline] (97.767 ms) : 0, 97767
ProfilingAgent [candidate] (95.651 ms) : 0, 95651
Profiling [baseline] (97.791 ms) : 0, 97791
Profiling [candidate] (95.675 ms) : 0, 95675
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.33.0-SNAPSHOT~c007c15acc, baseline=1.34.0-SNAPSHOT~5c8d55ca87
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.077 s) : 0, 1076769
Total [baseline] (8.541 s) : 0, 8541307
Agent [candidate] (1.089 s) : 0, 1088590
Total [candidate] (8.608 s) : 0, 8607651
section iast
Agent [baseline] (1.21 s) : 0, 1209926
Total [baseline] (9.032 s) : 0, 9032061
Agent [candidate] (1.208 s) : 0, 1208105
Total [candidate] (9.027 s) : 0, 9026507
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.204 s) : 0, 1203711
Total [baseline] (8.988 s) : 0, 8988313
Agent [candidate] (1.199 s) : 0, 1199245
Total [candidate] (8.999 s) : 0, 8998931
section iast_TELEMETRY_OFF
Agent [baseline] (1.213 s) : 0, 1213488
Total [baseline] (9.017 s) : 0, 9017362
Agent [candidate] (1.205 s) : 0, 1204857
Total [candidate] (9.014 s) : 0, 9014467
gantt
title insecure-bank - break down per module: candidate=1.33.0-SNAPSHOT~c007c15acc, baseline=1.34.0-SNAPSHOT~5c8d55ca87
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (674.617 ms) : 0, 674617
BytebuddyAgent [candidate] (681.824 ms) : 0, 681824
GlobalTracer [baseline] (310.22 ms) : 0, 310220
GlobalTracer [candidate] (313.627 ms) : 0, 313627
AppSec [baseline] (49.372 ms) : 0, 49372
AppSec [candidate] (50.186 ms) : 0, 50186
Remote Config [baseline] (654.336 µs) : 0, 654
Remote Config [candidate] (678.966 µs) : 0, 679
Telemetry [baseline] (7.497 ms) : 0, 7497
Telemetry [candidate] (7.652 ms) : 0, 7652
section iast
BytebuddyAgent [baseline] (801.67 ms) : 0, 801670
BytebuddyAgent [candidate] (800.246 ms) : 0, 800246
GlobalTracer [baseline] (290.591 ms) : 0, 290591
GlobalTracer [candidate] (290.667 ms) : 0, 290667
AppSec [baseline] (50.444 ms) : 0, 50444
AppSec [candidate] (50.108 ms) : 0, 50108
IAST [baseline] (25.206 ms) : 0, 25206
IAST [candidate] (24.506 ms) : 0, 24506
Remote Config [baseline] (638.905 µs) : 0, 639
Remote Config [candidate] (580.489 µs) : 0, 580
Telemetry [baseline] (6.701 ms) : 0, 6701
Telemetry [candidate] (7.384 ms) : 0, 7384
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (798.093 ms) : 0, 798093
BytebuddyAgent [candidate] (794.344 ms) : 0, 794344
GlobalTracer [baseline] (288.348 ms) : 0, 288348
GlobalTracer [candidate] (288.808 ms) : 0, 288808
AppSec [baseline] (52.28 ms) : 0, 52280
AppSec [candidate] (50.155 ms) : 0, 50155
IAST [baseline] (22.519 ms) : 0, 22519
IAST [candidate] (23.611 ms) : 0, 23611
Remote Config [baseline] (1.32 ms) : 0, 1320
Remote Config [candidate] (577.004 µs) : 0, 577
Telemetry [baseline] (6.645 ms) : 0, 6645
Telemetry [candidate] (7.361 ms) : 0, 7361
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (804.382 ms) : 0, 804382
BytebuddyAgent [candidate] (798.455 ms) : 0, 798455
GlobalTracer [baseline] (292.06 ms) : 0, 292060
GlobalTracer [candidate] (290.551 ms) : 0, 290551
AppSec [baseline] (50.249 ms) : 0, 50249
AppSec [candidate] (51.151 ms) : 0, 51151
IAST [baseline] (23.379 ms) : 0, 23379
IAST [candidate] (22.974 ms) : 0, 22974
Remote Config [baseline] (585.154 µs) : 0, 585
Remote Config [candidate] (571.827 µs) : 0, 572
Telemetry [baseline] (8.054 ms) : 0, 8054
Telemetry [candidate] (6.554 ms) : 0, 6554
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 13 metrics, 15 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.33.0-SNAPSHOT~c007c15acc, baseline=1.34.0-SNAPSHOT~5c8d55ca87
dateFormat X
axisFormat %s
section baseline
no_agent (1.347 ms) : 1327, 1368
. : milestone, 1347,
appsec (1.731 ms) : 1707, 1756
. : milestone, 1731,
appsec_no_iast (1.749 ms) : 1725, 1773
. : milestone, 1749,
iast (1.499 ms) : 1477, 1521
. : milestone, 1499,
profiling (1.517 ms) : 1492, 1542
. : milestone, 1517,
tracing (1.476 ms) : 1451, 1500
. : milestone, 1476,
section candidate
no_agent (1.367 ms) : 1347, 1386
. : milestone, 1367,
appsec (1.712 ms) : 1687, 1737
. : milestone, 1712,
appsec_no_iast (1.724 ms) : 1699, 1748
. : milestone, 1724,
iast (1.495 ms) : 1472, 1519
. : milestone, 1495,
profiling (1.487 ms) : 1462, 1512
. : milestone, 1487,
tracing (1.493 ms) : 1469, 1517
. : milestone, 1493,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.33.0-SNAPSHOT~c007c15acc, baseline=1.34.0-SNAPSHOT~5c8d55ca87
dateFormat X
axisFormat %s
section baseline
no_agent (377.255 µs) : 357, 397
. : milestone, 377,
iast (479.736 µs) : 458, 502
. : milestone, 480,
iast_FULL (541.793 µs) : 520, 563
. : milestone, 542,
iast_GLOBAL (501.026 µs) : 480, 522
. : milestone, 501,
iast_HARDCODED_SECRET_DISABLED (481.131 µs) : 460, 502
. : milestone, 481,
iast_INACTIVE (450.298 µs) : 429, 471
. : milestone, 450,
iast_TELEMETRY_OFF (466.572 µs) : 446, 487
. : milestone, 467,
tracing (446.112 µs) : 425, 467
. : milestone, 446,
section candidate
no_agent (366.041 µs) : 346, 386
. : milestone, 366,
iast (478.398 µs) : 457, 500
. : milestone, 478,
iast_FULL (546.341 µs) : 525, 567
. : milestone, 546,
iast_GLOBAL (508.47 µs) : 486, 531
. : milestone, 508,
iast_HARDCODED_SECRET_DISABLED (479.701 µs) : 459, 501
. : milestone, 480,
iast_INACTIVE (444.604 µs) : 424, 465
. : milestone, 445,
iast_TELEMETRY_OFF (471.998 µs) : 452, 492
. : milestone, 472,
tracing (443.563 µs) : 423, 464
. : milestone, 444,
Dacapo |
I would like a review from @mcculls for this PR. |
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.
Have we submitted a report upstream to fix build scan? It looks like a bug in build scan to assume locationUrl
is non-null
In terms of this PR I think we can simplify it a lot, we don't need the feature to supply arbitrary code-sources - we just need a flag to tell it to use the agent's code-source.
So I'd suggest removing the factory and have HelperInjector
pick the domain based on the instrumentation's value of that flag.
d91d840
to
a9aaae3
Compare
Issue submitted. |
...ent/agent-builder/src/main/java/datadog/trace/agent/tooling/CombiningTransformerBuilder.java
Outdated
Show resolved
Hide resolved
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/HelperInjector.java
Outdated
Show resolved
Hide resolved
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.
+1, thanks
just some minor suggestions
What Does This Do
Fixes the Gradle plugin injected by CI Visibility so that it does not cause Gradle build scans to fail.
Additional Notes
Attaching tracer with CI Visibility to a Gradle build that has scanning enabled causes the following error (the code is obfuscated since build scans are part of Gradle Enterprise):
The reason the error occurs is that Gradle build scan tries to determine the location of all the plugins that the build uses, including the plugin injected by CI Visibility.
The code is roughly:
The CI Visibility Gradle plugin is injected by the tracer as a helper class.
Currently all the helper classes are injected with no protection domain specified.
As the result, they get assigned
java.lang.ClassLoader#defaultDomain
-new ProtectionDomain(new CodeSource(null, (Certificate[]) null), null, this, null)
: the default domain has a code source that returnsnull
as its location, which causes the NPE above.The proposed fix is to allow instrumentation modules to define the protection domain that will be assigned to the injected classes.
The protection domain for the Gradle plugin module has code source that points to the tracer JAR and class loader that is the CL where the plugin is injected.
Jira ticket: SCV-157