Commit Graph

62 Commits

Author SHA1 Message Date
Trask Stalnaker 429ecfc713
Update error prone (#6646)
(note that change from BDDMockito is due to
https://github.com/google/error-prone/issues/3396)
2022-09-23 11:24:40 -07:00
Trask Stalnaker e7dd21477d
Update bytebuddy core dependency, and make dependencies more dependabot friendly (#6704)
(probably need to revisit later what's a "core dependency" and what's
not, but doesn't seem to be any real difference other than organization)
2022-09-22 09:53:53 -07:00
Mateusz Rzeszutek 8b2b3281fe
Encapsulate logging (#6543)
* Encapsulate actual logging implementation better

* Apply suggestions from code review

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* code review comments

* revert to the old slf4j package name

* spotless

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-09-12 13:22:26 -07:00
Lauri Tulmin 60ec2bb9c8
Correct method name in comment (#6455) 2022-08-10 08:50:37 -07:00
Trask Stalnaker 68a9f20eb3
Enable PrivateConstructorForUtilityClass errorprone check (#6427)
* PrivateConstructorForUtilityClass

* Advice

* More advice

* More

* More advice

* More

* Spotless

* Fix

* Fix

* Fix

* A better solution

* Revert

* More

* Fix

* Spotless

* Fix
2022-08-10 11:30:22 +03:00
Mateusz Rzeszutek b917b3bf9c
Use ConfigProperties instead of Config in the agent code (#6322)
* Use ConfigProperties instead of Config in the agent code

* Fix merge conflict

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-07-18 19:04:48 -07:00
Trask Stalnaker 701ed54311
Use "class loader" instead of "classloader" consistently in docs and comments (#6236)
* Use "class loader" consistently instead of classloader

* Java comments too

* Fix bad merge
2022-06-30 14:57:07 -07:00
Trask Stalnaker 8fac01e736
Enable error prone's UnusedVariable check (#6217)
* Enable error prone's UnusedVariable check

* Spotless
2022-06-27 10:55:27 +02:00
Trask Stalnaker d3be07eb1a
Better muzzle instrumentation exclusion (#6044)
* Better muzzle instrumentation exclusion

* set
2022-05-18 11:15:57 -07:00
Mateusz Rzeszutek 6a0ca530b7
Instrumentation API changes: VirtualField (#6017)
* Instrumentation API changes: VirtualField

* change class name in string constant
2022-05-12 11:17:24 -07:00
Lauri Tulmin 8865ab6ae5
Avoid looking up annotation types during type matching (#5906) 2022-05-12 09:30:30 -07:00
Mateusz Rzeszutek d919f84cf8
Merge javaagent-instrumentation-api into javaagent-extension-api (#5936)
* Merge javaagent-instrumentation-api into javaagent-extension-api

* remove some leftover references to javaagent-instrumentation-api

* add missing instrumentation-api to distro example
2022-04-28 20:11:15 -07:00
Trask Stalnaker e3588ceee3
Fix some jul messages (#5930) 2022-04-27 10:33:12 -07:00
Anna Nosek c14fc5ec35
A hook in HelperInjector for static instrumentation (#5910)
* introduce hook

* spotless

* review

* rename to HelperInjectorListener

* rename setter
2022-04-26 08:43:04 -07:00
Anuraag Agrawal 980746ae44
Update errorprone (#5776)
* Update errorprone

* Fix errorprone on java 17

* Fix oshi test

* Spot

* Fix merge
2022-04-11 12:48:16 -07:00
Lauri Tulmin 3940529dd2
Agent tooling already has access to bootstrap proxy (#5802) 2022-04-11 12:41:30 -07:00
Trask Stalnaker fe84d24b74
Fix missing class errors (#5795)
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2022-04-11 15:27:38 +03:00
Lauri Tulmin 4ad44909ca
Faster type matching (#5724)
* Faster type matching

* make findLoadedClass accessible on java17

* enable jaxrs instrumentation for quarkus test

* fix websphere

* fix muzzle

* javadoc formating

* ignore classes that are know to fail to load for virtual field transforms

* add back jaxrs and jaxws annotation instrumentations

* Apply suggestions from code review

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* fix compile error

* comments

* replace deprecated method usage

* add comment

* add an spi to get access to bootstrap proxy from muzzle module

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-04-08 10:38:50 -07:00
Mateusz Rzeszutek 519024485c
Move Cache and related classes to internal package (#5759)
* Move Cache and related classes to internal package

* fix imports
2022-04-06 18:12:11 -07:00
Mateusz Rzeszutek 7bc748a2ff
Make it possible to register multiple helper resources under the same… (#5703)
* Make it possible to register multiple helper resources under the same name

* go back to using the old property in tests after all

* code review comments
2022-03-31 11:51:46 +02:00
Mateusz Rzeszutek b668e73e13
Convert all logging statements from slf4j to jul (#5674)
* Convert all logging statements from slf4j to jul

* code review comments

* fix tests

* Fix randomly failing test
2022-03-25 10:02:51 -07:00
Mateusz Rzeszutek f2587ba248
Apply micrometer instrumentation to spring-boot-actuator apps (#5666)
* Apply micrometer instrumentation to spring-boot-actuator apps

* fix a bug

* code review comments
2022-03-23 10:25:51 -07:00
Lauri Tulmin c461d22d83
Define helper classes in loadClass (#5528)
* Define helper classes in loadClass similarly to regular classes

* fix test

* spotless

* address review comments
2022-03-09 09:12:25 -08:00
Lauri Tulmin 84b46cbc48
Fix muzzle failure on calls to primitive array clone (#5405) 2022-02-22 19:10:47 +02:00
Lauri Tulmin fbf00761cc
Use VirtualField for associating netty listener with wrapper (#5282)
* Use VirtualField for associating netty listener with wrapper

* Move ignoring lambas for injected classes to LambdaTransformer
2022-01-31 14:45:12 -08:00
Trask Stalnaker 23b33adb0a
Auto-format groovy files in Intellij (#5260)
* Auto-format groovy files in Intellij

* A bit of clean up
2022-01-28 09:29:46 -08:00
Lauri Tulmin f2a2786759
Recover from duplicate class definition errors (#5185)
* Recover from duplicate class definition errors

* fix hotspot8

* Suppress dupicate class definiton errors only when helper classes were injected

* exit define class context when there is an exception, update pseudocode in comment
2022-01-25 09:37:37 -08:00
Anuraag Agrawal b7a95857c7
Fix some java lint warnings (#5120)
* Convert InstrumentationTestRunner from interface to abstract class

* Foo

* Commit

* Revert unintended
2022-01-17 10:26:03 -08:00
Anuraag Agrawal f6bcd76219
Update errorprone (#5016)
* Update errorprone

* gwt

* Remove unnecessary final

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-01-06 14:21:56 -08:00
Nikita Salnikov-Tarnovski 821a4b870b
Drop instrumentation-api-caching module and move weak cache implementation to instrumentation-api (#4667)
* Drop instrumentation-api-caching module and move weak cache implementation to instrumentation-api

* Some test fixes

* Some cleanup

* Temporary workaround for using weak values in FutureListenerWrappers

* Spotless

* Update ClassNames and SpanNames

* Compilation and comment

* Add bounded cache and clean interface

* Polish

* Add comment

* Vendor ConcurrentLinkedHashMap in

* Let errorprone ignore vendored CLHM for now

* Keep license in java files too

* Convert Netty wrapper cache to VirtualField

* Work around lambda instrumentation failure

Ideally we would ignore instrumenting helper classes...

* Revert "Work around lambda instrumentation failure"

This reverts commit 6d63815b44.

* Revert "Convert Netty wrapper cache to VirtualField"

This reverts commit dac1522a3f.

* Handle cleared weak values

* Fix comment

* Delete instrumentation-api-caching

* Copy in weak-lock-free

* Remove caffeine remnants

* Fix checkstyle

* Rename BoundedCache to MapBackedCached

* Remove duplicate LICENSE

* Remove outdated comment

* Sync with SDK copy of weaklockfree

* Enable checkstyle:off comment

* Re-generate license report

* Move NOTICE file to package-info.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-24 09:05:12 -08:00
Lauri Tulmin d53c276b96
Ensure that netty 4.0 instrumentation is not applied to 4.1 (#4626)
* Enusre that netty 4.0 instrumentation is not applied to 4.1

* formatting

* cross test netty instrumentation
2021-11-11 08:38:56 -08:00
Mateusz Rzeszutek 59c1ce11a7
Improve muzzle check for constructors (#4591) 2021-11-05 08:40:20 +01:00
Lauri Tulmin 6694f85532
Inject helper resources only once (#4573)
* Inject helper resouces only once

* use resources instread of resource
2021-11-03 09:30:22 -07:00
Lauri Tulmin 8dce10f8ae
Muzzle match only once in each class loader (#4543)
* Muzzle match only once in each class loader

* Move muzzle matcher caching from ReferenceMatcher to InstrumentationModuleInstaller

* Update comment as caching was moved to a different method

* Fix comment
2021-11-01 11:30:03 -07:00
Martin d314d76fce
rename `newBuilder()` to `builder()` (#4475)
* rename `newBuilder()` to `builder()`

* rename `newBuilder()` to `builder()`
2021-10-22 20:50:43 -07:00
Lauri Tulmin 9b8ab5eeec
Migrate to spock 2 (#4458)
* Migrate to spock 2

* Fix smoke test suites

* address review comments

* review comment

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-22 08:40:58 -07:00
Lauri Tulmin 17a85bbc22
Use byte-buddy-dep instead of byte-buddy (#4400)
* Use byte-buddy-dep instead of byte-buddy

* print stacktrace on examples failure

* try to fix gradle plugins

* try to fix extension build

* try to fix extension build

* try to fix extension build

* try to fix extension build

* try removing mavenLocal

* add mavenLocal plugin repository

* publish gradle-plugins to mavenLocal for examples ci build

* Fix bytebuddy exclusion
2021-10-19 13:46:48 -07:00
Martin 6d9e3618d3
rename `newBuilder()` to `builder()` (#4407)
* rename `newBuilder()` to `builder()`

* code format
2021-10-18 10:00:49 -07:00
Martin ac91dc090a
Type annotation placement (#4406)
* switch annotation `org.checkerframework.checker.nullness.qual.Nullable` to `javax.annotation.Nullable`

* code format
2021-10-17 17:38:43 -07:00
Mateusz Rzeszutek fb77651658
Restrict usage of arrays as VirtualField types and fix field naming (#4323)
* Restrict usage of arrays as VirtualField types and fix field naming

* disallow primitive type usage too

* A few more test cases and validations
2021-10-08 10:52:26 +02:00
Nikita Salnikov-Tarnovski 0683371110
Add supported way to add additional helper classes to instrumentation without interfering with muzzle (#4302)
* Add supported way to add additional helper classes to instrumentation without interfering with muzzle

* Better javadoc
2021-10-06 09:52:54 -07:00
Nikita Salnikov-Tarnovski 9bbd490288
Remove last muzzle generate method from InstrumentationModule (#4281)
* Remove last muzzle generate method from InstrumentationModule
2021-10-05 14:43:21 +03:00
Trask Stalnaker 2a76d41807
Small renames for clarification (#4294) 2021-10-05 10:37:02 +03:00
Mateusz Rzeszutek 9d6fb65b41
Remove ContextStore/InstrumentationContext mentions from internal age… (#4267)
* Remove ContextStore/InstrumentationContext mentions from internal agent classes

* Fix internal-reflection module
2021-10-04 09:24:25 -07:00
Mateusz Rzeszutek c11b96e4d0
Make it possible to use InstrumentationContext (now VirtualField) fro… (#4218)
* Make it possible to use InstrumentationContext (now VirtualField) from library instrumentation

* fix tests

* fix javadocs

* fix some more tests

* code review comments

* setIfNull, computeIfNull
2021-10-01 11:13:11 +02:00
Trask Stalnaker 43926071c3
Update error message based on new findings (#4228) 2021-09-29 10:01:06 -07:00
Nikita Salnikov-Tarnovski ba332a970a
Remove deprecated method helperResourceNames from InstrumentationModule (#4221)
* Remove deprecated method helperResourceNames from InstrumentationModule

* Restore test
2021-09-29 15:25:19 +03:00
Nikita Salnikov-Tarnovski 07871686ea
Hide InstrumentationContextBuilder from public API (#4216)
* Introduce muzzle-specific interface to InstrumentationModule

* Moved more methods to the InstrumentationModuleMuzzle interface

* Fixing tests

* More logs

* Fix log name

* Hide InstrumentationContextBuilder from public API
2021-09-29 11:26:39 +03:00
Nikita Salnikov-Tarnovski 5dffeef4aa
Introduce muzzle-specific interface to InstrumentationModule (#4207)
* Introduce muzzle-specific interface to InstrumentationModule
* Moved more methods to the InstrumentationModuleMuzzle interface
2021-09-28 12:15:33 +03:00
Nikita Salnikov-Tarnovski f788d84e35
Remove muzzle from gradleplugins (#4183)
* Include gradle-plugins as a composite build

* Make gradle-plugins project independent from the main one

* Delete old ClassRef and friends

* Fixes

* Polish

* Polish

* Simplify
2021-09-24 15:59:03 +03:00