Commit Graph

88 Commits

Author SHA1 Message Date
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 c45b4ea5be
Fix redefinition failure on openj9 (#5009)
* Fix redefinition failure on openj9

* isntead of remembering the list of interfaces the class has remember whether it has any of the virutal field marker interfaces

* address review comment

* ensure virtual field detection works when internal-reflection instrumentation is disabled
2022-01-06 08:54:32 -08:00
Lauri Tulmin 3f3180841e
Avoid crashing on early 1.8 openjdk vms (#4789) 2021-12-05 13:37:01 +02:00
Lauri Tulmin 1e371377a1
Fix build (#4743)
* Fix build

* avoid npe
2021-11-30 14:07:07 +02:00
Lauri Tulmin 10288c6f25
Work around jvm crash on early 1.8 (#4345)
* Work around jvm crash on early 1.8

* skip retransform if class was already transformed during load

* fix imports after rebase

* add test

* disable test on windows
2021-11-29 22:47:10 -08:00
Lauri Tulmin 92f83f10f0
Remove virtual field interfaces from reflection results (#4722)
* Remove virtual field interfaces from reflection results

* fix java8 and openj9
2021-11-29 12:09:28 -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 2d0aa19179
Add missing java.util.logging.Logger methods to PatchLogger (#4540)
* Add missing java.util.logging.Logger methods to PatchLogger

* spotless
2021-10-28 17:59:21 -07: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
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 b4984657b5
Move BootstrapPackagePrefixesHolder to javaagent-bootstrap (#4303) 2021-10-05 11:26:24 -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
Lauri Tulmin 559cdcbbee
Transform lambda classes (#4182)
* Transform lambda classes

* improve comment
2021-09-24 09:52:15 -07: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
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 344e205720
Help out Intellij (#3595) 2021-07-16 15:55:30 +09:00
Mateusz Rzeszutek 9a3734f8ed
Clean up bootstrap dependencies and build scripts (#3570)
* Clean up bootstrap dependencies and build scripts

* add evaluationDependsOn()

* Resolve configuration later

* remove the javaagentLibs config

* Fix muzzle bootstrap classpath

* Fix after rebase

* Try javaagentLibs once again
2021-07-15 18:56:36 +02:00
HaloFour 814239c8c0
Adds binding of attributes in methods annotated with @WithSpan (#3188)
* Add binding of span attributes for traced methods

* Spring Aspect support, memoization

* Test with attribute name from ParameterNameDiscoverer

* Refactorings, javadocs and tests

* Refactor out creating AttributeBinding to separate class

* Wrapped attribute bindings for array parameters

* Attribute binding for List and EnumSet

* Attribute binding for subclass of List with reflection helper class

* Fix test failures in JDK 8

* Attribute binding to Set<? extends Enum>

* Move attribute binding to instrumentation-annotation-support project

* Fix copypastaed missing imports in tests

* Simplify ParameterizedClass based on PR feedback and add javadocs

* Remove blank javadoc

* Switch to cache with weak keys for memoizing attribute bindings by method

* Remove binding support for EnumSet<?>

* Clean up javadoc

* Use SpanAttribute annotation from opentelemetry 1.4.0-SNAPSHOT

* Address some PR concerns

* Clean up

* Fix instrumentation dependency in Springboot

* Update documentation

* Switch javaagent dep to compileOnly per PR comment

* spotless

* Kick CI

* Rename annotation support module and packages

* Resolve SpanAttribute annotation at runtime with fallback for older OTel versions

* Remove unnecessary dependency

* Move reflection helper to annotation support module

* Remove unnecessary enum and fields from unit test
2021-07-14 13:32:07 -07:00
Mateusz Rzeszutek c1b5c0884d
Move caffeine patching to instrumentation-api-caching (#3559) 2021-07-14 13:59:50 +02: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
Trask Stalnaker 093ff6ac43
Checkstyle for logger (#3520)
* Add checkstyle validation for logger name

* Missed one
2021-07-08 09:54:38 +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
Mateusz Rzeszutek 02ef588f68
Remove dependency on javaagent-bootstrap from javaagent-extension-api (#3477) 2021-07-03 11:18:53 -07:00
Nikita Salnikov-Tarnovski 47819633e4
Read correct manifest (#3439)
* Read correct manifest

* Unused field removed
2021-07-01 08:25:01 -07:00
Trask Stalnaker 367335fa28
Remove unnecessary and complex logic (#3395) 2021-06-30 21:36:48 -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
Anuraag Agrawal 3a08045b03
Update dependencies (#3332) 2021-06-16 10:05:56 -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
Trask Stalnaker 48a90b090c
Better support for wrapping premain (#3302)
* Better support for wrapping premain

* fix

* Fix test

* Sync comment from test
2021-06-15 09:27: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
Trask Stalnaker 62f1f49bcd
Intellij cleanup (Java and Groovy) (#3285)
* Intellij cleanup

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbAttributesExtractorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlAttributesExtractorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation/spring/spring-web-3.1/library/src/test/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateInterceptorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Use glassfish version that supports lambdas

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-06-14 10:23:01 -07: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
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
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
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
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 6a84c2b2ec
Remove unnecessary generic type args (#2937)
* Remove unnecessary generic type args

* Revert one
2021-05-10 12:18:30 +09:00
Trask Stalnaker 65995388e6
Clean up Java 7 references (#2931)
* Clean up Java 7 references

* Use Java 8 stuff!

* Spotless
2021-05-09 14:16:42 +03:00
Lauri Tulmin a04ca47d60
Prevent AgentClassLoader from loading ContextStorageOverride (#2847) 2021-04-22 16:25:35 +02:00
Trask Stalnaker 117d38a01b
Support URLClassLoader addURL (#2772) 2021-04-12 15:53:44 -07:00
Trask Stalnaker 6ea316e22e
Remove timeout annotations (#2725) 2021-04-06 16:36:18 +09:00