File tree Expand file tree Collapse file tree 5 files changed +23
-3
lines changed
instrumentation/async-http-client
async-http-client-1.8/javaagent
src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_8
async-http-client-1.9/javaagent
src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9
async-http-client-2.0/javaagent Expand file tree Collapse file tree 5 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 88 module.set(" async-http-client" )
99 versions.set(" [1.8.0,1.9.0)" )
1010 assertInverse.set(true )
11- extraDependency(" org.glassfish.grizzly:grizzly-http:2.3" )
12- extraDependency(" commons-httpclient:commons-httpclient:3.1" )
1311 }
1412}
1513
@@ -20,14 +18,18 @@ dependencies {
2018 annotationProcessor(" com.google.auto.value:auto-value" )
2119
2220 testInstrumentation(project(" :instrumentation:netty:netty-3.8:javaagent" ))
21+ testInstrumentation(project(" :instrumentation:async-http-client:async-http-client-1.9:javaagent" ))
22+ testInstrumentation(project(" :instrumentation:async-http-client:async-http-client-2.0:javaagent" ))
23+
24+ // For testLatestDeps, use the latest 1.8.x version to maintain API compatibility
25+ latestDepTestLibrary(" com.ning:async-http-client:1.8.+" )
2326}
2427
2528tasks {
2629 withType<Test >().configureEach {
2730 // required on jdk17
2831 jvmArgs(" --add-exports=java.base/sun.security.util=ALL-UNNAMED" )
2932 jvmArgs(" -XX:+IgnoreUnrecognizedVMOptions" )
30- jvmArgs(" --add-opens=java.base/java.lang=ALL-UNNAMED" )
3133
3234 systemProperty(" testLatestDeps" , findProperty(" testLatestDeps" ) as Boolean )
3335 systemProperty(" async.https.skip" , " true" )
Original file line number Diff line number Diff line change 55
66package io .opentelemetry .javaagent .instrumentation .asynchttpclient .v1_8 ;
77
8+ import static io .opentelemetry .javaagent .extension .matcher .AgentElementMatchers .hasClassesNamed ;
89import static java .util .Arrays .asList ;
910
1011import com .google .auto .service .AutoService ;
1112import io .opentelemetry .javaagent .extension .instrumentation .InstrumentationModule ;
1213import io .opentelemetry .javaagent .extension .instrumentation .TypeInstrumentation ;
1314import io .opentelemetry .javaagent .extension .instrumentation .internal .ExperimentalInstrumentationModule ;
1415import java .util .List ;
16+ import net .bytebuddy .matcher .ElementMatcher ;
1517
1618@ AutoService (InstrumentationModule .class )
1719public class AsyncHttpClientInstrumentationModule extends InstrumentationModule
@@ -20,6 +22,12 @@ public AsyncHttpClientInstrumentationModule() {
2022 super ("async-http-client" , "async-http-client-1.8" );
2123 }
2224
25+ @ Override
26+ public ElementMatcher .Junction <ClassLoader > classLoaderMatcher () {
27+ // TimeoutsHolder class was added in 1.8.0, not present in 1.7.x
28+ return hasClassesNamed ("com.ning.http.client.providers.netty.timeout.TimeoutsHolder" );
29+ }
30+
2331 @ Override
2432 public List <TypeInstrumentation > typeInstrumentations () {
2533 return asList (new AsyncHttpProviderInstrumentation (), new ResponseInstrumentation ());
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ dependencies {
1818 annotationProcessor(" com.google.auto.value:auto-value" )
1919
2020 testInstrumentation(project(" :instrumentation:netty:netty-3.8:javaagent" ))
21+ testInstrumentation(project(" :instrumentation:async-http-client:async-http-client-1.8:javaagent" ))
2122 testInstrumentation(project(" :instrumentation:async-http-client:async-http-client-2.0:javaagent" ))
2223}
2324
Original file line number Diff line number Diff line change 55
66package io .opentelemetry .javaagent .instrumentation .asynchttpclient .v1_9 ;
77
8+ import static io .opentelemetry .javaagent .extension .matcher .AgentElementMatchers .hasClassesNamed ;
89import static java .util .Arrays .asList ;
910
1011import com .google .auto .service .AutoService ;
1112import io .opentelemetry .javaagent .extension .instrumentation .InstrumentationModule ;
1213import io .opentelemetry .javaagent .extension .instrumentation .TypeInstrumentation ;
1314import io .opentelemetry .javaagent .extension .instrumentation .internal .ExperimentalInstrumentationModule ;
1415import java .util .List ;
16+ import net .bytebuddy .matcher .ElementMatcher ;
1517
1618@ AutoService (InstrumentationModule .class )
1719public class AsyncHttpClientInstrumentationModule extends InstrumentationModule
@@ -20,6 +22,12 @@ public AsyncHttpClientInstrumentationModule() {
2022 super ("async-http-client" , "async-http-client-1.9" );
2123 }
2224
25+ @ Override
26+ public ElementMatcher .Junction <ClassLoader > classLoaderMatcher () {
27+ // Uri class was added in 1.9.0, not present in 1.8.x
28+ return hasClassesNamed ("com.ning.http.client.uri.Uri" );
29+ }
30+
2331 @ Override
2432 public List <TypeInstrumentation > typeInstrumentations () {
2533 return asList (new RequestInstrumentation (), new ResponseInstrumentation ());
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ dependencies {
1616
1717 testInstrumentation(project(" :instrumentation:netty:netty-4.0:javaagent" ))
1818 testInstrumentation(project(" :instrumentation:netty:netty-4.1:javaagent" ))
19+ testInstrumentation(project(" :instrumentation:async-http-client:async-http-client-1.8:javaagent" ))
1920 testInstrumentation(project(" :instrumentation:async-http-client:async-http-client-1.9:javaagent" ))
2021}
2122
You can’t perform that action at this time.
0 commit comments