Skip to content

Commit 1fe088b

Browse files
committed
Fix CI failings
1 parent 1465440 commit 1fe088b

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

instrumentation/async-http-client/async-http-client-1.8/javaagent/build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ muzzle {
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

2528
tasks {
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")

instrumentation/async-http-client/async-http-client-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_8/AsyncHttpClientInstrumentationModule.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66
package io.opentelemetry.javaagent.instrumentation.asynchttpclient.v1_8;
77

8+
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
89
import static java.util.Arrays.asList;
910

1011
import com.google.auto.service.AutoService;
1112
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
1213
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1314
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
1415
import java.util.List;
16+
import net.bytebuddy.matcher.ElementMatcher;
1517

1618
@AutoService(InstrumentationModule.class)
1719
public 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());

instrumentation/async-http-client/async-http-client-1.9/javaagent/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

instrumentation/async-http-client/async-http-client-1.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9/AsyncHttpClientInstrumentationModule.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66
package io.opentelemetry.javaagent.instrumentation.asynchttpclient.v1_9;
77

8+
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
89
import static java.util.Arrays.asList;
910

1011
import com.google.auto.service.AutoService;
1112
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
1213
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1314
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
1415
import java.util.List;
16+
import net.bytebuddy.matcher.ElementMatcher;
1517

1618
@AutoService(InstrumentationModule.class)
1719
public 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());

instrumentation/async-http-client/async-http-client-2.0/javaagent/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)