-
Notifications
You must be signed in to change notification settings - Fork 323
Add an instrumentation naming checker plugin #10224
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 57 metrics, 8 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.57.0-SNAPSHOT~680fc577f9, baseline=1.57.0-SNAPSHOT~f5c3f20115
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.083 s) : 0, 1083444
Total [baseline] (8.768 s) : 0, 8767589
Agent [candidate] (1.087 s) : 0, 1086544
Total [candidate] (8.729 s) : 0, 8728947
section iast
Agent [baseline] (1.221 s) : 0, 1220822
Total [baseline] (9.353 s) : 0, 9352700
Agent [candidate] (1.244 s) : 0, 1243600
Total [candidate] (9.47 s) : 0, 9469971
gantt
title insecure-bank - break down per module: candidate=1.57.0-SNAPSHOT~680fc577f9, baseline=1.57.0-SNAPSHOT~f5c3f20115
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.201 ms) : 0, 1201
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (650.397 ms) : 0, 650397
BytebuddyAgent [candidate] (653.793 ms) : 0, 653793
GlobalTracer [baseline] (283.065 ms) : 0, 283065
GlobalTracer [candidate] (283.2 ms) : 0, 283200
AppSec [baseline] (32.331 ms) : 0, 32331
AppSec [candidate] (32.258 ms) : 0, 32258
Debugger [baseline] (67.473 ms) : 0, 67473
Debugger [candidate] (67.116 ms) : 0, 67116
Remote Config [baseline] (617.727 µs) : 0, 618
Remote Config [candidate] (600.718 µs) : 0, 601
Telemetry [baseline] (9.041 ms) : 0, 9041
Telemetry [candidate] (9.154 ms) : 0, 9154
Flare Poller [baseline] (3.771 ms) : 0, 3771
Flare Poller [candidate] (3.728 ms) : 0, 3728
section iast
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.235 ms) : 0, 1235
BytebuddyAgent [baseline] (789.469 ms) : 0, 789469
BytebuddyAgent [candidate] (807.512 ms) : 0, 807512
GlobalTracer [baseline] (255.579 ms) : 0, 255579
GlobalTracer [candidate] (260.058 ms) : 0, 260058
IAST [baseline] (26.925 ms) : 0, 26925
IAST [candidate] (27.468 ms) : 0, 27468
AppSec [baseline] (34.653 ms) : 0, 34653
AppSec [candidate] (33.503 ms) : 0, 33503
Debugger [baseline] (65.074 ms) : 0, 65074
Debugger [candidate] (65.6 ms) : 0, 65600
Remote Config [baseline] (584.59 µs) : 0, 585
Remote Config [candidate] (600.796 µs) : 0, 601
Telemetry [baseline] (8.443 ms) : 0, 8443
Telemetry [candidate] (8.4 ms) : 0, 8400
Flare Poller [baseline] (3.581 ms) : 0, 3581
Flare Poller [candidate] (3.493 ms) : 0, 3493
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.57.0-SNAPSHOT~680fc577f9, baseline=1.57.0-SNAPSHOT~f5c3f20115
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.082 s) : 0, 1082009
Total [baseline] (10.845 s) : 0, 10845356
Agent [candidate] (1.083 s) : 0, 1083351
Total [candidate] (10.908 s) : 0, 10907923
section appsec
Agent [baseline] (1.266 s) : 0, 1265931
Total [baseline] (10.972 s) : 0, 10972244
Agent [candidate] (1.263 s) : 0, 1263457
Total [candidate] (10.996 s) : 0, 10996458
section iast
Agent [baseline] (1.23 s) : 0, 1230339
Total [baseline] (11.222 s) : 0, 11221849
Agent [candidate] (1.224 s) : 0, 1224309
Total [candidate] (11.257 s) : 0, 11256523
section profiling
Agent [baseline] (1.206 s) : 0, 1206157
Total [baseline] (10.884 s) : 0, 10884015
Agent [candidate] (1.209 s) : 0, 1209251
Total [candidate] (10.973 s) : 0, 10973198
gantt
title petclinic - break down per module: candidate=1.57.0-SNAPSHOT~680fc577f9, baseline=1.57.0-SNAPSHOT~f5c3f20115
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.205 ms) : 0, 1205
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (649.012 ms) : 0, 649012
BytebuddyAgent [candidate] (649.499 ms) : 0, 649499
GlobalTracer [baseline] (282.724 ms) : 0, 282724
GlobalTracer [candidate] (283.542 ms) : 0, 283542
AppSec [baseline] (32.151 ms) : 0, 32151
AppSec [candidate] (32.344 ms) : 0, 32344
Debugger [baseline] (68.273 ms) : 0, 68273
Debugger [candidate] (67.181 ms) : 0, 67181
Remote Config [baseline] (597.947 µs) : 0, 598
Remote Config [candidate] (618.396 µs) : 0, 618
Telemetry [baseline] (8.947 ms) : 0, 8947
Telemetry [candidate] (9.128 ms) : 0, 9128
Flare Poller [baseline] (3.674 ms) : 0, 3674
Flare Poller [candidate] (4.514 ms) : 0, 4514
section appsec
crashtracking [baseline] (1.181 ms) : 0, 1181
crashtracking [candidate] (1.172 ms) : 0, 1172
BytebuddyAgent [baseline] (690.719 ms) : 0, 690719
BytebuddyAgent [candidate] (688.994 ms) : 0, 688994
GlobalTracer [baseline] (259.29 ms) : 0, 259290
GlobalTracer [candidate] (259.259 ms) : 0, 259259
IAST [baseline] (24.678 ms) : 0, 24678
IAST [candidate] (24.547 ms) : 0, 24547
AppSec [baseline] (174.528 ms) : 0, 174528
AppSec [candidate] (174.075 ms) : 0, 174075
Debugger [baseline] (66.588 ms) : 0, 66588
Debugger [candidate] (66.578 ms) : 0, 66578
Remote Config [baseline] (711.677 µs) : 0, 712
Remote Config [candidate] (715.657 µs) : 0, 716
Telemetry [baseline] (8.946 ms) : 0, 8946
Telemetry [candidate] (8.813 ms) : 0, 8813
Flare Poller [baseline] (3.747 ms) : 0, 3747
Flare Poller [candidate] (3.838 ms) : 0, 3838
section iast
crashtracking [baseline] (1.19 ms) : 0, 1190
crashtracking [candidate] (1.178 ms) : 0, 1178
BytebuddyAgent [baseline] (795.957 ms) : 0, 795957
BytebuddyAgent [candidate] (791.955 ms) : 0, 791955
GlobalTracer [baseline] (257.717 ms) : 0, 257717
GlobalTracer [candidate] (256.15 ms) : 0, 256150
IAST [baseline] (27.069 ms) : 0, 27069
IAST [candidate] (27.134 ms) : 0, 27134
AppSec [baseline] (33.701 ms) : 0, 33701
AppSec [candidate] (33.456 ms) : 0, 33456
Debugger [baseline] (66.755 ms) : 0, 66755
Debugger [candidate] (66.62 ms) : 0, 66620
Remote Config [baseline] (612.393 µs) : 0, 612
Remote Config [candidate] (613.459 µs) : 0, 613
Telemetry [baseline] (8.415 ms) : 0, 8415
Telemetry [candidate] (8.454 ms) : 0, 8454
Flare Poller [baseline] (3.502 ms) : 0, 3502
Flare Poller [candidate] (3.485 ms) : 0, 3485
section profiling
crashtracking [baseline] (1.22 ms) : 0, 1220
crashtracking [candidate] (1.23 ms) : 0, 1230
BytebuddyAgent [baseline] (703.12 ms) : 0, 703120
BytebuddyAgent [candidate] (705.625 ms) : 0, 705625
GlobalTracer [baseline] (220.702 ms) : 0, 220702
GlobalTracer [candidate] (221.721 ms) : 0, 221721
AppSec [baseline] (32.127 ms) : 0, 32127
AppSec [candidate] (32.391 ms) : 0, 32391
Debugger [baseline] (68.636 ms) : 0, 68636
Debugger [candidate] (67.998 ms) : 0, 67998
Remote Config [baseline] (637.481 µs) : 0, 637
Remote Config [candidate] (614.894 µs) : 0, 615
Telemetry [baseline] (8.867 ms) : 0, 8867
Telemetry [candidate] (8.904 ms) : 0, 8904
Flare Poller [baseline] (3.794 ms) : 0, 3794
Flare Poller [candidate] (3.77 ms) : 0, 3770
ProfilingAgent [baseline] (97.275 ms) : 0, 97275
ProfilingAgent [candidate] (97.071 ms) : 0, 97071
Profiling [baseline] (97.866 ms) : 0, 97866
Profiling [candidate] (97.651 ms) : 0, 97651
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 1 performance regressions! Performance is the same for 19 metrics, 15 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~680fc577f9, baseline=1.57.0-SNAPSHOT~f5c3f20115
dateFormat X
axisFormat %s
section baseline
no_agent (18.174 ms) : 17990, 18357
. : milestone, 18174,
appsec (18.765 ms) : 18577, 18953
. : milestone, 18765,
code_origins (17.65 ms) : 17476, 17823
. : milestone, 17650,
iast (17.747 ms) : 17570, 17924
. : milestone, 17747,
profiling (18.73 ms) : 18542, 18918
. : milestone, 18730,
tracing (17.748 ms) : 17573, 17923
. : milestone, 17748,
section candidate
no_agent (18.209 ms) : 18025, 18393
. : milestone, 18209,
appsec (18.877 ms) : 18688, 19066
. : milestone, 18877,
code_origins (17.62 ms) : 17445, 17794
. : milestone, 17620,
iast (17.64 ms) : 17465, 17815
. : milestone, 17640,
profiling (18.699 ms) : 18511, 18888
. : milestone, 18699,
tracing (17.926 ms) : 17748, 18103
. : milestone, 17926,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~680fc577f9, baseline=1.57.0-SNAPSHOT~f5c3f20115
dateFormat X
axisFormat %s
section baseline
no_agent (1.212 ms) : 1200, 1225
. : milestone, 1212,
iast (3.117 ms) : 3078, 3156
. : milestone, 3117,
iast_FULL (5.803 ms) : 5744, 5861
. : milestone, 5803,
iast_GLOBAL (3.551 ms) : 3500, 3602
. : milestone, 3551,
profiling (1.885 ms) : 1869, 1901
. : milestone, 1885,
tracing (1.789 ms) : 1775, 1804
. : milestone, 1789,
section candidate
no_agent (1.187 ms) : 1176, 1199
. : milestone, 1187,
iast (3.194 ms) : 3154, 3235
. : milestone, 3194,
iast_FULL (5.467 ms) : 5414, 5521
. : milestone, 5467,
iast_GLOBAL (3.648 ms) : 3593, 3703
. : milestone, 3648,
profiling (1.984 ms) : 1967, 2002
. : milestone, 1984,
tracing (1.763 ms) : 1748, 1778
. : milestone, 1763,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~680fc577f9, baseline=1.57.0-SNAPSHOT~f5c3f20115
dateFormat X
axisFormat %s
section baseline
no_agent (15.022 s) : 15022000, 15022000
. : milestone, 15022000,
appsec (14.873 s) : 14873000, 14873000
. : milestone, 14873000,
iast (17.923 s) : 17923000, 17923000
. : milestone, 17923000,
iast_GLOBAL (17.905 s) : 17905000, 17905000
. : milestone, 17905000,
profiling (14.705 s) : 14705000, 14705000
. : milestone, 14705000,
tracing (14.808 s) : 14808000, 14808000
. : milestone, 14808000,
section candidate
no_agent (15.537 s) : 15537000, 15537000
. : milestone, 15537000,
appsec (14.466 s) : 14466000, 14466000
. : milestone, 14466000,
iast (18.306 s) : 18306000, 18306000
. : milestone, 18306000,
iast_GLOBAL (18.137 s) : 18137000, 18137000
. : milestone, 18137000,
profiling (14.966 s) : 14966000, 14966000
. : milestone, 14966000,
tracing (14.493 s) : 14493000, 14493000
. : milestone, 14493000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~680fc577f9, baseline=1.57.0-SNAPSHOT~f5c3f20115
dateFormat X
axisFormat %s
section baseline
no_agent (1.471 ms) : 1459, 1482
. : milestone, 1471,
appsec (3.649 ms) : 3435, 3863
. : milestone, 3649,
iast (2.207 ms) : 2143, 2272
. : milestone, 2207,
iast_GLOBAL (2.248 ms) : 2183, 2313
. : milestone, 2248,
profiling (2.062 ms) : 2009, 2115
. : milestone, 2062,
tracing (2.05 ms) : 1998, 2101
. : milestone, 2050,
section candidate
no_agent (1.469 ms) : 1458, 1481
. : milestone, 1469,
appsec (3.708 ms) : 3490, 3926
. : milestone, 3708,
iast (2.209 ms) : 2144, 2274
. : milestone, 2209,
iast_GLOBAL (2.254 ms) : 2189, 2319
. : milestone, 2254,
profiling (2.057 ms) : 2004, 2110
. : milestone, 2057,
tracing (2.04 ms) : 1989, 2091
. : milestone, 2040,
|
|
@codex review Let's try it on generated code then 😅 |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
4da3b6e to
d183263
Compare
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingExtension.kt
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingExtension.kt
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Show resolved
Hide resolved
bric3
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.
I think it does the job, there' no real wrong code about gradle here, but the Kotlin code might need some cleanup.
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingExtension.kt
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingExtension.kt
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingExtension.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
| fun hasBuildFile(dir: File): Boolean = dir.listFiles()?.any { | ||
| it.name == "build.gradle" || it.name == "build.gradle.kts" | ||
| } ?: false |
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.
nitpick: Declared here this becomes like a lambda, this can be a method by moving it one level.
Same for traverseModules.
| it.name == "build.gradle" || it.name == "build.gradle.kts" | ||
| } ?: false | ||
|
|
||
| fun traverseModules(currentDir: File, parentName: String?) { |
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.
note: Actually I don't see the need for traverseModules function, this can be the body of validateInstrumentations, and just add a comment this this traverses the modules.
…ntationNamingPlugin.kt Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
…ntationNamingPlugin.kt Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
…ntationNamingPlugin.kt Co-authored-by: Alexey Kuznetsov <alexey.kuznetsov@datadoghq.com>
…ntationNamingPlugin.kt Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
9f1ce77 to
9976152
Compare
|
@bric3, @AlexeyKuznetsov-DD - I applied few suggestions and solved the first round of comments. I think that the plugin is good to go. It does the job for what has been meant to |
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.
Few nitpicks remain, but I believe this is OK regardless
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt
Outdated
Show resolved
Hide resolved
buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/README.md
Outdated
Show resolved
Hide resolved
…ntationNamingPlugin.kt Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
* Create a gradle plugin to check instrumenation names * Factorise the regexp * make suffixes configurable * Fix module recursion * Ensure instrumentation naming validation recurses into nested modules * Update buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com> * Update buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com> * Update buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt Co-authored-by: Alexey Kuznetsov <alexey.kuznetsov@datadoghq.com> * Update buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com> * Fix build after suggestions * use raw strings * convert suffixes and exclusions to SetProperty * Update buildSrc/src/main/kotlin/datadog/gradle/plugin/naming/InstrumentationNamingPlugin.kt Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com> * fix the typo + remove the readme --------- Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com> Co-authored-by: Alexey Kuznetsov <alexey.kuznetsov@datadoghq.com>
What Does This Do
Introduces a gradle plugin that checks that the instrumentation module names are well formed. It checks gradle modules - not filesystem directories.
The two basic rules I put :
-stubsor-common)If none matches, the module is considered as invalid. Is also possible to exclude modules from checking if some exclusions needs to be set
A sample output:
Right now it's not linked to the
checktask. It will be when all the modules will be ported.Note: Thanks to claude that wrote almost everything
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]