Commit Graph

129 Commits

Author SHA1 Message Date
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
Lauri Tulmin 53cd8a904c
Implement getContentLenth for InternalJarUrlHandler (#2692) 2021-04-02 08:30:10 +03:00
Trask Stalnaker af13e7d6e3
Remove oshi-related code from shared agent code (#2682) 2021-03-31 22:53:22 -07: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
Mateusz Rzeszutek 3dff44874f
Fix RestTemplateInterceptor so that it calls endExceptionally() on exception (#2516) 2021-03-08 09:36:47 -08:00
Anuraag Agrawal 682dd10a6e
Fix shading of caching artifact. (#2523) 2021-03-08 13:32:20 +09:00
Anuraag Agrawal d7f8967ff6
Add a caching API based on caffeine for use from instrumentation, not just javaagent (#2477)
* Add caching API

* Finish

* javadoc

* Extract dep

* git add

* Drift

* Spotbugs

* checkstyle

* Fix package

* Test Caffeine patch
2021-03-05 17:57:23 +09:00
Trask Stalnaker 0abc492bc3
Rename more properties (#2486)
* Rename more props to experimental

* Rename more properties

* Rename .internal to .testing

* Revert changes to examples distro

* Move chunk.new-trace to experimental

* Fix unrelated build issue
2021-03-04 11:20:47 -08:00
Trask Stalnaker 16d654c59e
Add addHandler method to PatchLogger (#2430) 2021-02-28 00:03:38 +02:00
Trask Stalnaker 79fa9e0816
Fix debug logging (#2351)
* Fix debug logging

* Fix test

* Fix another test
2021-02-20 10:06:50 +02:00
Lauri Tulmin c95b5048e8
Avoid NoSuchMethodError on shutdown (#2321) 2021-02-18 11:51:55 +09:00
Trask Stalnaker 427bd5fbb0
Move slf4j-simple initialization from bootstrap into tooling (#2305)
* Move more init out of bootstrap

* spotLESS
2021-02-17 14:51:45 +02:00
John Watson a0b208fd52
Turn on the logging span exporter if agent debug is enabled. (#2270) 2021-02-16 15:38:37 -08:00
Mateusz Rzeszutek a74f60b3f8
Add JUnit 5 extensions for instrumentation testing (#2241)
* Add JUnit 5 extensions for instrumentation testing

* Fix kafka tests

* RepeatedTest
2021-02-12 12:57:08 +01:00
Nikita Salnikov-Tarnovski 2d683d4289
No more gradle warnings (#2103) 2021-01-26 08:24:18 +02:00
Anuraag Agrawal afdde0355b
Update to OTel 0.14.1 (#2059)
* Update SDK dependency to 0.14.1

* WIP

* Finish

* Cleanup
2021-01-18 13:02:04 +09:00
Lauri Tulmin 640a7d624b
Correct some spelling mistakes (#2025) 2021-01-12 11:10:45 -08:00
Anuraag Agrawal 8d74baa2e4
Run tests with javaagent. (#1643)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-01-04 13:13:24 -08:00
Pavol Loffay f69217e2a4
Add ComponentInstaller SPI and use it for OpenTelemetry SDK (#1848)
* Add component installer SPI

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Move more code to agent installer

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
2020-12-18 08:55:24 +02:00
Mateusz Rzeszutek 90ecff512a
Muzzle mismatch logs should be warnings in tests (#1754) 2020-11-26 11:21:17 -08:00
Trask Stalnaker 3b480f5e50
Rename otel trace properties (#1740)
* Rename otel.trace.enabled

* Rename otel.trace.debug

* Rename otel.trace.config

* Rename otel.trace.runtime.context.field.injection

* Rename otel.instrumentations.enabled

* Document otel.javaagent.enabled
2020-11-23 14:53:18 -08:00
Trask Stalnaker 79f76c78ad
Move java files to java source folder and groovy files to groovy source folder (#1735)
* Move java files to java source folder

* Move groovy files to groovy source folder

* Too much

* Move another one back

* Codenarc

* Move test resource to where test is

* Spotless
2020-11-23 15:42:04 +02:00
Trask Stalnaker 308a8f9b0f
Consistent equals implementations (#1736)
* Consistent equals implementations

* Use direct equals where previous behavior
2020-11-23 15:41:31 +02:00
John Watson e9821e9cd1
Directly port the java-runtime-metrics module over from otel-java. (#1720)
* Directly port the java-runtime-metrics module over from otel-java.

* java 8 cleanups

* Make consistent with oshi module

* Bump mockito and assertj versions

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-11-21 10:51:03 -08:00
Trask Stalnaker 6d5ec329d6
Enable checkstyle for google style guide (#1641) 2020-11-16 18:46:59 -08:00
Trask Stalnaker 7ecc9bb37b
Rename "auto" to "javaagent" in modules (#1370) 2020-10-13 12:32:13 -07:00
Trask Stalnaker 1b51d4a6b1
Rename packages (#1367) 2020-10-11 13:54:35 -07:00
Anuraag Agrawal dadaac9a8c
Use 2-line license header to match SDK repo (#1321)
* Use 2-line license header to match SDK repo

* Apply change
2020-10-05 14:29:56 +09:00
Anuraag Agrawal 210c669643
Remove AgentSpecification (#1291) 2020-09-30 17:34:29 +09:00
Anuraag Agrawal a9f0e21bfe
Support injecting resources into classloader and use it in aws-sdk-2.… (#1172)
* Support injecting resources into classloader and use it in aws-sdk-2.2 instrumentation.

* Use URL for duplication check instead of reading content and inject URLs directly instead of reading to byte array first.

* Remove getResource
2020-09-15 17:38:20 +09:00
Anuraag Agrawal 266b8b927d
Split out artifact for javaagent SPI. (#1187)
* Split out artifact for javaagent SPI.

* Fix test - exporters are loaded by test and should not be on the classpath

* Fix
2020-09-11 07:09:04 +03:00
Anuraag Agrawal 16b7f5b345
Move AgentClassLoader out of public API. (#1182)
* Move AgentClassLoader out of public API.

* Move tests too

* Keep auto-api on bootstrap classpath.
2020-09-10 14:56:20 +09:00
Anuraag Agrawal 5289520203
Fix groups / base name for javaagent artifacts (#1173) 2020-09-09 09:38:29 +03:00
Trask Stalnaker ac5f041fb9
Rename javaagent-bootstrap's Agent class to AgentInitializer (#1018)
* Rename bootstrap Agent class

* Rename start method to initialize
2020-08-16 22:05:02 +03:00
Trask Stalnaker 414213f2d1
Remove final from parameters (#1003) 2020-08-15 22:35:51 -07:00
Trask Stalnaker f893ca540b
Scripted package renaming (#988) 2020-08-15 21:55:01 -07:00
Trask Stalnaker f46ba88c29
Rename library-api artifact to instrumentation-api (#969) 2020-08-13 22:43:39 -07:00
Trask Stalnaker a0dc9ba19c
Rename Pre-Main class (#955) 2020-08-13 10:58:33 -07:00
Trask Stalnaker bf9c160570
Rename javaagent modules (#952) 2020-08-12 22:50:14 -07:00