Skip to content

Commit 22c6082

Browse files
Merge branch 'open-telemetry:main' into main
2 parents c25f989 + f8c383c commit 22c6082

File tree

27 files changed

+1690
-1132
lines changed

27 files changed

+1690
-1132
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Learn about membership in OpenTelemetry community:
3-
# https://github.com/open-telemetry/community/blob/main/community-membership.md
3+
# https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md
44
#
55
#
66
# Learn about CODEOWNERS file format:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Emeritus maintainers:
178178
- [Tyler Benson](https://github.com/tylerbenson)
179179

180180
Learn more about roles in
181-
the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md).
181+
the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md).
182182

183183
Thanks to all the people who already contributed!
184184

benchmark-overhead/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ repositories {
1818
dependencies {
1919
implementation(enforcedPlatform("org.junit:junit-bom:5.10.3"))
2020

21-
testImplementation("org.testcontainers:testcontainers:1.20.0")
22-
testImplementation("org.testcontainers:postgresql:1.20.0")
21+
testImplementation("org.testcontainers:testcontainers:1.20.1")
22+
testImplementation("org.testcontainers:postgresql:1.20.1")
2323
testImplementation("org.junit.jupiter:junit-jupiter-api")
2424
testImplementation("org.junit.jupiter:junit-jupiter-params")
2525
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ val DEPENDENCY_BOMS = listOf(
3434
"io.opentelemetry:opentelemetry-bom:${otelSdkVersion}",
3535
"io.opentelemetry:opentelemetry-bom-alpha:${otelSdkAlphaVersion}",
3636
"org.junit:junit-bom:5.10.3",
37-
"org.testcontainers:testcontainers-bom:1.20.0",
37+
"org.testcontainers:testcontainers-bom:1.20.1",
3838
"org.spockframework:spock-bom:2.4-M4-groovy-4.0"
3939
)
4040

examples/distro/smoke-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
dependencies {
6-
testImplementation("org.testcontainers:testcontainers:1.20.0")
6+
testImplementation("org.testcontainers:testcontainers:1.20.1")
77
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.17.2")
88
testImplementation("com.google.protobuf:protobuf-java-util:3.25.4")
99
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")

examples/extension/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ dependencies {
9999
implementation 'org.apache.commons:commons-lang3:3.15.0'
100100

101101
//All dependencies below are only for tests
102-
testImplementation("org.testcontainers:testcontainers:1.20.0")
102+
testImplementation("org.testcontainers:testcontainers:1.20.1")
103103
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.17.2")
104104
testImplementation("com.google.protobuf:protobuf-java-util:3.25.4")
105105
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")

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

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,32 @@ dependencies {
1818
testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
1919
}
2020

21-
otelJava {
22-
// AHC uses Unsafe and so does not run on later java version
23-
maxJavaVersionForTests.set(JavaVersion.VERSION_1_8)
21+
val latestDepTest = findProperty("testLatestDeps") as Boolean
22+
val testJavaVersion =
23+
gradle.startParameter.projectProperties["testJavaVersion"]?.let(JavaVersion::toVersion)
24+
?: JavaVersion.current()
25+
26+
if (!latestDepTest) {
27+
otelJava {
28+
// AHC uses Unsafe and so does not run on later java version
29+
maxJavaVersionForTests.set(JavaVersion.VERSION_1_8)
30+
}
31+
}
32+
33+
tasks.withType<Test>().configureEach {
34+
systemProperty("testLatestDeps", latestDepTest)
35+
// async-http-client 3.0 requires java 11
36+
// We are not using minJavaVersionSupported for latestDepTest because that way the instrumentation
37+
// gets compiled with java 11 when running latestDepTest. This causes play-mvc-2.4 latest dep tests
38+
// to fail because they require java 8 and instrumentation compiled with java 11 won't apply.
39+
if (latestDepTest && testJavaVersion.isJava8) {
40+
enabled = false
41+
}
2442
}
2543

2644
// async-http-client 2.0.0 does not work with Netty versions newer than this due to referencing an
2745
// internal file.
28-
if (!(findProperty("testLatestDeps") as Boolean)) {
46+
if (!latestDepTest) {
2947
configurations.configureEach {
3048
if (!name.contains("muzzle")) {
3149
resolutionStrategy {

instrumentation/async-http-client/async-http-client-2.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientTest.java

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
import io.opentelemetry.instrumentation.testing.junit.http.HttpClientInstrumentationExtension;
1111
import io.opentelemetry.instrumentation.testing.junit.http.HttpClientResult;
1212
import io.opentelemetry.instrumentation.testing.junit.http.HttpClientTestOptions;
13+
import java.lang.reflect.Method;
1314
import java.net.URI;
15+
import java.time.Duration;
1416
import java.util.Map;
1517
import java.util.concurrent.ExecutionException;
1618
import org.asynchttpclient.AsyncCompletionHandler;
1719
import org.asynchttpclient.AsyncHttpClient;
20+
import org.asynchttpclient.DefaultAsyncHttpClientConfig;
1821
import org.asynchttpclient.Dsl;
1922
import org.asynchttpclient.Request;
2023
import org.asynchttpclient.RequestBuilder;
@@ -31,11 +34,26 @@ class AsyncHttpClientTest extends AbstractHttpClientTest<Request> {
3134
private static final int CONNECTION_TIMEOUT_MS = (int) CONNECTION_TIMEOUT.toMillis();
3235

3336
// request timeout is needed in addition to connect timeout on async-http-client versions 2.1.0+
34-
private static final AsyncHttpClient client =
35-
Dsl.asyncHttpClient(
36-
Dsl.config()
37-
.setConnectTimeout(CONNECTION_TIMEOUT_MS)
38-
.setRequestTimeout(CONNECTION_TIMEOUT_MS));
37+
private static final AsyncHttpClient client = Dsl.asyncHttpClient(configureTimeout(Dsl.config()));
38+
39+
private static DefaultAsyncHttpClientConfig.Builder configureTimeout(
40+
DefaultAsyncHttpClientConfig.Builder builder) {
41+
setTimeout(builder, "setConnectTimeout", CONNECTION_TIMEOUT_MS);
42+
setTimeout(builder, "setRequestTimeout", CONNECTION_TIMEOUT_MS);
43+
return builder;
44+
}
45+
46+
private static void setTimeout(
47+
DefaultAsyncHttpClientConfig.Builder builder, String methodName, int timeout) {
48+
boolean testLatestDeps = Boolean.getBoolean("testLatestDeps");
49+
try {
50+
Method method =
51+
builder.getClass().getMethod(methodName, testLatestDeps ? Duration.class : int.class);
52+
method.invoke(builder, testLatestDeps ? Duration.ofMillis(timeout) : timeout);
53+
} catch (Exception exception) {
54+
throw new IllegalStateException("Failed to set timeout " + methodName, exception);
55+
}
56+
}
3957

4058
@Override
4159
public Request buildRequest(String method, URI uri, Map<String, String> headers) {

0 commit comments

Comments
 (0)