Commit Graph

130 Commits

Author SHA1 Message Date
Mateusz Rzeszutek 35c63a4184
Remove the 'noop API' feature (#6313)
* Remove the 'noop API' feature

* remove noop api dep

* fix tooling tests
2022-07-12 10:36:19 -07:00
Mateusz Rzeszutek b23db97a28
Use ConfigProperties in javaagent SPIs (#6285)
* Use ConfigProperties in javaagent SPIs

* remove deprecated

* errorprone

* fix javaagent build

* fix javaagent-tooling tests

* spotless
2022-07-12 08:41:01 +02:00
Mateusz Rzeszutek 7bbe918008
InstrumentationConfig part 2 (#6292) 2022-07-11 09:47:19 +02:00
Mateusz Rzeszutek e7887ac929
Idea: deprecate `Config`, add agent-only `InstrumentationConfig` (#6264)
* Idea: deprecate Config, add agent-only InstrumentationConfig

* fix

* fix camel test

* fix external-annotation tests
2022-07-08 16:20:49 +02:00
Mateusz Rzeszutek 198dad00d6
Prefer using ConfigProperties over Config in AgentListener (#6202)
* Prefer using ConfigProperties over Config in AgentListener

* normalize property name

* add TODOs
2022-07-07 15:44:32 +02: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
Mateusz Rzeszutek cb7421c592
Add an SPI for customizing Config just before it's set (#6010)
* Add an SPI for customizing Config just before it's set

* deprecate ConfigPropertySource in favor of ConfigCustomizer

* errorprone
2022-05-16 11:55:01 -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
Mateusz Rzeszutek 25d929b5e7
Deprecate the AgentListener#beforeAgent() method (#6006)
* Deprecate the AgentListener#beforeAgent() method

* errorprone
2022-05-10 10:30:40 -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
Mateusz Rzeszutek 202a24c867
Remove deprecated code from instrumentation-api, extension-api (#5883) 2022-04-19 12:22:11 -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 65717dae3e
Cleanup Config & ConfigBuilder API (#5733)
* Cleanup Config & ConfigBuilder API

* errorprone

* errorprone & spotless

* spotless
2022-04-05 20:20:52 -07:00
Mateusz Rzeszutek 2fd167cfe0
Move BootstrapPackagesConfigurer to javaagent-tooling (#5734) 2022-04-01 11:33:07 -07: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
Mateusz Rzeszutek 56f65e4fab
Convert all logging statements from slf4j to jul - part 1 (#5628)
* Convert all logging statements from slf4j to jul - part 1

* fix tests

* use placeholders

* fixed all comments, added static imports for Level
2022-03-22 10:35:27 -07:00
Anuraag Agrawal ec375116be
Fix more lint warnings (#5174)
* Fix more lint warnings

* Redisable lint

* Drift

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-01-20 12:48:46 +09: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
Lauri Tulmin 191a9a00ce
InstrumentationClassPredicate was renamed to HelperClassPredicate (#4964) 2021-12-21 11:19:07 -08:00
jack-berg 45dca4fc5d
Expose AutoConfiguredOpenTelemetrySdk to AgentListener (#4831)
* Expose AutoConfiguredOpenTelemetrySdk to AgentListener

* Only call AgentListener if noop is disabled, deprecate AgentListener methods

* Call AgentListener in DelayedAfterAgentCallback
2021-12-10 12:55:57 -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
Trask Stalnaker e9022da102
Remove unshaded javax.annotation classes from bootstrap class loader (#4454)
* Fix shading

* Revert "Fix shading"

This reverts commit 2aad3cfe21.

* Make javax.annotations compileOnly

* Replace checker GuardedBy with otel api internal GuardedBy

* Fix build

* Fix errorprone failures

* Remove extra newline

* Move internal GuardedBy to instrumentation-api

* empty commit

* empty commit
2021-10-21 14:47:50 -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
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
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 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 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
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
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
Mateusz Rzeszutek be2e0d137c
Allow adding multiple ContextStore fields to one key class, part 1 (#4067) 2021-09-09 08:06:06 -07:00
Mateusz Rzeszutek 5c71d28ed7
Remove deprecated Config methods (#3908) 2021-08-23 16:44:54 -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 4bbd6b3427
Deprecate MetricExporterFactory (#3862) 2021-08-19 08:53:01 -07:00
Trask Stalnaker 344e205720
Help out Intellij (#3595) 2021-07-16 15:55:30 +09: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
Mateusz Rzeszutek 1d2743271b
Clean up javaagent-instrumentation-api and javaagent-extension-api de… (#3557)
* Clean up javaagent-instrumentation-api and javaagent-extension-api deps a bit

* fix javadocs
2021-07-14 09:08:50 +03: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
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
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
Mateusz Rzeszutek 02ef588f68
Remove dependency on javaagent-bootstrap from javaagent-extension-api (#3477) 2021-07-03 11:18:53 -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
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 ee1bbea810
Use IgnoredTypesConfigurer to ignore classloaders (#3323) 2021-06-16 10:12:03 -07: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
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
Mateusz Rzeszutek 1982065270
Deprecate SpanExporterFactory in favor of ConfigurableSpanExporterProvider (#3299) 2021-06-14 11:56:02 -07:00
Anuraag Agrawal ceaa92ad36
Disable default resource providers in tests. (#3288) 2021-06-14 16:24:35 +09:00
Mateusz Rzeszutek 3b09d46950
Introduce IgnoredTypesConfigurer SPI to enable defining per-module ignores (#3219) 2021-06-11 12:41:57 -07: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
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
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
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
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
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
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
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
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