Commit Graph

409 Commits

Author SHA1 Message Date
Mateusz Rzeszutek fda4779127
Fix a bug in the field backed VirtualField implementation (#4310)
* Fix a bug in the field backed VirtualField implementation

* Multiple interface fields
2021-10-06 09:40:53 -07:00
Mateusz Rzeszutek 3e93dc8f29
Move Trie back to javaagent-tooling (#4300)
* Move Trie back to javaagent-tooling

* Code review comments
2021-10-05 16:07:33 -07:00
Trask Stalnaker f63fe62a55
Fix merge conflict in main (#4306) 2021-10-05 13:35:19 -07:00
Mateusz Rzeszutek b4984657b5
Move BootstrapPackagePrefixesHolder to javaagent-bootstrap (#4303) 2021-10-05 11:26:24 -07:00
Mateusz Rzeszutek 09ad3d2f58
Split FieldBackedImplementationInstaller into several smaller classes (#4297) 2021-10-05 11:25:39 -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
Trask Stalnaker 0994c07bcf
Small optimization (#4293) 2021-10-04 21:45:10 -07: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 c421b66d56
Remove unnecessary VirtualField#setIfNull() method (#4262) 2021-10-02 13:17:48 -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
Nikita Salnikov-Tarnovski 2eadca8c83
Move AgentExtension to the tooling module (#4253) 2021-09-30 18:57:39 +03: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 19ce45bfc7
Remove deprecated ExporterClassLoader and exporter factories (#4217) 2021-09-28 09:42:40 -07: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
Lauri Tulmin 335d1cd784
Fix latest dep test failures (#4201) 2021-09-25 12:31:55 -07:00
Lauri Tulmin 559cdcbbee
Transform lambda classes (#4182)
* Transform lambda classes

* improve comment
2021-09-24 09:52:15 -07:00
Anuraag Agrawal 9d5cf4e0b3
Add logback.xml to testing-common (#3726)
* Add logback.xml to testing-common

* showStandardStreams

* Remove showStandardStreams due to verbosity

* Fix javaagent-tooling tests

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-09-24 10:09:42 +09:00
Lauri Tulmin 0f3d0cb05b
Generate our own sun.misc.Unsafe if it is not available (#4124)
* Generate our own sun.misc.Unsafe if it is not available

* skip generating invokeCleaner method

* grpc isn't shaded so setting system property doesn't affect only our bundled copy

* generate invokeCleaner when it is present in internal unsafe
2021-09-22 20:18:20 -07:00
Mateusz Rzeszutek dc4ddf7932
Remove ContextStore.Factory interface; use Supplier instead (#4157) 2021-09-17 13:00:23 -07:00
Lauri Tulmin f8b5316956
Log failed instrumentation matcher (#4142) 2021-09-16 10:17:55 -07:00
Anuraag Agrawal 971ca8b19c
Update to OTel 1.6 (#4120)
* Update to OTel 1.6

* Example build

* More example

* More example
2021-09-14 20:12:18 +09: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
Trask Stalnaker 6cc403cdf2
Add strict context stressor testing option (#4001) 2021-09-10 13:53:46 -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
Mateusz Rzeszutek be2e0d137c
Allow adding multiple ContextStore fields to one key class, part 1 (#4067) 2021-09-09 08:06:06 -07:00
Trask Stalnaker 1ea73278d4
Fix extension shading (#4064) 2021-09-08 07:55:44 -07:00
Trask Stalnaker ec99db5e5b
Support empty values in config maps (#4037)
* Support empty values in config maps

* Rename method
2021-09-02 16:00:29 +09:00
Mateusz Rzeszutek 62eae30a60
Make Config behave exactly as SDK DefaultConfigProperties (#4035)
* Make Config behave exactly as SDK DefaultConfigProperties

* errorprone

* errorprone part 2

* errorprone part 3

* fix failing tests
2021-08-31 10:00:04 -07:00
Anuraag Agrawal 96f5708655
Fix parsing of unclean map values in Config. (#4032) 2021-08-31 14:57:55 +09:00
Nikita Salnikov-Tarnovski 28db0c30cd
Deprecate old extensions (#3825)
* Introduce stable property for external extensions

* Update docs to use stable extension property.

Also log a warning if deprecated otel.javaagent.experimental.exporter.jar is used.

* Format

* Format

* Polish
2021-08-25 13:59:17 -07:00
Lauri Tulmin 1dae415ebc
Mark our generated classes and members as synthetic (#3928) 2021-08-24 09:53:22 -07:00
Mateusz Rzeszutek 5c71d28ed7
Remove deprecated Config methods (#3908) 2021-08-23 16:44:54 -07: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
Mateusz Rzeszutek ca8a119e01
Don't pass configuration to SDK autoconfigure through system props (#3866)
* Don't pass configuration to SDK autoconfigure through system props

* suppress CanonicalDuration

* checkstyle
2021-08-19 16:56:12 -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
Lauri Tulmin 667b87bac7
Support looking up a ContextStore from outside of Advice (#3827)
* Support looking up a ContextStore from outside of Advice

* Add exception message

* Move setting ContextStoreSupplier

* Improve comment
2021-08-18 10:36:04 +03:00
Anuraag Agrawal d8eae4997d
Update to SDK 1.5.0 (#3847) 2021-08-17 08:43:11 -07:00
Nikita Salnikov-Tarnovski 33f54cbc88
Introduce stable property for external extensions (#3823)
* Introduce stable property for external extensions

* Examples should still use old property

* Spotless
2021-08-12 08:47:34 +03:00
HaloFour a5513a3c60
Port opentelemetry-annotations-1.0 to Instrumenter API (#3738)
* Port WithSpanInstrumentation to Instrumenter API

* Unit tests, clean up attribute binding APIs

* Remove AsyncSpanEndStrategies and fix weak reference purging

* Move tryToGetResponse to AsyncOperationEndSupport

* Address PR comments

* ParameterAttributeNamesExtractor can no longer return a null array
2021-08-06 10:42:18 -07:00
Nikita Salnikov-Tarnovski 6e706778fd
Remove old muzzle check plugin (#3741)
* Remove old muzzle check plugin

* Polish
2021-08-03 09:21:50 +03: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
Nikita Salnikov-Tarnovski c6f9bef90e
Use published muzzle generation plugin (#3639)
* Use published muzzle generation plugin
2021-07-22 11:46:49 +03:00
Anuraag Agrawal ac8c1e1543
Configure duration metrics export as histograms to dogfood in preparation of SDK 1.5.0 (#3597) 2021-07-16 22:54:15 +09:00
HaloFour 256e8f2a64
Move async strategies to annotation support (#3574)
* Move async strategies to annotation support

* Fix dependencies and refactor copypasta

* Move AsyncSpanEndStrategy to annotation support project

* spotless
2021-07-16 10:55:23 +02:00
Trask Stalnaker 344e205720
Help out Intellij (#3595) 2021-07-16 15:55:30 +09:00
Anna Nosek 409471543e
Test and document otel.javaagent.configuration-file (#3585)
* test and document configuration file property

* use TemporaryFolder rule, documentation changes after review
2021-07-15 22:37:17 -07:00
Anna Nosek 0fd8d2cc47
Add noop sdk configuration option (#3539)
* introduce noop

* test configuration

* rename to noop api, move System.setProperty() calls

* remove unnecessary semicolon

* codenarc fix
2021-07-15 11:33:00 +03:00
Nikita Salnikov-Tarnovski cbfd7e1a02
Trying to extract codegen plugin (#3521)
* Muzzle code generation moved to a separate plugin
* Restored old MuzzleCodeGenerationPlugin to use until the new one is published
* The simplest dependency management possible

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-07-14 17:08:47 +03:00
Trask Stalnaker 922ec44952
Use transform safe logger in HelperInjector (#3553)
* Use transform safe logger in HelperInjector

* Add methods to TransformSafeLogger
2021-07-13 22:00:54 -07:00
Trask Stalnaker d0cb08a37b
Rename javaagent-api artifact to javaagent-instrumentation-api (#3513)
* part 1

* part 2

* Undo change in examples

* Spotless
2021-07-12 21:53:49 -07:00
Anuraag Agrawal f717f6a153
Force flush metrics as well when used. (#3543) 2021-07-12 10:21:04 -07:00
Anuraag Agrawal 09f8534b7b
Migrate ExceptionHandlerTest to Java. (#3549) 2021-07-12 09:54:00 -07:00
Anuraag Agrawal ce27d5d028
Migrate ResourceLocatingTest to Java. (#3550) 2021-07-12 09:53:15 -07:00
Mateusz Rzeszutek 9b56fc9051
Clean up AgentElementMatchers (#3527)
* Clean up AgentElementMatchers

* remove a TODO

* moved method
2021-07-09 10:02:21 +03:00
Trask Stalnaker 9e4da754c2
Use consistent logger field name (#3515) 2021-07-07 10:47:46 -07:00
Nikita Salnikov-Tarnovski 94cf1ef914
Remove usages of agent runtime specific code from reusable classes (#3492)
* Remove usages of agent runtime specific code from reusable classes

* Oops :)

* spotless

* Maybe a bit more clarity

* Doc over requireNonNull

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-07-06 07:46:40 +03:00
Nikita Salnikov-Tarnovski 901bae57b4
Make HelperInjector's dependency on Instrumentation instance more visible (#3491)
* Make HelperInjector's dependency on Instrumentation instance more visible

* Polish

* Polish

* Fix docs
2021-07-06 07:44:26 +03:00
Anuraag Agrawal 8eb24f9886
Split up build logic to plugins that can eventually be published and … (#3474)
* Split up build logic to plugins that can eventually be published and this-repo-specific stuff.

* Muzzle

* compileOnly

* Typo
2021-07-05 16:18:45 +09:00
Anuraag Agrawal 44f2354d41
Allow disabling thread details and disable for most tests. (#3464) 2021-07-01 08:31:27 -07:00
Mateusz Rzeszutek f5f2de9511
Refactor/rename BootstrapPackagesProvider and PropertySource (#3435)
* Refactor/rename BootstrapPackagesConfigurer and PropertySource

* Update comment
2021-07-01 08:26:51 -07:00
Anuraag Agrawal c46761b8a9
Migrate javaagent-* to kotlin dsl (#3434) 2021-06-29 23:56:01 +09:00
Mateusz Rzeszutek c1a0333cdb
Port AsyncSpanEndStrategy to Instrumenter API (#3262)
* Port AsyncSpanEndStrategy to Instrumenter API

* code review comments

* rename to AsyncOperationEndSupport

* weak-ref agent strategy storage; and passing response to Instrumenter if types match

* fix tests
2021-06-29 16:51:17 +02:00
Lauri Tulmin 6ac2083d19
Remove byte-buddy-agent dependency (#3428) 2021-06-29 14:36:10 +03:00
Anuraag Agrawal 785dc6adf2
Rename build files to build.gradle (#3409)
* Rename build files to build.gradle

* Rename smoke-tests

* Fix already broken
2021-06-25 16:10:31 +09:00
Anuraag Agrawal deb0e255cf
Use plugins block everywhere for applying plugins (#3386)
* Use plugins block everywhere for applying plugins

* Actually it's library instrumentation
2021-06-24 11:13:35 +09:00
Mateusz Rzeszutek 02098b9353
Ignore task classes using IgnoredTypesConfigurer (#3380) 2021-06-23 10:15:02 -07:00
Mateusz Rzeszutek f451aef43c
Improve ignored but instrumented types assertion in javaagent tests (#3356)
* Improve ignored but instrumented types assertion in javaagent tests

* add one missing ignore

* Add ignored types to spring-rabbit and fix tests

* spotless
2021-06-22 22:37:29 -07:00
Lauri Tulmin 5281e50780
Exclude bytebuddy generatede helper class from redefinition (#3369) 2021-06-21 13:13:19 -07:00
Trask Stalnaker 7d5c7e0a4a
Fix spring jms listener instrumentation (#3359)
* Fix Spring JMS listener instrumentation

* Comment

* More allows
2021-06-21 11:46:34 +02:00
Mateusz Rzeszutek 0a8907d927
Hide Config#create() method and use builder everywhere (#3338)
* Hide Config#create() method and use builder everywhere

* Deprecate Config#asJavaProperties()
2021-06-17 10:39:39 -07:00
Mateusz Rzeszutek ee1bbea810
Use IgnoredTypesConfigurer to ignore classloaders (#3323) 2021-06-16 10:12:03 -07:00
Mateusz Rzeszutek 3e28b01e42
Spring Integration javaagent instrumentation (#3295)
* Spring Integration javaagent instrumentation

* codenarc

* inline gradle property

* Conditionally create CONSUMER spans instead of always INTERNAL

* merge fix

* Add attributes assertions to rabbitMq test

* minor fix

* fix javadocs

* Code review follow-up
2021-06-16 14:12:39 +03:00
Mateusz Rzeszutek f4194023f4
Remove unused Utils method (#3324) 2021-06-16 09:55:50 +09:00
Lauri Tulmin c7ac235614
Preload AtomicReferenceArray (#3315) 2021-06-15 09:55:57 -07:00
Mateusz Rzeszutek 314ba8c1e8
Rewrite global ignores matcher to IgnoredTypesConfigurer (#3298) 2021-06-15 18:03:28 +02:00
Anuraag Agrawal a818f14957
Migrate publish.gradle to convention plugin (#3312)
* Migrate publish.gradle to convention plugin

* Migrate usages of publish.gradle

* Remove publish.gradle

* Newline
2021-06-15 22:12:48 +09:00
Anuraag Agrawal 4c90d6ae35
Remove logic related to jacoco coverage check. (#3314) 2021-06-15 14:57:10 +03:00
Nikita Salnikov-Tarnovski b9eac531ea
Embedded extension (#3237)
* Support for multiple extension jars by scanning the given folder

* Support to embed extension jar right inside agent jar

* Support for multiple embedded extensions

* Create temp folder for embedded extensions only if they found

* ExtensionClassLoader skips agent jar when scanning folder

* Apply suggestions from code review

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Update examples/extension/build.gradle

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

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-06-14 16:24:25 -07:00
Anuraag Agrawal 224dc51e93
Migrate java.gradle to conventions plugin (#3289)
* Migrate java.gradle to convention plugin.

* Switch to java-conventions

* Remove old file

* Fix

* Fix merge

* Missing paragraph

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-06-15 08:10:39 +09:00
Anuraag Agrawal 9a19c6fa67
Make guava compileonly (#3290)
* Make guava compileonly

* testImplementation
2021-06-14 23:05:53 +09:00
Trask Stalnaker 8be100637a
Fix ForkJoinPool sometimes not instrumented (#3293) 2021-06-14 13:01:33 +03:00
Anuraag Agrawal b8cddc0dd8
Only include exporters in -all jar. (#3286)
* Only include exporters in -all jar.

* override exporter

* Newline
2021-06-14 13:49:22 +09:00
Trask Stalnaker dc316609ee
Remove unnecessary final on params and local vars (#3283)
* Remove unnecessary final on params and local vars

* Fix gwt

* Keep final for non-initialized var

* Keep final for non-initialized var

* Keep final for non-initialized var
2021-06-14 07:13:11 +03:00
Trask Stalnaker ab174f4f9c
Remove javaagent-tooling test forking (#3272)
* Remove javaagent-tooling test forking

* Remove one more forking
2021-06-13 10:57:45 -07:00
Anuraag Agrawal 5f49dc0e4a
Extract agent shadow configuration to conventions script. (#3256)
* Extract agent shadow configuration to conventions script.

* Remove redundant plugin version declaration

* Resource loader doesn't load from buildSrc

* Comments about byte buddy version

* Fix ReferenceCollectorTest

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-06-12 16:45:26 -07:00
Trask Stalnaker bec9966e30
Fix failing test (#3269) 2021-06-12 11:37:04 +03:00
Anuraag Agrawal e118c469be
Replace Guava cache with Caffeine in agent type pool. (#3255)
* Replace Guava cache with Caffeine in agent type pool.

* Not that many classloaders

* Remove unused
2021-06-12 15:56:45 +09:00
Mateusz Rzeszutek 3b09d46950
Introduce IgnoredTypesConfigurer SPI to enable defining per-module ignores (#3219) 2021-06-11 12:41:57 -07:00
Nikita Salnikov-Tarnovski aa4f07db6e
Support for multiple extension jars by scanning the given folder (#3226) 2021-06-11 11:32:52 -07:00
Nikita Salnikov-Tarnovski 31d3f2f8de
Update ByteBuddy (#3254)
* Update ByteBuddy

* spotless
2021-06-11 21:12:38 +09:00
Mateusz Rzeszutek 50b7a20b39
Fix spring-webflux latestDepTest (#3251) 2021-06-11 11:06:47 +03:00
Mateusz Rzeszutek 99be242e22
Rename ComponentInstaller to AgentListener and add #order() method (#3182)
* Rename ComponentInstaller to AgentListener and add #order() method

* Code review comments

* Update javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/SafeServiceLoader.java

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
2021-06-07 19:50:19 +02:00
Anuraag Agrawal 2436499a09
Update to Errorprone 2.7 (#3181)
* Update to errorprone 2.7

* ToString

* Finish
2021-06-04 10:40:55 +09:00
Mateusz Rzeszutek b8aec6a671
Remove no longer needed NameMatchers class (#3179) 2021-06-03 14:36:36 -07:00
Mateusz Rzeszutek f8a2ebd32b
Use slf4j placeholders instead of manually joining log messages (#3180) 2021-06-03 14:36:21 -07:00
Trask Stalnaker be6816489a
Small cleanup (#3163)
* Small cleanup

* Ooops
2021-06-02 08:56:49 +03:00
Anuraag Agrawal c3dedbb64e
Enable all errorprone checks (#3155)
* Enable all errorprone checks

* Fixes

* Finish

* Finish

* Add flag to disable error prone
2021-06-01 17:41:08 +09:00
Anuraag Agrawal ed88cca533
Migrate from spotbugs to errorprone (#3122)
* Migrate from spotbugs to errorprone

* Fix hashtable

* try-with-resources

* Fix from merge

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-28 14:23:40 -07:00
Anuraag Agrawal c358a35414
Use dependency management pattern for dependency versions (#3113)
* Use dependency management pattern for dependency versions.

* Add groovy bom too

* Update dependencyManagement/dependencyManagement.gradle.kts

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-28 11:32:08 +09:00
Ago Allikmaa fd132d463d
Change Async Servlet span end logic to fix race condition on Undertow (#2992)
* Attach servlet async listener with asyncStart instrumentation

* Exclude Spring packages containing servlet request classes from global ignores

* Exclude Tapestry HSR proxy with global ignore

* Improve comments.

* Fix for Liberty - request response when adding async listener

* Removed unused methods

* Explicit response to async listeners on all servlet engines

* Attach response to request on Jetty

* Fix broken build due to rebase, improved a comment

* Address PR comments

* Added a comment.

* Addressed PR comments
2021-05-25 20:46:37 -07:00
Nikita Salnikov-Tarnovski 3cfd58c268
Extensions example (#3071)
* Simplify extensions example project

* Add external dependency and fat jar support

* spotless

* Apply suggestions from code review

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Apply suggestions from code review

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

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-25 14:57:43 +03:00
Mateusz Rzeszutek 6fb3ec0501
Do not use arrays in InstrumentationModule (#3057)
* Do not use arrays in InstrumentationModule

* add missing cast
2021-05-24 13:51:07 +02:00
Lauri Tulmin ccda31ab50
Fix spring webmvc and webflux latest dep failure (#3060) 2021-05-21 11:15:55 -07:00
Mateusz Rzeszutek 272419a6f3
Refactor muzzle Reference class (#3040)
* split out inner classes into separate files
* and since they're public API I made them a little bit better: added javadocs, renamed classes/methods

Getting the `...extension.muzzle` package stable is the first step to extracting the muzzle compile time plugin - the plugin may have a bit different release lifecycle than the main project and getting those classes stable will help a lot with eliminating breaking changes.
2021-05-20 14:33:43 -07:00
Trask Stalnaker 6efae9ad28
Remove duplicate method (#3032) 2021-05-19 11:56:34 -07:00
Nikita Salnikov-Tarnovski e3cf8ecf18
First POC for external extension loading (#2881)
* First POC for external extension loading

* Fix NPE

* Urlhandler

* Fix

* Polish

* Polish

* Urlhandler

* Trying Urlhandler

* Alternative way to load extensions

* Polish

* Add example extensions and smoke test for their usage

* Support for system property

* Polish

* Avoid doing remapping twice

* Polish after merge

* Update to latest changes in extentions api

* Polish

* No need for tooling

* Simplify

* Cleanup

* Better error handling

* Update to the latest API
2021-05-18 22:59:39 +03:00
Mateusz Rzeszutek bb8f515083
Refactor TypeInstrumentation#transformers() method (#3019)
* Refactor TypeInstrumentation#transformers() method part 1

Add TypeInstrumentation and its implementations

* Refactor TypeInstrumentation#transformers() method part 2

Use the new method in all existing TypeInstrumentation implementations

* Drift

* Spotless

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-18 09:50:26 +02:00
Trask Stalnaker d6141dddc7
Update agent logger prefix (#3007) 2021-05-17 12:06:39 +09:00
Mateusz Rzeszutek 9c1083b541
Muzzle code generation cleanup (#2985)
* Muzzle code generation cleanup

- remove hardcoded class names from MuzzleCodeGenerator (easier renaming in the future)
- store field/method descriptors in references instead of types/lists of types
- remove unnecessary primitive type comparison in ReferenceMatcher (comparing descriptors is enough)
- improve printMuzzleReferences output
2021-05-15 14:48:18 -07:00
Anuraag Agrawal fe41885ee6
Switch to colon notation for dependencies. (#2994)
* Switch to colon notation for dependencies.

* Even more cleanup

* Revert mistake
2021-05-15 15:31:06 +09:00
Mateusz Rzeszutek a72a7838f0
Load InstrumentationModules using InstrumentationLoader (#2971)
* Load InstrumentationModules using InstrumentationLoader

* writing-instrumentation-module doc improvement

* spotless
2021-05-13 14:12:53 +02:00
Trask Stalnaker d67f161e6d
Muzzle optimization (#2903) 2021-05-11 21:01:35 -07:00
Lauri Tulmin 0b854a5eb6
Agent class loader multi release jar (#2912)
* Agent class loader multi release jar

* improve handling of signed agent jar
2021-05-11 14:54:56 -07:00
Trask Stalnaker 8379404ae8
Uncomment and fix JAX-RS default method tests (#2930) 2021-05-11 11:22:11 -07:00
Mateusz Rzeszutek 871f9a0d24
InstrumentationModule cleanup (#2925) 2021-05-11 09:24:31 -07:00
Trask Stalnaker edec1bfdc6
Cache default enabled config (#2938)
* Cache default enabled config

* Fix unit tests

* Spotless

* Inline methods and remove corresponding tests

* Update javaagent-extension-api/src/main/java/io/opentelemetry/javaagent/extension/instrumentation/InstrumentationModule.java

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>

* Spotless

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
2021-05-10 12:18:22 +03:00
Trask Stalnaker 6a84c2b2ec
Remove unnecessary generic type args (#2937)
* Remove unnecessary generic type args

* Revert one
2021-05-10 12:18:30 +09:00
Trask Stalnaker 1ce90bb4cd
Remove unnecessary constant (#2941) 2021-05-09 19:30:12 +03:00
Mateusz Rzeszutek f2d7e0ed74
Fix compilation failure on main (#2926)
* Fix compilation failure on main

* Fix muzzle (probably)

* Fix muzzle (probably)

* Fix muzzle (probably)

* Fix muzzle (probably)

* Remove unnecessary dependency

* Revert "Remove unnecessary dependency"

This reverts commit 3fc1e68c99.

* spotless + random change in javaagent-tooling
2021-05-07 15:54:07 +03:00
Mateusz Rzeszutek 9c7fae3b04
Extract javaagent-extension-api from tooling & spi (#2879) 2021-05-06 23:30:25 -07:00
Trask Stalnaker 690e3bdd16
Remove outdated muzzle condition (#2906)
* Remove outdated muzzle condition

* Remove outdated test
2021-05-05 10:33:28 +03:00
Lauri Tulmin beae3276df
Fix flaky smoke tests (#2849)
* Enable debug logging for smoke tests

* trigger rerunning of smoke tests

* trigger rerunning of smoke tests

* pass agent in JVM_ARGS instead of JAVA_TOOL_OPTIONS on glassfish

* spotless

* remvove debugging code

* update windows image versions

* Ensure java.lang.reflect.Proxy is loaded before bytebuddy transformer is set up

* update windows image version

* Update javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentInstaller.java

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-04-29 12:47:42 +02:00
Mateusz Rzeszutek e4133f1845
Muzzle should check whether used fields are declared somewhere (#2870) 2021-04-28 10:01:21 -07:00
Lauri Tulmin bd02b0ce76
Log the whole exception when transformation fails (#2852) 2021-04-23 10:36:13 +09:00
Lauri Tulmin 9f8371e77c
Use locale insensitive lower/upper case conversion (#2838) 2021-04-22 11:24:13 +09:00
Pavol Loffay ce5355c211
Move install component before BB to install method (#2821) 2021-04-21 15:05:07 -07:00
Lauri Tulmin a3c0b44b31
JAX-RS ApplicationPath annotation (#2824) 2021-04-21 09:07:54 -07:00
Mateusz Rzeszutek 95f8342558
Deprecate additionalHelperClassNames (#2810)
* Deprecate additionalHelperClassNames

* Deprecate additionalHelperClassNames
2021-04-16 10:11:11 +02:00
Trask Stalnaker c17b803b71
Use isHelperClass over additionalHelperClassNames (#2796) 2021-04-14 09:38:16 -07:00
Trask Stalnaker 9bd028f767
Remove unnecessary genericness (#2797) 2021-04-14 00:01:28 -07:00
Mateusz Rzeszutek 078603caf5
Generate InstrumentationModule#contextStore() with muzzle (#2775) 2021-04-13 20:05:01 -07:00
Trask Stalnaker 117d38a01b
Support URLClassLoader addURL (#2772) 2021-04-12 15:53:44 -07:00
Trask Stalnaker 0f60b44b7c
Avoid proxy IllegalArgumentException: repeated interface (#2773) 2021-04-12 13:59:40 -07:00
Trask Stalnaker 5be065cd31
Switch to grpc-netty-shaded (#2769) 2021-04-11 13:27:37 -07:00
Mateusz Rzeszutek b204fcc56e
Bring back Guava to javaagent-tooling (it's actually used here) (#2764) 2021-04-09 16:54:06 +03:00
Mateusz Rzeszutek c872513896
Remove unused class (#2757) 2021-04-08 17:49:19 +02:00
Anuraag Agrawal a4ea1c9db2
Update to OTel 1.1.0 (#2744)
* Update to OTel 1.1.0

* Use transform safe logger

* Finish

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-04-08 16:01:16 +09:00
Trask Stalnaker 6ea316e22e
Remove timeout annotations (#2725) 2021-04-06 16:36:18 +09:00
Mateusz Rzeszutek 1406855bb7
Revert "Prevent duplicate telemetry when using both library and auto instrumentation (#2661)" (#2689) 2021-04-01 16:11:15 -07:00
Trask Stalnaker d5e526b9f3
Cache config values in instrumentations (#2681)
* Cache config values in instrumentations

* Bring back defaultEnabled()

* comment

* one problem
2021-03-31 22:54:20 -07:00
Mateusz Rzeszutek 30434696ae
Prevent duplicate telemetry when using both library and auto instrumentation (#2661)
* Prevent duplicate telemetry when using both library and auto instrumentation

* Add unit test

* Fix Oshi tests

* Fix couchbase 3.1 tests
2021-03-31 10:57:04 -07:00
Mateusz Rzeszutek 1e50b72937
Make muzzle reference creation package(s) configurable (#2615)
* Make muzzle reference creation package(s) configurable

* Code review comments
2021-03-26 14:12:43 +02:00
Anuraag Agrawal 81648fe560
Remove CommonTaskExecutor (#2635) 2021-03-26 13:58:11 +02:00
Anuraag Agrawal 79d7e88e53
Use Caffeine for weak maps (#2601)
* Caffeine weakmap

* Use Caffeine for weak maps

* Drift

* Drift

* Remove weak-lock-free

* Update licenses

* Fix bug

* Restore weaklockfree

* Clean

* Fixes

* Inline expunction

* Synchronized

* More comment

* Fix shading

* Executor

* computeIfAbsent and delete unused.

* Fix license report
2021-03-24 17:12:26 +09:00
Nikita Salnikov-Tarnovski d79f90492a
Make sure muzzle build-time check actually validates anything (#2599)
* Check if muzzle build-time check actually validates anything

* Force class files generation before muzzle

* Apply muzzle only to javaagent projects

* Apply muzzle only to javaagent projects

* More fixes

* More fixes

* PR review comments

* polish

* Exclude "broken" version

* Polish

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-03-23 14:12:01 +02:00
Mateusz Rzeszutek 9fff4a3b47
ComponentInstallers should run after LogManager if a custom one is detected (#2592)
* ComponentInstallers should run after LogManager if a custom one is detected

* Limit to Java 8
2021-03-18 14:10:22 +02:00