Skip to content

Commit abd644d

Browse files
committed
Support ADOT V1.x to latest otel versions.
1 parent b58b94f commit abd644d

File tree

13 files changed

+49
-32
lines changed

13 files changed

+49
-32
lines changed

appsignals-tests/images/grpc/grpc-base/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ plugins {
1818
id("com.google.protobuf") version "0.9.4"
1919
}
2020

21+
java {
22+
sourceCompatibility = JavaVersion.VERSION_11
23+
targetCompatibility = JavaVersion.VERSION_11
24+
}
25+
2126
group = "software.amazon.opentelemetry"
2227

2328
dependencies {

awsagentprovider/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ dependencies {
5151
testRuntimeOnly("io.opentelemetry:opentelemetry-exporter-otlp-common")
5252

5353
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
54-
testImplementation("org.mockito:mockito-core:5.3.1")
55-
testImplementation("org.mockito:mockito-junit-jupiter:5.8.0")
54+
testImplementation("org.mockito:mockito-core:5.14.2")
55+
testImplementation("org.mockito:mockito-junit-jupiter:5.14.2")
5656
}
5757

5858
tasks {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ private SpanData buildSpanDataMock() {
129129
when(mockSpanData.getParentSpanContext()).thenReturn(parentSpanContextMock);
130130

131131
SpanContext spanContextMock = mock(SpanContext.class);
132+
TraceFlags spanContextTraceFlagsMock = mock(TraceFlags.class);
132133
when(spanContextMock.isValid()).thenReturn(true);
134+
when(spanContextMock.getTraceFlags()).thenReturn(spanContextTraceFlagsMock);
133135
when(mockSpanData.getSpanContext()).thenReturn(spanContextMock);
134136

135137
TraceState traceState = TraceState.builder().build();

build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
2121
plugins {
2222
java
2323

24+
// kotlin("jvm") version "2.1.0-RC2"
25+
// id("com.diffplug.spotless") version "6.25.0"
2426
id("com.diffplug.spotless")
2527
id("com.github.jk1.dependency-license-report")
2628
id("io.github.gradle-nexus.publish-plugin")
@@ -68,7 +70,7 @@ allprojects {
6870

6971
spotless {
7072
kotlinGradle {
71-
ktlint("0.48.0").userData(mapOf("indent_size" to "2", "continuation_indent_size" to "2"))
73+
ktlint("1.4.0").editorConfigOverride(mapOf("indent_size" to "2", "continuation_indent_size" to "2"))
7274

7375
// Doesn't support pluginManagement block
7476
targetExclude("settings.gradle.kts")
@@ -81,8 +83,8 @@ allprojects {
8183

8284
plugins.withId("java") {
8385
java {
84-
sourceCompatibility = JavaVersion.VERSION_1_8
85-
targetCompatibility = JavaVersion.VERSION_1_8
86+
sourceCompatibility = JavaVersion.VERSION_21
87+
targetCompatibility = JavaVersion.VERSION_21
8688

8789
withJavadocJar()
8890
withSourcesJar()

dependencyManagement/build.gradle.kts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ plugins {
2424

2525
data class DependencySet(val group: String, val version: String, val modules: List<String>)
2626

27-
val TEST_SNAPSHOTS = rootProject.findProperty("testUpstreamSnapshots") == "true"
27+
val testSnapshots = rootProject.findProperty("testUpstreamSnapshots") == "true"
2828

2929
// This is the version of the upstream instrumentation BOM
30-
val otelVersion = "1.32.1-adot2"
31-
val otelSnapshotVersion = "1.33.0"
32-
val otelAlphaVersion = if (!TEST_SNAPSHOTS) "$otelVersion-alpha" else "$otelSnapshotVersion-alpha-SNAPSHOT"
33-
val otelJavaAgentVersion = if (!TEST_SNAPSHOTS) otelVersion else "$otelSnapshotVersion-SNAPSHOT"
30+
val otelVersion = "1.33.6"
31+
val otelSnapshotVersion = "1.33.6"
32+
val otelAlphaVersion = if (!testSnapshots) "$otelVersion-alpha" else "$otelSnapshotVersion-alpha-SNAPSHOT"
33+
val otelJavaAgentVersion = if (!testSnapshots) otelVersion else "$otelSnapshotVersion-SNAPSHOT"
3434
// All versions below are only used in testing and do not affect the released artifact.
3535

36-
val DEPENDENCY_BOMS = listOf(
36+
val dependencyBoms = listOf(
3737
"com.amazonaws:aws-java-sdk-bom:1.12.599",
3838
"com.fasterxml.jackson:jackson-bom:2.16.0",
3939
"com.google.guava:guava-bom:33.0.0-jre",
@@ -48,7 +48,7 @@ val DEPENDENCY_BOMS = listOf(
4848
"software.amazon.awssdk:bom:2.21.33",
4949
)
5050

51-
val DEPENDENCY_SETS = listOf(
51+
val dependencySets = listOf(
5252
DependencySet(
5353
"org.assertj",
5454
"3.24.2",
@@ -69,14 +69,15 @@ val DEPENDENCY_SETS = listOf(
6969
),
7070
)
7171

72-
val DEPENDENCIES = listOf(
72+
val dependencyLists = listOf(
7373
"commons-logging:commons-logging:1.2",
7474
"com.sparkjava:spark-core:2.9.4",
7575
"com.squareup.okhttp3:okhttp:4.12.0",
76-
"io.opentelemetry.contrib:opentelemetry-aws-xray:1.32.0",
77-
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.32.0-alpha",
76+
"io.opentelemetry.contrib:opentelemetry-aws-xray:1.39.0",
77+
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.39.0-alpha",
7878
"io.opentelemetry.proto:opentelemetry-proto:1.0.0-alpha",
7979
"io.opentelemetry.javaagent:opentelemetry-javaagent:$otelJavaAgentVersion",
80+
"io.opentelemetry:opentelemetry-extension-aws:1.20.1",
8081
"net.bytebuddy:byte-buddy:1.14.10",
8182
)
8283

@@ -85,17 +86,17 @@ javaPlatform {
8586
}
8687

8788
dependencies {
88-
for (bom in DEPENDENCY_BOMS) {
89+
for (bom in dependencyBoms) {
8990
api(platform(bom))
9091
}
9192
constraints {
92-
for (set in DEPENDENCY_SETS) {
93+
for (set in dependencySets) {
9394
for (module in set.modules) {
9495
api("${set.group}:$module:${set.version}")
9596
}
9697
}
9798

98-
for (dependency in DEPENDENCIES) {
99+
for (dependency in dependencyLists) {
99100
api(dependency)
100101
}
101102
}
@@ -104,7 +105,7 @@ dependencies {
104105
rootProject.allprojects {
105106
plugins.withId("com.github.jk1.dependency-license-report") {
106107
configure<LicenseReportExtension> {
107-
val bomExcludes = DEPENDENCY_BOMS.stream()
108+
val bomExcludes = dependencyBoms.stream()
108109
.map { it.substring(0, it.lastIndexOf(':')) }
109110
.toArray { length -> arrayOfNulls<String>(length) }
110111
excludes = bomExcludes

gradle/wrapper/gradle-wrapper.jar

130 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

instrumentation/log4j-2.13.2/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ plugins {
2121
base.archivesBaseName = "aws-instrumentation-log4j-2.13.2"
2222

2323
dependencies {
24-
compileOnly("io.opentelemetry:opentelemetry-api")
25-
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
24+
compileOnly("io.opentelemetry:opentelemetry-api:1.44.1")
25+
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api:2.10.0-alpha")
2626
compileOnly("net.bytebuddy:byte-buddy")
2727

2828
compileOnly("org.apache.logging.log4j:log4j-core:2.22.1")

0 commit comments

Comments
 (0)