Skip to content

Commit a62f47f

Browse files
authored
fix(deps): update OTel Java Agent to v2.18.1 and OTel Contrib to v1.48.0 (#1156)
This updates upstream dependency OTel Java Agent to v2.18.1 and upgrades upstream OTel Contrib to v1.48.0. It removes two patch files, as those code has been migrated to upstream. For the OTel Java Contrib patch, it has been replaced by PR-1959 open-telemetry/opentelemetry-java-contrib#1959 , which is included in the OTel Java Contrib v1.48.0 release. For the OTel Java Agent patch for the Lambda stream handler, it has been replaced by PR-13466 open-telemetry/opentelemetry-java-instrumentation#13466 , which is included in the OTel Java Agent v2.18.1 release. Tests: - Unit tests pass: ./gradlew build test - Smoke/Contract tests pass: ./gradlew appsignals-tests:contract-tests:contractTests - X-Ray remote sampling service end-to-end manual tests pass - EC2 end-to-end tests with SpringBoot Java app pass - Lambda end-to-end tests with SpringBoot Java app pass By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 4a42134 commit a62f47f

File tree

9 files changed

+23
-771
lines changed

9 files changed

+23
-771
lines changed

.github/patches/opentelemetry-java-contrib.patch

Lines changed: 0 additions & 237 deletions
This file was deleted.

.github/patches/versions

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
OTEL_JAVA_INSTRUMENTATION_VERSION=v2.11.0
2-
OTEL_JAVA_CONTRIB_VERSION=v1.39.0
1+
OTEL_JAVA_INSTRUMENTATION_VERSION=v2.18.1

awsagentprovider/src/test/java/software/amazon/opentelemetry/javaagent/providers/UdpExporterTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import static org.assertj.core.api.Assertions.assertThat;
1919
import static org.assertj.core.api.Assertions.assertThatThrownBy;
20+
import static org.junit.jupiter.api.Assertions.assertTrue;
2021
import static org.mockito.Mockito.*;
2122

2223
import io.opentelemetry.api.common.AttributeKey;
@@ -36,8 +37,10 @@ public class UdpExporterTest {
3637
public void testUdpExporterWithDefaults() {
3738
OtlpUdpSpanExporter exporter = new OtlpUdpSpanExporterBuilder().build();
3839
UdpSender sender = exporter.getSender();
39-
assertThat(sender.getEndpoint().getHostName())
40-
.isEqualTo("localhost"); // getHostName implicitly converts 127.0.0.1 to localhost
40+
String senderEndpointHostName = sender.getEndpoint().getHostName();
41+
// getHostName may or may not convert 127.0.0.1 to localhost
42+
assertTrue(
43+
senderEndpointHostName.equals("localhost") || senderEndpointHostName.equals("127.0.0.1"));
4144
assertThat(sender.getEndpoint().getPort()).isEqualTo(2000);
4245
assertThat(exporter.getPayloadPrefix()).endsWith("T1S");
4346
}

dependencyManagement/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ data class DependencySet(val group: String, val version: String, val modules: Li
2727
val testSnapshots = rootProject.findProperty("testUpstreamSnapshots") == "true"
2828

2929
// This is the version of the upstream instrumentation BOM
30-
val otelVersion = "2.11.0"
31-
val otelSnapshotVersion = "2.12.0"
30+
val otelVersion = "2.18.1"
31+
val otelSnapshotVersion = "2.19.0"
3232
val otelAlphaVersion = if (!testSnapshots) "$otelVersion-alpha" else "$otelSnapshotVersion-alpha-SNAPSHOT"
3333
val otelJavaAgentVersion = if (!testSnapshots) otelVersion else "$otelSnapshotVersion-SNAPSHOT"
3434
// All versions below are only used in testing and do not affect the released artifact.
@@ -76,8 +76,8 @@ val dependencyLists = listOf(
7676
"commons-logging:commons-logging:1.2",
7777
"com.sparkjava:spark-core:2.9.4",
7878
"com.squareup.okhttp3:okhttp:4.12.0",
79-
"io.opentelemetry.contrib:opentelemetry-aws-xray:1.39.0-adot1",
80-
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.39.0-alpha",
79+
"io.opentelemetry.contrib:opentelemetry-aws-xray:1.48.0",
80+
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.48.0-alpha",
8181
"io.opentelemetry.proto:opentelemetry-proto:1.0.0-alpha",
8282
"io.opentelemetry.javaagent:opentelemetry-javaagent:$otelJavaAgentVersion",
8383
"io.opentelemetry:opentelemetry-extension-aws:1.20.1",

instrumentation/aws-sdk/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ dependencies {
4141
testImplementation("com.amazonaws:aws-java-sdk-sns:1.11.106")
4242
testImplementation("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
4343
testImplementation("com.amazonaws:aws-java-sdk-secretsmanager:1.11.309")
44+
45+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
4446
}

lambda-layer/build-layer.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ git checkout v${version} -b tag-v${version}
2525
# This patch is for Lambda related context propagation
2626
patch -p1 < "$SOURCEDIR"/patches/opentelemetry-java-instrumentation.patch
2727

28-
patch -p1 < "$SOURCEDIR"/patches/StreamHandlerInstrumentation.patch
29-
3028
./gradlew publishToMavenLocal
3129
popd
3230
rm -rf opentelemetry-java-instrumentation

0 commit comments

Comments
 (0)