Commit Graph

51 Commits

Author SHA1 Message Date
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
Anuraag Agrawal 14372adb68
Migrate Guava tests to Java (#5668)
* Migrate Guava tests to Java

* Update instrumentation/guava-10.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/guava/ListenableFutureTest.java

Co-authored-by: Lauri Tulmin <tulmin@gmail.com>

* Workaround inline mock issue

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <tulmin@gmail.com>
2022-03-24 14:14:09 +09: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 c28374615b
Add functionality to generate API changes (#4285)
* Add functionality to generate API changes

* Update conventions/src/main/kotlin/otel.japicmp-conventions.gradle.kts

Co-authored-by: John Watson <jkwatson@gmail.com>

* Do not commit any API changes until we have stable release

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-10-06 09:59:01 +03: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
Mateusz Rzeszutek 699cc81990
Remove one unnecessary list copy from AgentLocationStrategy (#4156) 2021-09-17 11:30:20 -07:00
Nikita Salnikov-Tarnovski 17d9c6f414
Remove generated InstrumentationModule#getMuzzleReferences() method from the source code (#4087)
* Remove generated InstrumentationModule#getMuzzleReferences() method from the source code

* Fix errorprone

* Class-based cache for MethodHandle

* Consistent suppression.
2021-09-13 12:55:38 +02:00
Matthew Ho 6967484a97
Update groovy import order to match default IntelliJ (#1708) (#4047)
* Update groovy import order to match default IntelliJ (#1708)

* organized imports for .groovy files to follow default IntelliJ import settings

* updated intellij-setup.md

* Spotless

* drift

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-09-11 11:53:08 -07:00
Mateusz Rzeszutek 7424f33dfb
Allow adding multiple ContextStore fields to one key class, part 2 (#4084)
* Allow adding multiple ContextStore fields to one key class, part 2

* checkstyle
2021-09-10 13:50:26 -07:00
Lauri Tulmin 38470bd2e6
Use unsafe to inject classes to boot loader (#4026) 2021-08-30 11:29:37 -07:00
Trask Stalnaker 20c72f3e98
Format kotlin gradle files (#3942)
* Add ktlint for kotlinGradle

* ktlint fails on wildcard imports

* Auto-format kotlin gradle files
2021-08-25 13:43:57 +09:00
Trask Stalnaker 5ff7901efc
Versioned helper resources, part 2 (#3880)
* Versioned helper resources, part 2

* Remove accidentally added javadoc param

* Spotless

* Fix test
2021-08-20 13:52:04 -07:00
Trask Stalnaker 36bdce2f5c
Support versioned instrumentation helper resources (#3864)
* Support versioned instrumentation helper resources

* Remove duplicated class

* Groovy

* Spotless

* Renames

* HelperResources -> HelperResourceBuilder
2021-08-19 12:17:09 -07:00
Mateusz Rzeszutek bebb877017
Fix printMuzzleReferences gradle task (#3808)
* Fix printMuzzleReferences gradle task

* suppress SystemOut warnings

* bump gradle-plugins version
2021-08-10 12:10:29 -07:00
Nikita Salnikov-Tarnovski e20c3779e1
Extract helper injection verification logic from plugin util into standalone class (#3688) 2021-07-29 10:23:49 +03:00
Nikita Salnikov-Tarnovski 4617a0475a
Extract some muzzle checking logic from plugin util into standalone class (#3685)
* Extract some muzzle checking logic from plugin util into standalone class
2021-07-28 10:40:30 +03:00
Nikita Salnikov-Tarnovski 6a2ee3255a
Extract muzzle check plugin (#3657)
* Extract muzzle check plugin
2021-07-26 12:37:14 +03:00