Commit Graph

126 Commits

Author SHA1 Message Date
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
Anuraag Agrawal abeca79e24
Some Gradle optimizations (#2949)
* Gradle optimizations

* Finish
2021-05-11 17:45:54 +09:00
Mateusz Rzeszutek 9c7fae3b04
Extract javaagent-extension-api from tooling & spi (#2879) 2021-05-06 23:30:25 -07:00
Trask Stalnaker 2ab92f556e
Fix duplicate http client tracing headers (#2842)
* Fix duplicate spring webclient tracing headers

* Fix Akka Http

* Fix Armeria

* Fix Java 11 Http Client

* Fix OkHttp 2.2

* Fix PlayWS
2021-04-23 13:05:10 -07:00
Lauri Tulmin c8af5f6e1e
Add missing Uroll annotations (#2848) 2021-04-22 16:25:22 +02: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
Trask Stalnaker 9bd028f767
Remove unnecessary genericness (#2797) 2021-04-14 00:01:28 -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
Trask Stalnaker b8f50fe922
Add parent dirs for common instrumentations (#2767) 2021-04-10 10:53:56 -07: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 b062e38117
Pass OpenTelemetry instance to WebFlux lib tracer (#2730) 2021-04-06 08:52:27 +03:00
Mateusz Rzeszutek 1406855bb7
Revert "Prevent duplicate telemetry when using both library and auto instrumentation (#2661)" (#2689) 2021-04-01 16:11:15 -07:00
Trask Stalnaker d5e526b9f3
Cache config values in instrumentations (#2681)
* Cache config values in instrumentations

* Bring back defaultEnabled()

* comment

* one problem
2021-03-31 22:54:20 -07:00
Mateusz Rzeszutek 30434696ae
Prevent duplicate telemetry when using both library and auto instrumentation (#2661)
* Prevent duplicate telemetry when using both library and auto instrumentation

* Add unit test

* Fix Oshi tests

* Fix couchbase 3.1 tests
2021-03-31 10:57:04 -07:00
Trask Stalnaker 0d11dbe565
Fix webflux client filter subscribe (#2646)
* Fix webflux client filter subscribe

* Add test

* Fix test

* Fix test, take 2

* Fix another test

* Suppress test for another module

* Suppress another library instrumentation

* Another

* Add nested client suppression in Armeria

* Add comments

* Revert extra line
2021-03-31 07:54:41 +03:00
Trask Stalnaker 97d58d7ff4
Use class literals where possible (#2669) 2021-03-31 07:45:29 +03:00
Anuraag Agrawal dcd316da7a
Enable strict context check and fix some context issues. (#2637)
* Enable strict context check and fix some context issues.

* Drift

* Drift and cache

* Exclude grizzly include akka

* Grizzly, scala

* ForkJoin worker

* webflux comment, grizzly typo

* Give up on akka for now

* threadpool

* Fallback on grizzly, wait for completion in executor cancellation tests

* Hystrix

* ratpack

* Cleanups
2021-03-29 08:08:11 +03: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
Mateusz Rzeszutek 97fa9932d4
Remove unnecessary libs from javaagent test classpath (#2545)
* Remove unnecessary libs from javaagent test classpath

All `javaagent` & `library` modules are now filtered out: for instance, `hibernate-3.3:javaagent` tests no longer have `hibernate-common:javaagent` on classpath (previously they had).

Honestly this is kind of hacky, but I don't know gradle enough to solve that "properly" - maybe it is possible to filter out all `implementation` libraries from the classpath?

* spotless
2021-03-11 15:56:24 +09: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 04d6fb67ff
Move SERVER and CLIENT span context keys out of BaseTracer (#2468)
* Move SERVER and CLIENT span context keys out of BaseTracer

Inspired by https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/1726#issuecomment-731890267

* Rename context keys

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-03-03 16:12:42 +01:00
Trask Stalnaker 62f2611486
Update instrumentation names (#2433) 2021-03-01 19:34:25 -08:00
Trask Stalnaker 5c1a432c54
Update old name (#2440) 2021-03-01 15:43:49 -08:00
Nikita Salnikov-Tarnovski 74bbb27fca
Fix Spring WebFlux test (#2397) 2021-02-24 17:19:36 +09:00
Lauri Tulmin c8ca7e8d07
Make http.flavor spec compliant (#2370) 2021-02-22 13:12:05 -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
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
Mateusz Rzeszutek 93b3a3b289
testing-common refactoring: replace direct AgentTestRunner usage with… (#2134)
* testing-common refactoring: replace direct AgentTestRunner usage with spock spec

* Updated instrumentation docs

* Fix reactor-core library tests

ReactorCoreTest was getting a tracer from GlobalOpenTelemetry before LibraryTestTrait had a change to initialize the SDK
2021-02-01 11:32:25 +01:00
John Watson 588f8847ed
Hide the context keys in the BaseTracer. (#2105)
* Hide the context keys in the BaseTracer.
Provide the appropriate methods to get access.

* key needs to be static

* fix formatting

* more formatting, sigh

* remove an errant semicolon
2021-01-25 09:49:16 +02: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 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
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
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
Lauri Tulmin d8f7886903
Move setup from static initializer to setupSpec to ensure that property is set for both SpringWebfluxTest and SingleThreadedSpringWebfluxTest not only the one that runs first. (#1915) 2020-12-15 10:10:23 -08:00
Trask Stalnaker 8235b345eb
Hide spring non-spec'd attributes behind flag (#1906)
* Hide spring non-spec'd attributes behind flag

* Spotless

* Don't cache configuration :(
2020-12-15 08:50:00 +02:00
Anuraag Agrawal 3b8827b8ab
Update to SDK 0.12.0 (#1830)
* Update to SDK 0.12.0

* Update error message to the current world.

* Bump referenced smoke test versions

* fixes

* dependency hell

* Suppress unused call

* Bump missed smoke tests

* Bump image, bump smoke tests gRPC version
2020-12-07 17:16:47 +09:00
Mateusz Rzeszutek f520c2cd33
Remove deprecated SpanWithScope class (#1834) 2020-12-05 09:48:28 -08:00
Trask Stalnaker fa09451aea
Prefix custom attributes with instrumentation name (#1784) 2020-12-03 20:56:31 -08: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 26f254b10d
Create javaagent dirs for all instrumentations, part 2 (#1794) 2020-11-28 22:26:49 -08:00
Trask Stalnaker 41bd489a77
Format groovy files (#1793) 2020-11-28 21:22:14 -08:00
Trask Stalnaker b683c2ff05
Convert the last two decorators to tracers and delete BaseDecorator (#1785) 2020-11-28 10:50:41 -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
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 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
Trask Stalnaker 2e51003900
Enable checkstyle overload method ordering rule for Google Java Style (#1656) 2020-11-17 14:41:14 -08:00
Mateusz Rzeszutek 1a23ac3027
Standardize instrumentation names in InstrumentationModules (#1648)
* Standardize instrumentation names in InstrumentationModules

* rename gradle modules:
  * vertx-3.0 to vertx-web-3.0
  * spark-web-framework-2.3 to spark-2.3
* add JavaDoc describing the naming rules to InstrumentationModule
2020-11-17 13:30:28 -08:00
Mateusz Rzeszutek 9d2db827b9
Refactor Instrumenters into InstrumentationModules - R, S, T, V (#1576) 2020-11-09 18:48:52 -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
Trask Stalnaker f046e598c6
Add context root to the front of the route in the span name (#1418)
* Add application root to span name

* Reduce duplicate context lookups

* Use servlet path as route

* Test against jetty instrumentation

* Add JAX-RS context path test

* Fix JAX-RS 1.0 span names
2020-10-27 14:21:10 -07: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 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
Trask Stalnaker 9605789726
Propagate full context (#1350)
* Propagate full context

* spotless
2020-10-09 12:58:42 +03:00
Anuraag Agrawal 5bba5d8482
Update to latest snapshot (#1331)
* Update to latest snapshot

* Update to latest snapshot

* instrumentation-api

* spotless
2020-10-06 17:47:41 +09: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
Anuraag Agrawal f2194a928c
Update to latest snapshot. (#1304) 2020-10-04 19:41:10 -07:00
Nikita Salnikov-Tarnovski 7b1b399a29
Convert more decorators to tracers (#1275)
* More decorators to tracers

* Convert more decorators to tracers

* Fixes
2020-09-29 09:41:09 +03: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 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
Trask Stalnaker 221deb1f98
Fix test logging (#1194) 2020-09-13 21:13:11 -07:00
dengliming 4959aa735f
Rename spring instrumentation modules (#1125) 2020-09-10 08:41:25 +09:00
Richard Startin 0d4fe92296 use spring-webflux-5.1+ ClientResponse.rawStatusCode when available (DataDog/dd-trace-java#1711) 2020-09-01 10:31:24 -07: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
Munir Abdinur d58eca23f8
move instrumentation-core:spring project to instrumentation (#1092) 2020-08-25 15:32:01 +09:00