Commit Graph

358 Commits

Author SHA1 Message Date
Mateusz Rzeszutek 2e97a4d3d5
Netty: preserve caught exception in the context instead of calling end() (#4413) 2021-10-19 13:40:11 -07:00
Martin 62c90512cd
switch annotation `org.checkerframework.checker.nullness.qual.Nullable` to `javax.annotation.Nullable` (#4418) 2021-10-19 10:59:18 +03:00
Martin 6d9e3618d3
rename `newBuilder()` to `builder()` (#4407)
* rename `newBuilder()` to `builder()`

* code format
2021-10-18 10:00:49 -07:00
Mateusz Rzeszutek 22ea557c41
Migrate Ratpack javaagent instrumentation to Instrumenter API (#4399) 2021-10-18 10:00:40 -07:00
Mateusz Rzeszutek 888496413d
Migrate netty-3.8 client instrumentation (except CONNECT) to Instrume… (#4396)
* Migrate netty-3.8 client instrumentation (except CONNECT) to Instrumenter API

* spotless
2021-10-18 18:32:04 +02: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 ac479d4b34
Migrate Netty 4.x client instrumentations (except CONNECT) to Instrum… (#4381)
* Migrate Netty 4.x client instrumentations (except CONNECT) to Instrumenter API

* Revert testReadTimeout changes
2021-10-15 17:06:02 -07:00
Mateusz Rzeszutek 2904578875
Test HTTP headers capturing on Netty-based server frameworks (#4395)
* Test HTTP headers capturing on Netty-based server frameworks

* fix vertx circuit breaker tests

* fix play async tests
2021-10-15 12:30:24 -07:00
Mateusz Rzeszutek 0825da7ae4
Migrate netty-3.8 server instrumentation to Instrumenter API (#4368) 2021-10-14 08:59:04 -07:00
Mateusz Rzeszutek 25bfb49b80
Migrate Netty 4.x server instrumentations to Instrumenter API (#4342)
* Migrate Netty 4.x server instrumentations to Instrumenter API

* fix vertx tests

* codenarc

* code review comments

* fix broken assertion

* Update instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/common/server/NettyServerInstrumenterFactory.java

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
2021-10-13 15:32:24 +02:00
Mateusz Rzeszutek 4031f9611a
Remove almost all VirtualField#computeIfNull() usages (#4313) 2021-10-11 23:16:01 -07:00
Mateusz Rzeszutek 354699647a
Test captured HTTP headers - HTTP server tests, part 2 (#4328)
* Test captured HTTP headers - HTTP server tests, part 2

* Turn off captured HTTP headers testing for grizzly

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-08 13:05:35 -07:00
Trask Stalnaker dafc97f96e
Simplify gradle files (#4292) 2021-10-04 21:53:35 -07:00
Trask Stalnaker 92394ad9ae
Remove url from HttpServerAttributesExtractor (#4209)
* Remove url from HttpServerAttributesExtractor

* Remove UriBuilder

* Tracers too

* apache-camel

* Finatra

* jsp

* Ratpack

* Ratpack library

* Ratpack

* Spark

* Feedback

* Fix Undertow

* Vertx

* vertx-web

* play-2.4

* webflux

* jaxrs

* Spotless

* Update semantic-conventions.md

* Update smoke tests

* More realistic target

* Remove outdated doc

* Wording
2021-10-03 09:17:23 -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
YuDong Tang 3bc0e07c60
#4056 remove oringin handler when removelast in netty (#4123)
* removelast

* removelast

* addAfter and removeLast

* addAfter and removeLast

* addAfter and removeLast
2021-09-17 13:23:20 -07:00
Mateusz Rzeszutek dc4ddf7932
Remove ContextStore.Factory interface; use Supplier instead (#4157) 2021-09-17 13:00:23 -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
Mateusz Rzeszutek 23fc4ce443
Fix memleak in the Netty ChannelPipeline instrumentation (#4053) 2021-09-07 14:16:08 -07:00
Trask Stalnaker 58d640a373
Fix netty strict context checks (#4002)
* Fix netty strict context leaks

* And netty-4.0

* ClassValue and more
2021-08-30 09:02:16 -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
Mateusz Rzeszutek 5c71d28ed7
Remove deprecated Config methods (#3908) 2021-08-23 16:44:54 -07:00
Trask Stalnaker 1889c1adfb
Limit netty exception capture to netty spans (#3809)
* Limit Netty exception capture to Netty span

* Rename constant

* Fix var name

* Apply to netty-4.0 also
2021-08-10 20:58:37 -07:00
Lauri Tulmin accf603920
Remove unused field (#3810) 2021-08-10 12:10:57 -07:00
Lauri Tulmin 77dc1ecf27
Fix warning in build scripts (#3739) 2021-08-02 19:37:35 +03:00
Lauri Tulmin a04a7a6b72
Add option to create span on new netty connection (#3707)
* Create span on new netty connection

* add test for connection failure

* add comment

* remove commented out line

* rebase

* test fix

* review comments

* keep connection failure span as client span
2021-07-30 11:32:53 +03:00
Anuraag Agrawal 47be4a16b4
Convert HttpClientTest to JUnit (#3652)
* Migrate HttpClientTest to junit to allow both Java or spock tests.

* More

* Update

* Finish

* Cleanup

* Better stack

* Java 15

* Merge

* Fix name

* Cleanup

* ? extends

* Moar
2021-07-27 21:55:40 +09:00
Lauri Tulmin 4db7bd5ff3
Move common code from netty 4.0 and 4.1 http client to common superclass (#3660) 2021-07-26 11:15:13 +09:00
Lauri Tulmin 1b5df6d78a
Netty connection failure handling (#3569)
* Netty connection failure handling

* Update instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/common/client/AbstractNettyHttpClientTracer.java

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

* Remove unused import

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-07-23 11:21:15 +03:00
Lauri Tulmin 1197480f6e
Netty4: handle read timeout (#3613)
* Netty4: handle read timeout

* spotless
2021-07-21 21:20:21 +03:00
Anuraag Agrawal f5ce4c03f8
Inline basic usages of basicSpan (#3583)
* Inline basic usages of basicSpan

* spock
2021-07-18 21:15:51 +03:00
Anuraag Agrawal d3b62de8a5
Replace most uses of TraceUtils with testRunner runWithSpan. (#3582) 2021-07-15 10:30:34 -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
Mateusz Rzeszutek c5ba5c3a71
Use local variable for passing CallDepth between advice enter/exit me… (#3504)
* Use local variable for passing CallDepth between advice enter/exit methods

* fix broken call depth tracking

* checkstyle

* fix javadocs
2021-07-06 12:05:14 -07:00
Mateusz Rzeszutek b9fcb6b498
Reduce CallDepth classes' API surface (#3497) 2021-07-06 09:24:19 +02:00
Mateusz Rzeszutek 15ed01d4fc
Change all instrumentation names to io.opentelemetry.{libName}-{libVersion} (#3411)
* Change all instrumentation names to io.opentelemetry.{libName}-{libVersion}

* minumum supported version
2021-06-30 15:34:36 +02:00
Anuraag Agrawal 761b9c280b
Migrate instrumentation gradle files to kotlin (#3414)
* Migrate instrumentation gradle files to kotlin

* Convert

* Muzzle
2021-06-28 17:27:12 +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
Trask Stalnaker bcb282a220
Conform to google style guide checkstyle (#3399) 2021-06-24 10:53:23 +03: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 80f43b7a6a
Migrate javaagent-instrumentation to plugin (#3328)
* Migrate instrumentation.gradle to plugin

* Migrate usages

* Remove old

* Fix

* Revert example

* afterEvaluate

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-06-17 23:13:14 +09:00
Anuraag Agrawal b7bfbf0cc6
Migrate instrumentation-library / common to plugins (#3320) 2021-06-15 11:54:48 -07: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
Trask Stalnaker 4c80c62ce7
Add unused to remaining advice classes (#3280)
* Add unused to remaining advice classes

* Add newlines for visual separation
2021-06-14 11:12:02 +09:00
Trask Stalnaker 80a7403763
Remove insecure trust manager from test (#3268) 2021-06-12 12:03:46 +03:00
Lauri Tulmin de7eaa0fe6
Enable https tests (#3258) 2021-06-11 17:16:34 -07:00
Anuraag Agrawal 60aaff8972
Migrate HttpServerTest to Armeria (#3240)
* Migrate HttpServerTest to Armeria

* Update testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-06-11 08:56:02 +09:00
Lauri Tulmin e93ff4d419
Remove references to dropped request test (#3238) 2021-06-10 16:21:11 +03:00
Lauri Tulmin f51bace1eb
Netty connection failure span only when first operation fails (#3228) 2021-06-09 17:24:02 +09:00
Anuraag Agrawal 7ae23fc694
Migrate HttpClientTest test server to Armeria (#3225)
* Use Armeria for test HTTP server.

* Continue

* Migrate test http server to Armeria.

* Finish

* Use junit extension

* Remove unused.

* Use localhost for net peer name.

* Block for full response in recator-netty tests.

* Handle split responses in netty41 and akka

* Typo
2021-06-09 15:05:58 +09:00
Trask Stalnaker cefaecab3f
Use more efficient namedOneOf where possible (#3200)
* Use more efficient namedOneOf where possible

* Fix - hasClassesNamed does and not or
2021-06-07 11:41:34 +09:00
Trask Stalnaker de2bdb80b4
Fix netty muzzle (#3191) 2021-06-04 11:00: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
Anuraag Agrawal 0ad8c1b8ce
Manage Netty transitive dependencies (#3165)
* Manage transitive Netty versions.

* Finish

* .each to not apply resolutions to muzzle

* Exclude epoll from finatra muzzle
2021-06-03 13:12:32 +09:00
Mateusz Rzeszutek e1762677da
Refactor HttpClientTest (#3159)
* Remove unused extraClientSpans() method
* Merge extraAttributes() and hasClientSpanHttpAttributes(uri) into
httpAttributes(uri): this will allow to choose extracted attributes
per URI (for example, OkHttp won't set flavor on connection exception
once it's rewritten to Instrumenter)
2021-06-03 10:54:01 +09:00
Anuraag Agrawal 53cfd73bb3
Enable excluding muzzle dependencies and exclude netty-tcnative (#3169)
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-06-02 09:42:56 -04: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
Lauri Tulmin e16cf3001f
Add attributes to netty connection failure span (#3115) 2021-05-28 15:01:10 -07:00
Lauri Tulmin 79e42ad665
Remove unused plugin (#3107) 2021-05-27 09:38:58 -07:00
Ago Allikmaa df078f95a9
Extract HttpServerTest INDEXED_CHILD span attribute collection logic (#3095)
* Extrawct HttpServerTest INDEXED_CHILD span attribute collection logic

* Adjust whitespace

* Fix context issue with JAX-RS

* Rerun tests
2021-05-27 11:18:11 +03:00
Lauri Tulmin 313f8e1fb8
Fix memory leak on netty (#3059) 2021-05-24 20:32:19 -07:00
Lauri Tulmin 119697b131
Share some code between netty 4.0 and 4.1 instrumentation (#3048) 2021-05-20 14:32:37 -07:00
Trask Stalnaker b436611217
Exclude failing netty dep from netty-3.8 also (#3045) 2021-05-20 14:30:04 -07:00
Lauri Tulmin 23a40d926c
Netty4.1: remove our handler when original handler is removed (#3026)
* Netty4.1: remove our handler when orignal handler is removed

* Update instrumentation/netty/netty-4.1/javaagent/src/test/groovy/ChannelPipelineTest.groovy

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

* disable epoll to see whether it makes any difference

* fix netty with epoll/kqueue native library

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-05-19 10:01:56 -07:00
Lauri Tulmin 87bc1c69dc
Exclude failing netty version from muzzle (#3038) 2021-05-19 09:53:09 -07:00
Trask Stalnaker d1946f6774
Don't use type annotation style (#3023) 2021-05-18 10:23:09 -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
Lauri Tulmin b4b102dbec
Enable http client connection failure tests (#2998) 2021-05-17 12:15:48 -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
Trask Stalnaker cd3dd581f9
Fix some remote connection tests (#2933) 2021-05-10 12:19:39 +09:00
Trask Stalnaker 1dda1e2659
Clean up old references to continuation concept (#2934) 2021-05-09 19:29:37 +03:00
Mateusz Rzeszutek 9c7fae3b04
Extract javaagent-extension-api from tooling & spi (#2879) 2021-05-06 23:30:25 -07:00
Mateusz Rzeszutek 56d7fd3516
Expose correct Context.current() in reactive-netty callbacks (#2850) 2021-04-29 12:29:36 -07:00
Mateusz Rzeszutek 77f8be8add
Fix netty 4.1 instrumentation not removing future listeners (#2851)
* Fix netty 4.1 instrumentation not removing future listeners

* Code review follow-up

* Use InstrumentationContext
2021-04-27 11:22:52 +03:00
Trask Stalnaker 8ded533f52
Add another missing Unroll annotation (#2829) 2021-04-20 12:40:37 -07:00
Lauri Tulmin 9464134ffd
Test failing async http request (#2812) 2021-04-19 14:11:27 -07:00
Trask Stalnaker bd829a6494
Remove duplicate status verification (#2710) 2021-04-19 11:41:37 -07:00
Mateusz Rzeszutek 078603caf5
Generate InstrumentationModule#contextStore() with muzzle (#2775) 2021-04-13 20:05:01 -07:00
Trask Stalnaker b922b3ece9
Remove the netty connection interference test (#2765) 2021-04-12 13:55:00 -07:00
Trask Stalnaker 3bc058b10b
Don't create duplicate headers (#2727)
* Test infra

* Update examples

* Update instrumentation

* Update tests

* jaxrs-client fixes

* Remove doRequest/doReusedRequest

* Fix muzzle

* some fixes

* fix test

* doc

* not private

* Apply to doRequestWithCallback also

* Update doc

* groovy

* better

* Don't hardcode traceparent

* Reuse request in SpringRestTemplateTest
2021-04-12 12:21:16 +03:00
Nikita Salnikov-Tarnovski 692bb72f22
Implement concurrent test for Netty http server (#2750) 2021-04-08 08:36:42 +03:00
Anuraag Agrawal d8f6018ba6
Split HttpClientTest execution methods for sync and callback (#2675) 2021-04-06 15:26:01 -07:00
Trask Stalnaker 6ea316e22e
Remove timeout annotations (#2725) 2021-04-06 16:36:18 +09:00
Trask Stalnaker 25dd2cf194
Verify span kind in all tests (#2715) 2021-04-05 12:57:48 -07:00
Trask Stalnaker f02b0f8d74
Fix suppressed NPE in netty instrumentation (#2649) 2021-03-29 14:44:49 -07:00
Anuraag Agrawal c3c5e6b2a6
Finish Netty 4.1 spans after response has completed not when it started. (#2641)
* Finish Netty 4.1 spans after response has completed not when it started.

* copy pasta bada

* Update instrumentation/netty/netty-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/client/HttpClientResponseTracingHandler.java

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

* Update instrumentation/netty/netty-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/server/HttpServerResponseTracingHandler.java

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

* Update instrumentation/netty/netty-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/server/HttpServerResponseTracingHandler.java

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-03-27 13:32:01 +09:00
Nikita Salnikov-Tarnovski 5a9b0b999f
Test of single connection reuse for Netty (#2630)
* Test of single connection reuse for Netty

* Format
2021-03-26 16:21:46 +02:00
Trask Stalnaker 0ce9ca57d9
Move attributes to span builder for use by samplers (#2587)
* Move attributes to span builder for sampler use

* Fix test

* Remove unnecessary test
2021-03-17 15:02:56 +02:00
Mateusz Rzeszutek ae23b97ec4
Move and rename NetPeerUtils (#2548)
* Move and rename NetPeerUtils

* Rename NetPeerUtils to NetPeerAttributes; inject instance instead of using a global var
* Rename SpanAttributeSetter to AttributeSetter (might be used to set on AttributesBuilder in the future, who knows)
* Deprecate default BaseTracer constructor: library instrumentations are supposed to inject all dependencies, the javaagent should explicitly pass globals

* fix compilation failure

* Remove peer.service customization from library instrumentation
2021-03-16 13:50:19 +01:00
Anuraag Agrawal 4a4482c025
Use ClassValue instead of ClassLoader -> Class weakmap since it should be same thing. (#2559) 2021-03-11 11:38:32 -08:00
Mateusz Rzeszutek fe4d95a689
Refactor BaseTracer#onError() method (and unwrapThrowable()) (#2513)
* Refactor BaseTracer#onError() method (and unwrapThrowable())

Also remove the deprecated BaseTracer(Tracer) constructor.

* Update BaseTracer javadoc

* fix tests

* Code review comments
2021-03-08 15:08:26 +02:00
Mateusz Rzeszutek 72ffb3b7c5
Make BaseTracer fields private (#2492)
* Make BaseTracer fields private

By making `tracer` private we're forcing all tracer implementation to use the `spanBuilder()` utility method and pass the parent context manually.
2021-03-05 10:54:00 -08:00
Mateusz Rzeszutek c18acb858e
Add BaseTracer#inject() method (#2453)
* Add BaseTracer#inject() method

And avoid using GlobalOpenTelemetry#getPropagators()

* Code review comments
2021-03-02 15:30:04 +01:00
Trask Stalnaker 62f2611486
Update instrumentation names (#2433) 2021-03-01 19:34:25 -08:00
Mateusz Rzeszutek 68cde08177
Fix netty 4.1 test after adding @Unroll on the base class (#2412) 2021-02-25 15:01:55 +01:00
Nikita Salnikov-Tarnovski eaa8604e96
Better context passing for Netty 4.1 (#2361)
* Better context passing for Netty 4.1

* Format

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/context/ContextPropagationDebug.java

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

* Return test

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-02-23 10:26:41 +02:00
Nikita Salnikov-Tarnovski 573e512eda
Reworking context propagation for Netty 4.0 (#2323)
* Reworking context propagation for Netty 4.0

* Spotless
2021-02-22 22:10:01 +02:00
Nikita Salnikov-Tarnovski 2497a03523
Fix nightly build (#2368) 2021-02-22 17:52:28 +09:00
neinoi 1f884e4d97
Fix Operation name logging for Netty based applications (#2317) 2021-02-19 09:59:50 -08:00
Anuraag Agrawal 000df967ce
Update to SDK 0.17.0 (#2338)
* Update to SDK 0.17.0

* Finish

* ottrace
2021-02-19 15:51:55 +09:00
Mateusz Rzeszutek ee090aee1e
Support library instrumentations with HttpServerTest & HttpClientTest (#2299) 2021-02-16 09:05:23 -08:00
Mateusz Rzeszutek 0fbdcad1dd
Make BaseTracer#startSpan() return Context (#2232)
* Make BaseTracer#startSpan() return Context

* Update instrumentation/apache-camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/CamelEventNotifier.java

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

* spotless

* Add Javadocs to BaseTracer

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-02-12 12:12:40 +01:00
Trask Stalnaker 66fe53b028
Remove deps from javaagent (#2251)
* Remove deps from javaagent

* Also

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-02-12 17:19:47 +09:00
Anuraag Agrawal fc410706d0
Update to Sdk 0.16.0 (#2221)
* Update to 0.16.0-SNAPSHOT

* Finish

* Finish

* Update to 0.16.0

* Finish
2021-02-09 18:00:54 +09:00
Nikita Salnikov-Tarnovski e9a4b952dd
Add causality test with multiple concurrent requests (#2156)
* Add causality test with multiple concurrent requests

* Include support for Reactor Netty 1.0 into README.md

* Fix muzzle conf

* Fix muzzle and version constraints

* More strict causality check

* Better muzzle config

* Fixing muzzle

* Fixing deps

* Better library

* Better naming
2021-02-05 12:39:42 +02:00
Lauri Tulmin 8d6ee17c05
Fix netty 4.1 tests (#2122) 2021-01-26 10:11:06 -08:00
Anuraag Agrawal 8b470bf378
Add Netty instrumentation handlers after matched handler rather than at end of pipeline. (#2100)
* Support latest webflux version.

* Add Netty instrumentation handlers after matched handler rather than at end of pipeline.

* Drift

* Fix

* Raise smoke tests timeout
2021-01-25 16:06:57 +09:00
Anuraag Agrawal 2eee121931
Match classloader when applying netty instrumentation. (#2099) 2021-01-22 12:05:20 +02:00
Lauri Tulmin 7c3b183294
Move netty4.1 exception handling to an other method (#2070) 2021-01-18 22:14:49 -08: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 2a4e07dce1
Netty: add exception to span (#2027) 2021-01-14 09:36:14 -08:00
Pavol Loffay 1070996653
Make factory method for netty 4.0 attribute keys public (#1995)
* Make factory method for netty 4.0 attribute keys public

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

* Add comment

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
2021-01-14 11:44:51 +01:00
Pavol Loffay 077d8b64f6
Move common matchers to tooling/bytebuddy/matcher and ignore matchers to tooling/matcher (#1965) 2021-01-10 12:35:53 -08:00
Trask Stalnaker deda1af9c0
HTTP client instrumentation cleanup: netty (#1909) 2020-12-15 09:00:31 +02:00
Anuraag Agrawal c5a257619a
Make sure AWS SDK spans suppress client spans all the time. (#1837)
* Make sure AWS SDK spans suppress client spans all the time.

* Make more consistent with other instrumentation

* Update instrumentation/netty/netty-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/client/NettyHttpClientTracer.java

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

* more dragons

* Grammar

* README

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-12-07 17:10:43 +09:00
Trask Stalnaker 65f54e450b
Use Context more in HttpClientTracer (#1811)
* Use Context more in HttpClientTracer

* Better http-url-connection response object

* Follow database semantic conv for elasticsearch-rest

* Remove unnecessary CallDepth tracking
2020-12-03 11:47:08 -08:00
Trask Stalnaker a2770c311e
Don't use ConfigUtils outside of AgentTestRunner tests (#1796)
* NetPeerUtilsTest

* RedisCommandNormalizerTest

* InstrumentationModuleTest

* HttpClientTracerTest

* Normalize test config properties

* Create ConfigBuilder in instrumentation-api

* Keep config properties compatible with SDK
2020-12-01 16:52:08 -08:00
Trask Stalnaker 0bd85d7b7f
Pass around context more instead of span (HttpServerTracer) (#1810) 2020-12-01 14:49:01 -08:00
Trask Stalnaker 26f254b10d
Create javaagent dirs for all instrumentations, part 2 (#1794) 2020-11-28 22:26:49 -08:00
Trask Stalnaker 5f263644da
Create javaagent dirs for all instrumentations (#1668)
* Create javaagent dirs for all instrumentation

* Add note about kotlin coroutine library instrumentation

* Feedback
2020-11-28 21:04:16 -08:00
Mateusz Rzeszutek 9a64a628ea
Make instrumentations non final (#1752)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-11-26 11:22:25 -08:00
Trask Stalnaker 7a6613ca6c
Simplify netty-4.1 AttributeKeys (#1757)
* Simplify netty-4.1 AttributeKeys

* Suggestions

* Shorten names

* Make same naming changes for netty-4.0

* Update instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_0/AttributeKeys.java

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

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2020-11-26 11:49:52 +09:00
Mateusz Rzeszutek 50c8ab499d
Remove no longer needed helperClassNames() methods (#1755) 2020-11-24 20:50:32 -08:00
Trask Stalnaker a5a36bd203
Use namespace for attributes put into user classes (#1739)
* Use namespace for attributes put into user classes

* Add dependency to remove duplication
2020-11-24 12:07:10 -08:00
Mateusz Rzeszutek 45646ff367
Rename TypeInstrumentation#classLoaderMatcher() to classLoaderOptimization() (#1741)
* Rename TypeInstrumentation#classLoaderMatcher() to classLoaderOptimization()

* Removed no longer needed comments & improved JavaDoc

* Improve TypeInstrumentation Javadoc
2020-11-24 14:27:58 +02:00
Trask Stalnaker d2f064dcd4
Add static keyword to make groovy inner classes nested (#1734)
* Add static keyword to make groovy inner classes nested

* Too much

* A bit less

* Spotless
2020-11-23 15:43:42 +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
Trask Stalnaker d183692699
Enable checkstyle type var naming rule (#1666) 2020-11-19 11:00:31 -08:00
Trask Stalnaker cecdfc2cd0
Update instrumentation names to be consistent (#1671)
* Update instrumentation names to be consistent

* Remove amqp from rabbitmq package name
2020-11-18 19:53:31 -08:00
Mateusz Rzeszutek cea28356c6
Remove some no longer needed muzzleCheck() methods (#1660)
* Remove some no longer needed muzzleCheck() methods

And add muzzle references to log4j 2.13.2 instrumentation
2020-11-17 14:40:33 -08:00
Nikita Salnikov-Tarnovski f0a4049b52
Add support for Reactor Netty's HttpClient (#1601)
* Add support for Reactor Netty's HttpClient

* Format

* Update instrumentation/reactor-netty-0.9/src/main/java/io/opentelemetry/javaagent/instrumentation/reactor_netty/ReactorHttpClientInstrumentation.java

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

* Convert to InstrumentationModule

* Cleanup

* Rename module

* Polish

* Format

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2020-11-16 12:07:51 +02:00
Nikita Salnikov-Tarnovski 76f6b8aa49
Netty bug (#1604)
* Netty connection span leak

* Demonstrating Netty bug

* Format
2020-11-10 14:44:27 +02:00
Trask Stalnaker 087a9cbc4e
Fix dropwizard instrumentation (#1607)
* Fix dropwizard instrumentation

* Fix others too
2020-11-09 18:46:26 -08:00
Mateusz Rzeszutek 7f36dd1617
Refactor Instrumenters into InstrumentationModules - N, O, P (#1575) 2020-11-09 14:42:16 -08:00
Anuraag Agrawal 3d21c26632
Update to SDK 0.10.0 (#1564) 2020-11-05 13:17:47 -08:00
Anuraag Agrawal d3b60a5e33
Rename TRACER to tracer() (#1540) 2020-11-02 20:49:51 -08:00
Anuraag Agrawal c6eee70660
Update to latest snapshot. (#1524) 2020-10-29 18:54:09 -07:00
Anuraag Agrawal dfda406fee
Migrates to using a context when span is started (#1525)
* Return Context when starting span to preserve baggage.

Co-authored-by: Marcin Grzejszczak <marcin.grzejszczak@gmail.com>

* Use bridge

Co-authored-by: Marcin Grzejszczak <marcin.grzejszczak@gmail.com>
2020-10-29 13:50:54 +02:00
Nikita Salnikov-Tarnovski 54a85f7501
More test fixes (#1495) 2020-10-27 16:56:39 +02:00
Trask Stalnaker 7244dbf188
Remove unnecessary overrides (#1477) 2020-10-25 21:46:14 -07:00
Trask Stalnaker 3565775b00
Format groovy (#1475)
* Apply Intellij format to groovy

* spotless
2020-10-26 11:47:12 +09:00
Anuraag Agrawal f6ad05b8e3
Update to latest SDK snapshot (#1384)
* Update to latest SDK snapshot

* Use published snapshot

* Fixes

* Cleans

* spotless

* Most

* Clean

* Merge

* Temporarily remove context interop

* WIP

* Prepare for intercepting propagated span

* Bump SDK

* IDE updates

* Lots

* compileJava

* Done?

* bar

* Spot

* drugs

* Groovy--

* green for me

* Spot

* Remove grpc import

* Scrub
2020-10-25 15:14:32 +09:00
Vadim Shaigorodskiy 9e8d663ba4
Remove apache httpclient version (#1446)
* Remove version from `apache-httpclient` instrumentation

Fixes: #1260

* Remove version from all instrumentation names and add instrumentation name to `spring-web`

Fixes: #1260
2020-10-22 14:22:44 +09:00
Trask Stalnaker c739f7db6b
Remove unnecessary scopes (#1351) 2020-10-11 14:31:37 -07:00
Trask Stalnaker 1b51d4a6b1
Rename packages (#1367) 2020-10-11 13:54:35 -07:00
John Bley b34fd49682
Instrument Netty addTask to ensure complete coverage of async Runnables (#1348)
Newer versions of Netty introduce variants like execute(Runnable, boolean) which
aren't covered by the core execute(Runnable) instrumentation.  Fortunately they all
flow through to addTask(Runnable), which allows us to carry the context through properly.
2020-10-09 11:43:33 -07:00
Trask Stalnaker 9605789726
Propagate full context (#1350)
* Propagate full context

* spotless
2020-10-09 12:58:42 +03:00
Ioannis Mavroukakis f2de47a150
SpanAssert method names should reflect underlying Span method names (#1307) 2020-10-05 16:04:08 +09: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
Nikita Salnikov-Tarnovski e74ffe2e52
Remove support for java7 from buildscripts (#1229)
* Remove support for java7 from buildscripts

* Remove support for java7 from buildscripts
2020-09-23 15:40:21 +03:00
Nikita Salnikov-Tarnovski beb1901f5f
Review semantic convention for Http Client spans (#1214)
* Review semantic convention for Http Client spans

* Polish

* Update instrumentation/google-http-client-1.19/src/test/groovy/AbstractGoogleHttpClientTest.groovy

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-09-18 17:52:08 +03:00
Jakub Wach e8b54885c4
Enhance AWS DynamoDB instrumentation (#1191) 2020-09-18 10:48:56 +03:00
Nikita Salnikov-Tarnovski 7e41b516ee
Review semantic convention for Http Server spans (#1207)
* Review semantic convention for Http Server spans

* Polish
2020-09-16 09:52:11 +03:00
Nikita Salnikov-Tarnovski fd07525744
Reactor bugs (#1189)
* Demonstrating bugs with Project Reactor and Reactor Netty support

* Intermediate kinda working state

* Seems to work

* Format

* Always use context active during subscription

* Fix muzzle

* Format

* Test fix

* Ignore failing test for now

* Add attribution and links to borrowed code

* Fix hook reset

* Polish

* Revert "Ignore failing test for now"

This reverts commit 1867995a

* Polish

* Fixes #1103
2020-09-15 09:57:03 +09:00
Nikita Salnikov-Tarnovski bc98955176
Update to latest otel-java snapshot (#1057)
* Update to latest otel-java snapshot

* Upgrade to working otel-java snapshot

* Update to latest otel-java snapshot

* Update to latest otel-java snapshot
2020-08-26 22:03:28 +03:00
Helen Y c4c4558b09
More refactoring (#1040) 2020-08-19 15:43:48 -07:00
Trask Stalnaker 5d2ae07797
Use startScope() on all HttpClientTracers (#971) 2020-08-18 16:59:30 -07:00
Anuraag Agrawal bbfdbb39c0
Create abstraction for library dependencies for instrumentation. (#977)
* Create abstraction for library dependencies for instrumentation.

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-08-19 08:57:31 +09:00
Trask Stalnaker 5bce79df36
Remove unnecessary getVersion overrides (#1004) 2020-08-16 10:13:35 -07:00
Trask Stalnaker 7159d04b8d
Change groovy import order (#1013)
* Update docs

* Format all groovy code

* Organize imports
2020-08-15 23:19:27 -07: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 4062d1c9b4
Remove maxJavaVersionForTests from netty-4.0 (#1006) 2020-08-15 21:28:25 -07:00
Helen Y bb235a0aa3
Update package name for tracers (#991) 2020-08-14 21:07:18 -07:00
Trask Stalnaker 7818e33178
Package renaming (#970) 2020-08-13 20:14:46 -07:00
Trask Stalnaker 275fab6ea5
Retry all tests (#941) 2020-08-11 00:20:47 -07:00
Trask Stalnaker b5fbf90977
Extract instrumentation api module (#884) 2020-08-09 22:52:33 -07:00
Trask Stalnaker d85cce0f62
Remove annotation instrumentation vertx dependency (#917)
* Remove annotation instrumentation vertx dependency

* Remove annotation testing dependency
2020-08-08 20:36:27 -07:00
Helen Y 1fcb807590
Refactor HttpClient typed Decorators to Tracers (#893)
* initial work

* Change OkHttp decorators to tracers

* Change AkkaHttpClient decorator to tracer

* Change ClientDecorator to GrizzlyClientTracer

* Change NettyClientDecorator to Tracer

* Change netty3.8 client decorator to tracer

* Update netty4.1 client decorator to tracer

* Override startScope in child tracers when applicable

* Change KHttpDecorator to tracer

* Change HttpUrlConnectionDecorator to tracer

* Fix muzzle validation failure for grizzly client

* Fix a ratpack client test failure

* Address feedback

* Update delegate for setPeer

* Remove nested try

* Remove unnecessary null check

* Remove asserts

* Add a comment for overriding startSpan(String spanName)

* Remove an irrelevant comment

* Throw an exception when getSetter is null

* Change onPeerConnection to static

* Change getSetter() to be abstract
2020-08-06 17:14:19 -07:00
Nikita Salnikov-Tarnovski 46dfa263af
Remove HttpServerTestAdvice (#897)
* Remove HttpServerTestAdvice

* Trying to fix
2020-08-06 13:05:55 +03:00
Anuraag Agrawal 2ac65a67d5
Replace Spock retry with Gradle retry. (#908)
* Replace Spock retry with Gradle retry.

* Retry akka for real

* Warning
2020-08-06 17:59:40 +09:00
Trask Stalnaker 303d8f427f
Add response generic parameter to HttpServerTracer (#870) 2020-08-03 12:52:55 -07:00
Frank Spitulski adab0efcd6
feat(tags): http (#827)
flavour, user agent, client ip
2020-07-29 23:57:12 -07:00
Anuraag Agrawal f6594e1a67
Use Span.recordException for logging throwable (#813)
* Use Span.recordException

* Fix tests

* Cleanup

* Update instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy

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

* Spotless (IntelliJ acts weird with groovy files for me :()

* Update for merge

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-07-28 14:44:42 +09:00
Nikita Salnikov-Tarnovski e9215c739f
Temporary workaround for https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/787 (#814) 2020-07-27 20:41:58 +03:00
Nikita Salnikov-Tarnovski 91fde9a915
Update server span (#774)
* Change name on SERVER spans

* Change name on SERVER spans

* Fixes

* Fixes

* Update instrumentation/spring-webmvc-3.1/src/main/java/io/opentelemetry/auto/instrumentation/springwebmvc/DispatcherServletInstrumentation.java

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-07-24 07:46:50 +03:00
Helen Y 86c438b154
Remove final from local variables (#732)
* Remove final from local variables
2020-07-20 13:53:34 +09:00
Alexey Zhokhov f3421e91a0
Remove Lombok (#672)
* Gradle 6.5.1.

* Skip download javadoc and sources automatically in IntelliJ IDEA.

* Added mavenLocal to repositories.

* Removed Lombok usage.

* Removed duplicated idea config.

* Code format.

* Removed useless usage of Objects.requireNonNull.

* Use instanceof to comparing objects.

* Code format.

* Code format.

* Fixes after merge.

* Fixed sneakyThrow exception.

* Code format.
2020-07-18 15:52:55 +03:00
Nikita Salnikov-Tarnovski 9b6b5e621f
Remove http server decorator (#701)
* Ratpack migrated from ServerDecorator

* Finatra migrated from ServerDecorator

* Play 2.3 migrated from ServerDecorator

* Play 2.4 migrated from ServerDecorator

* Play 2.6 migrated from ServerDecorator

* Polish

* Polish

* Organize imports

* Relax muzzle checks

* Ratpack version 1.4 is now supported

* Fix muzzle failures on Play
2020-07-17 20:14:19 +03:00
Nikita Salnikov-Tarnovski 9f1ffbe38c
Remove attribute `span.origin.type` (#712) 2020-07-16 10:00:45 -07:00
Sergei Malafeev b78abac82c
#598 Rename "tags" to "attributes" (#645) 2020-07-07 21:03:41 -07:00
Nikita Salnikov-Tarnovski a62801649f
More fixes for Gradle warnings (#643)
* More gradle deprecation warnings fixed

* More gradle deprecation warnings fixed

* More fixes

* More fixes

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2020-07-07 15:02:07 +03:00
Nikita Salnikov-Tarnovski 3a4470f800
Server spans (#634)
* Milestone 1

* Netty 4.1 done

* Netty 4.0 done

* Netty 3.8 done

* All tests pass

* Test fix

* Last proper server tracers done

* Format fix

* Tests fixed

* Polish

* Polish
2020-07-07 13:48:51 +03:00
Anuraag Agrawal 1aae2bd7f0
Add extension point for HTTP client decorators to return headers gene… (#623)
* Add extension point for HTTP client decorators to return headers generically instead of only user agent.
2020-07-02 14:29:21 +09:00
Nikita Salnikov-Tarnovski 3418ebf6f7
More module renames (#610) 2020-06-29 13:28:39 -07:00
Nikita Salnikov-Tarnovski fc2d679259
Propagate context (#572)
* First cut on propagating full Context instead of just Span

* First cut on propagating full Context instead of just Span

* Polish

* Polish

* Format
2020-06-26 08:18:14 +03:00
Anuraag Agrawal 874b157fe5
Newline between license and package. (#581) 2020-06-25 13:31:16 -07:00
Anuraag Agrawal 918d3913e3
Populate user-agent in HTTP clients. (#540) 2020-06-22 21:13:12 -07:00
Tyler Benson 1b29184e7c Make rootDir usage consistent (DataDog/dd-trace-java#1518) 2020-06-11 10:14:02 -07:00
Brian Devins-Suresh 6727764123 Netty 3.8 had the wrong version in the config property (DataDog/dd-trace-java#1423) 2020-05-14 11:50:30 -07:00
Nikolay Martynov c63b4fd9a3 Add scopes to http server response (DataDog/dd-trace-java#1408) 2020-05-14 11:49:44 -07:00
Trask Stalnaker 1f0cd54fd7
Remove copyright year from license header (#322)
* Update template

* Apply template
2020-04-15 11:24:44 -07:00
Trask Stalnaker a333cfe536
Remove unused getComponentName (#314) 2020-04-14 13:29:33 -07:00
Trask Stalnaker bf5b009ef8
Remove unused code (#319)
* Remove unused/deprecated code

* Remove unused code

* Remove unused return value

* Remove unnecessary throws clauses

* Remove unused code

* Remove default attribute value

* Remove unused code

* Remove unused code

* Remove unused code

* Remove unused constants

* Remove unused constant

* Remove unused parameter

* Remove unused PostMatchHook

* Remove unused constants
2020-04-14 12:29:24 -07:00
Trask Stalnaker d24159c8d2 Merge tag 'v0.48.0' into dd-merge 2020-04-12 15:20:10 -07:00
Trask Stalnaker c545ffa3c2 Merge tag 'v0.47.0' into dd-merge 2020-04-06 13:26:15 -07:00
Trask Stalnaker 4fe685d916
Remove component attribute (#291) 2020-03-29 20:32:19 -07:00
Trask Stalnaker 2e210683fd
Update to OpenTelemetry API/SDK 0.3.0 (#286)
* Update gradle dependencies and module name

* Replace Tracer.withSpan() with currentContextWith()

* Update inject to 0.3.0

* Update extract to 0.3.0

* More updates

* Remove distributedcontext package refs

* Update OpenTelemetry API interoperability

* No need to call setNoParent()

setParent(SpanContext.getInvalid()) should give the same result.
2020-03-28 19:38:51 -07:00
Trask Stalnaker 8fa84cb77b
Remove remaining resource.name attributes (#278)
* Remove resource.name validation from ignored tests

* Remove resource.name from test spans

* Remove unused parameter

* Change servlet dispatcher attribute name
2020-03-23 09:51:57 -07:00