Skip to content

Commit 81f007f

Browse files
authored
Update dependencies to release ADOT Java 1.23.0 (#344)
* Update dependencies to release ADOT Java 1.23.0 * Inject Trace ID directly through MDC in logback * Update Integration Tests to account for changes in Span names Signed-off-by: Raphael Silva <[email protected]> --------- Signed-off-by: Raphael Silva <[email protected]>
1 parent 0e620aa commit 81f007f

File tree

161 files changed

+24685
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+24685
-25
lines changed

dependencyManagement/build.gradle.kts

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

2929
// This is the version of the upstream instrumentation BOM
30-
val otelVersion = "1.21.0"
31-
val otelSnapshotVersion = "1.22.0"
30+
val otelVersion = "1.23.0"
31+
val otelSnapshotVersion = "1.24.0"
3232

3333
// All versions below are only used in testing and do not affect the released artifact.
3434

3535
val DEPENDENCY_BOMS = listOf(
36-
"com.amazonaws:aws-java-sdk-bom:1.12.415",
37-
"com.fasterxml.jackson:jackson-bom:2.14.1",
36+
"com.amazonaws:aws-java-sdk-bom:1.12.416",
37+
"com.fasterxml.jackson:jackson-bom:2.14.2",
3838
"com.google.guava:guava-bom:31.1-jre",
39-
"com.google.protobuf:protobuf-bom:3.21.12",
40-
"com.linecorp.armeria:armeria-bom:1.21.0",
39+
"com.google.protobuf:protobuf-bom:3.22.0",
40+
"com.linecorp.armeria:armeria-bom:1.22.1",
4141
"io.grpc:grpc-bom:1.53.0",
4242
"io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${if (!TEST_SNAPSHOTS) "$otelVersion-alpha" else "$otelSnapshotVersion-alpha-SNAPSHOT"}",
43-
"org.apache.logging.log4j:log4j-bom:2.19.0",
44-
"org.junit:junit-bom:5.9.1",
43+
"org.apache.logging.log4j:log4j-bom:2.20.0",
44+
"org.junit:junit-bom:5.9.2",
4545
"org.springframework.boot:spring-boot-dependencies:2.7.9",
4646
"org.testcontainers:testcontainers-bom:1.17.6",
47-
"software.amazon.awssdk:bom:2.20.12"
47+
"software.amazon.awssdk:bom:2.20.13"
4848
)
4949

5050
val DEPENDENCY_SETS = listOf(
5151
DependencySet(
5252
"org.assertj",
53-
"3.23.1",
53+
"3.24.2",
5454
listOf("assertj-core")
5555
),
5656
DependencySet(
@@ -72,11 +72,11 @@ val DEPENDENCIES = listOf(
7272
"commons-logging:commons-logging:1.2",
7373
"com.sparkjava:spark-core:2.9.4",
7474
"com.squareup.okhttp3:okhttp:4.10.0",
75-
"io.opentelemetry.contrib:opentelemetry-aws-xray:1.21.0",
76-
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.21.0-alpha",
75+
"io.opentelemetry.contrib:opentelemetry-aws-xray:1.23.0",
76+
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.23.0-alpha",
7777
"io.opentelemetry.proto:opentelemetry-proto:0.19.0-alpha",
7878
"io.opentelemetry.javaagent:opentelemetry-javaagent:${if (!TEST_SNAPSHOTS) otelVersion else "$otelSnapshotVersion-SNAPSHOT"}",
79-
"net.bytebuddy:byte-buddy:1.12.22"
79+
"net.bytebuddy:byte-buddy:1.14.0"
8080
)
8181

8282
javaPlatform {

instrumentation/logback-1.0/src/main/java/software/amazon/opentelemetry/javaagent/instrumentation/logback_1_0/AwsXrayLoggingEventInstrumentation.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@
2626
import io.opentelemetry.api.trace.SpanContext;
2727
import io.opentelemetry.context.Context;
2828
import io.opentelemetry.instrumentation.api.util.VirtualField;
29-
import io.opentelemetry.instrumentation.logback.v1_0.internal.UnionMap;
3029
import io.opentelemetry.javaagent.bootstrap.Java8BytecodeBridge;
3130
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
3231
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
33-
import java.util.Collections;
3432
import java.util.Map;
3533
import net.bytebuddy.asm.Advice;
3634
import net.bytebuddy.description.type.TypeDescription;
3735
import net.bytebuddy.implementation.bytecode.assign.Assigner.Typing;
3836
import net.bytebuddy.matcher.ElementMatcher;
37+
import org.slf4j.MDC;
3938

4039
public class AwsXrayLoggingEventInstrumentation implements TypeInstrumentation {
4140
private static final String TRACE_ID_KEY = "AWS-XRAY-TRACE-ID";
@@ -77,6 +76,8 @@ public static void onExit(
7776

7877
SpanContext spanContext = Java8BytecodeBridge.spanFromContext(context).getSpanContext();
7978
if (!spanContext.isValid()) {
79+
// Remove any remaining trace id from the MDC
80+
MDC.remove(TRACE_ID_KEY);
8081
return;
8182
}
8283

@@ -88,13 +89,7 @@ public static void onExit(
8889
+ "@"
8990
+ spanContext.getSpanId();
9091

91-
Map<String, String> spanContextData = Collections.singletonMap(TRACE_ID_KEY, value);
92-
93-
if (contextData == null) {
94-
contextData = spanContextData;
95-
} else {
96-
contextData = new UnionMap<>(contextData, spanContextData);
97-
}
92+
MDC.put(TRACE_ID_KEY, value);
9893
}
9994
}
10095
}

licenses/annotations-2.20.13.jar/META-INF/LICENSE.txt

Lines changed: 206 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

licenses/annotations-2.20.13.jar/META-INF/NOTICE.txt

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)