Commit Graph

363 Commits

Author SHA1 Message Date
Anuraag Agrawal 528360db8c
Update dependencies (#6007)
* Update dependencies

* Add maven to plugin repos

* Fix tests that fail with groovy 4.0.2 (#42)

Co-authored-by: Lauri Tulmin <tulmin@gmail.com>
2022-05-17 14:12:36 -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 87b412fb40
Instrumentation API changes: OperationMetrics, OperationListener (#6016)
* Instrumentation API changes: OperationMetrics, OperationListener

* errorprone
2022-05-12 11:16:46 -07:00
Trask Stalnaker 45d0518d69
Update netty 4 common package name (#5991) 2022-05-07 20:55:37 -07:00
Trask Stalnaker cfe4a22307
Remove netty-4.1-common (#5985)
* Remove netty-4.1-common

* reactor-netty-1.0
2022-05-06 11:51:02 -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
Lauri Tulmin ceeaa1b660
Avoid npe in netty 4.1 instrumentation (#5902) 2022-04-21 09:28:22 -07:00
Mateusz Rzeszutek 4e3f19d469
Enable span suppression by SpanKey by default (#5779)
* Enable span suppression by SpanKey by default

* fix HTTP tests (probably)

* add exception for camel

* remove suppression tests from @WithSpan instrumentations

* remove suppression tests from @WithSpan instrumentation; spring boot autoconfigure

* fix twilio tests

* fix netty-based HTTP clients, remove AWS SDK 1.11 unit test

* fix elasticsearch tests

* codenarc

* spotless

* fix AWS SDK 1.11 tests

* remove a TODO

* code review comments

* fix merge conflict

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-04-19 14:13:09 -07:00
Mateusz Rzeszutek e9fbb367b3
Rename netty `always-create-connect-span` property to `connection-tel… (#5834)
* Rename netty `always-create-connect-span` property to `connection-telemetry`

* formatting

* warn when deprecated property is used

* errorprone
2022-04-15 13:38:04 +02:00
Lauri Tulmin 5267462b06
Fix http concurrency test with large responses (#5648)
* Debug http client concurrency test failures

* debugging

* context porpagation to callbacks isn't really implemented

* verify that request succeeds in single connection concurrency test

* spotless

* verify request status in http client concurrency test

* update comment

* remove large response

* Trigger Build

* Update instrumentation/netty/netty-3.8/javaagent/src/test/groovy/Netty38ClientTest.groovy

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-03-25 10:03:22 -07:00
Anuraag Agrawal 213057d057
Run check during testing and assemble during building (#5619) 2022-03-18 13:48:51 +09:00
Trask Stalnaker 174f6129b5
Update netty attribute name (#5568) 2022-03-14 11:08:02 +02:00
Lauri Tulmin b3496381f1
Write http server tests in java (#5501)
* Write http server tests in java

* typo

* Apply suggestions from code review

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

* add comments

* address review comments

* use Predicate

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-03-08 14:21:59 -08:00
Lauri Tulmin 6d58704e76
Sort spans in Netty41ClientSslTest (#5433) 2022-02-24 13:02:40 +02:00
Trask Stalnaker 53a8b85f4c
Updates to http.server_name (#5369)
* Updates to http.server_name

* Tests

* fix

* armeria

* fix

* fix

* codenarc
2022-02-18 09:38:21 -08:00
Lauri Tulmin 8c6cd97cc7
Sort netty RESOLVE, CONNECT and SSL handshake spans (#5394) 2022-02-17 20:20:08 -08:00
Lauri Tulmin cc60ffb6e0
Fix netty38 latest deps test (#5392) 2022-02-17 07:29:24 -08:00
Lauri Tulmin 9f98a0953a
Disable connection pooling in netty38 tests (#5384) 2022-02-17 11:02:43 +02:00
Trask Stalnaker 022914139e
test latest deps cleanup (#5269)
* test latest deps cleanup

* Revert currently irrelevant change

* Update instrumentation/lettuce/lettuce-4.0/javaagent/build.gradle.kts

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

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
2022-02-01 09:49:07 -08:00
Lauri Tulmin fbf00761cc
Use VirtualField for associating netty listener with wrapper (#5282)
* Use VirtualField for associating netty listener with wrapper

* Move ignoring lambas for injected classes to LambdaTransformer
2022-01-31 14:45:12 -08:00
Mateusz Rzeszutek 8b767ac435
Refactor HTTP attributes extractors to use composition over inheritance (#5267)
* Refactor HTTP attributes extractors to use composition over inheritance

* Rename remaining variables: *Extractor to *Getter
2022-01-31 09:25:27 -08:00
Mateusz Rzeszutek edc185b133
Rename ServerSpanNaming to HttpRouteHolder (#5211)
* Rename ServerSpanNaming to HttpRouteHolder

* HttpRouteBiGetter
2022-01-25 09:44:15 -08:00
Mateusz Rzeszutek 9381d5a264
Expected server span name for null route should be HTTP GET (#5197) 2022-01-21 19:35:48 -08:00
jason plumb fe8a132ee9
Factor out NetServerAttributesGetter (#5194)
* factor out NetServerAttributesGetter and favor composition over inheritance.

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java

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

* errorprone and spotless

* spotless

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2022-01-21 17:01:30 -08:00
jason plumb c5c0a2bcdf
NetClientAttributesAdapter - favor composition over inheritance (#5030)
* first pass at separating NetAttributesAdapter interface and make NetClientAttributesExtractor concrete

* rename the implementations extractor -> adapter

* hide constructor and make factory method

* rename to client and add javadoc

* spotless

* finish javadoc thought

* rebase

* renamed NetClientAttributesAdapter to NetClientAttributesGetter

* fix lettuce

* code review comments

* code review comments -- renaming for consistency

* adapter -> getter

* fix ratpack

* adapter -> getter
2022-01-20 10:51:13 -08:00
Mateusz Rzeszutek 540e4cfafb
Remove HttpServerTest#extraAttributes() method (#5176)
* Remove HttpServerTest#extraAttributes() method

* fix ktor tests

* fix ratpack and restlet tests

* fix servlet2 tests

* Fix webflux and vertx tests
2022-01-20 10:41:41 -08: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
Mateusz Rzeszutek 872c6c7d80
Add `http.route` to the server span when `ServerSpanNaming` is updated (#5086)
* Add `http.route` to the server span when `ServerSpanNaming` is updated

* fix camel tests

* fix test compilation failure

* assert route in camel instrumentation
2022-01-14 13:52:06 -08:00
Nikita Salnikov-Tarnovski 1a9c633b4b
Rename some packages, move some classes (#5043)
* Rename some packages, move some classes
2022-01-09 13:26:51 +02: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
Fabrizio Ferri-Benedetti 4d7a5d5062
Add settings docs for instrumentations (#4981)
* First commit

* Add other instrumentation docs

* Peer edits

* Update instrumentation/kafka/kafka-clients/README.md

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

* Update instrumentation/methods/README.md

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

* Update instrumentation/netty/README.md

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

* Update instrumentation/reactor/reactor-netty/README.md

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

* Update instrumentation/servlet/README.md

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

* Fixes

* Update instrumentation/couchbase/README.md

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

* Update instrumentation/rocketmq-client-4.8/README.md

Well spotted!

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

* Update instrumentation/spring/README.md

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

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2022-01-03 10:24:48 -08:00
Trask Stalnaker 98034e93c6
Remove pinned netty test latest dep version (#4896)
This reverts commit be7bc243de.
2021-12-14 11:25:05 +02:00
Mateusz Rzeszutek a65e9633ba
Refactor `ServerSpanNaming` (in preparation for `http.route`) (#4852)
* Refactor ServerSpanNaming (in preparation for http.route)

* fix tests

* Add ServerSpanNaming to all HTTP server instrumentations

* fix tests
2021-12-14 10:11:20 +01:00
Trask Stalnaker be7bc243de
Skip problem netty version (#4860) 2021-12-10 09:28:12 +01:00
Anuraag Agrawal 6b6b22de96
Update Armeria for testing (#4730)
* Update Armeria for testing

* Fix aws sdk and netty tests for armeria update (#4841)

* Fix aws sdk tests for armeria update

* fix flaky aws11 test

* send path instread of full uri

* send path instread of full uri

* fix flaky aws11 test

* fix netty tests

* spotless

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2021-12-09 08:53:56 +09:00
Trask Stalnaker ce4cef76f9
Clean up groovy assertions (#4805) 2021-12-05 23:23:58 -08:00
Lauri Tulmin 313979a467
Fix http.url handing in vert.x 3 http client (#4739)
* Fix http.url handing in vert.x 3 http client

* correct version

* fix build

* if https test is disabled use http for non routable aadress test

* if https test is disabled use http for non routable aadress test

* use StringBuilder
2021-12-01 10:51:53 -08:00
Trask Stalnaker f7efe07b06
Merge start and end time extractors (#4692) 2021-11-29 22:07:49 -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
Mateusz Rzeszutek 7caa4022d4
Trace SSL handshakes in netty 4.0 (#4635) 2021-11-16 08:35:54 +01:00
Mateusz Rzeszutek cd119f491d
Trace DNS resolution in reactor-netty (#4627)
* Trace DNS resolution in reactor-netty

* Code review comments

* removed a little too much

* implementation -> api

* revert and make muzzle happy
2021-11-16 08:34:27 +01:00
Mateusz Rzeszutek 3a229c8436
Fix muzzle problems happening when netty without SSL is used (#4631) 2021-11-12 09:54:52 +01:00
Lauri Tulmin d53c276b96
Ensure that netty 4.0 instrumentation is not applied to 4.1 (#4626)
* Enusre that netty 4.0 instrumentation is not applied to 4.1

* formatting

* cross test netty instrumentation
2021-11-11 08:38:56 -08:00
Mateusz Rzeszutek 4719e4cc79
Trace SSL handshakes in netty 4.1 (#4604)
* Trace SSL handshakes in netty 4.1

* Update testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/HttpClientTestServer.java

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

* remove unneeded bit of code

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-10 13:43:59 -08:00
Nikita Salnikov-Tarnovski e7b8cca107
Convert TextMapSetters and TextMapGetters to enums (#4522)
* Convert TextMapSetters to enums

* Convert TextMapGetters to enums
2021-11-08 22:01:40 +02:00
Mateusz Rzeszutek 958f1c039c
Trace DNS resolution in Netty 4.1 (#4587)
* Trace DNS resolution in Netty 4.1

* Fix reactor-netty 0.9 tests

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

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-05 11:37:54 -07:00
Mateusz Rzeszutek 8f73c43866
Consistently set http.scheme in all netty instrumentations (#4576) 2021-11-03 09:51:11 -07:00
Mateusz Rzeszutek e9ba87d6b3
Migrate Netty 3.8 CONNECT instrumentation to Instrumenter API (#4492)
* Migrate Netty 3.8 CONNECT instrumentation to Instrumenter API

* Move shouldStart()
2021-10-26 17:28:31 +02:00
Mateusz Rzeszutek 25f6864602
Migrate reactor-netty CONNECT instrumentation to Instrumenter API (#4493) 2021-10-25 13:43:30 -07:00
Mateusz Rzeszutek 413d7d1fa6
Migrate Netty 4.x CONNECT instrumentation to Instrumenter API (#4461) 2021-10-25 12:44:20 +02:00
Martin d314d76fce
rename `newBuilder()` to `builder()` (#4475)
* rename `newBuilder()` to `builder()`

* rename `newBuilder()` to `builder()`
2021-10-22 20:50:43 -07:00
Lauri Tulmin 9b8ab5eeec
Migrate to spock 2 (#4458)
* Migrate to spock 2

* Fix smoke test suites

* address review comments

* review comment

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-22 08:40:58 -07:00
Lauri Tulmin ef131acd6d
Enable http server concurrency test everywhere (#4465)
* Enable http server concurrency test everywhere

* remove testConcurrency method as test is now always enabled

* rebase
2021-10-22 08:39:30 -07:00
Osher Vaknin 7998c842db
Netty server instrumentation now captures http.scheme (#4446)
* Netty server instrumentation now captures http.scheme

* Fixed Spring Netty related tests

* Fixed Spring Netty related tests
2021-10-21 10:39:00 -07:00
Mateusz Rzeszutek c490b2903b
Extract net attributes both on start and on end in netty HTTP client (#4420)
* Extract net attributes both on start and on end in netty HTTP client

* storing remote address in HttpRequestAndChannel

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

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-21 10:38:33 -07:00
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