Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
274 lines (235 loc) · 11.6 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
274 lines (235 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("otel.javaagent-instrumentation")
}
muzzle {
pass {
group.set("software.amazon.awssdk")
module.set("aws-core")
versions.set("[2.2.0,)")
skip("2.17.200") // broken AWS SDK release: sdk-core 2.17.200 was not published
assertInverse.set(true)
// Used by all SDK services, the only case it isn't is an SDK extension such as a custom HTTP
// client, which is not target of instrumentation anyways.
extraDependency("software.amazon.awssdk:protocol-core")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.BedrockRuntimeInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.SqsInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.SnsInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.LambdaInstrumentationModule")
}
fail {
group.set("software.amazon.awssdk")
module.set("aws-core")
versions.set("[2.2.0,)")
// Used by all SDK services, the only case it isn't is an SDK extension such as a custom HTTP
// client, which is not target of instrumentation anyways.
extraDependency("software.amazon.awssdk:protocol-core")
// "fail" asserts that *all* the instrumentation modules fail to load, but the core one is
// actually expected to succeed, so exclude it from checks.
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.AwsSdkInstrumentationModule")
}
pass {
group.set("software.amazon.awssdk")
module.set("sqs")
versions.set("[2.2.0,)")
assertInverse.set(true)
// Used by all SDK services, the only case it isn't is an SDK extension such as a custom HTTP
// client, which is not target of instrumentation anyways.
extraDependency("software.amazon.awssdk:protocol-core")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.BedrockRuntimeInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.SnsInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.LambdaInstrumentationModule")
}
pass {
group.set("software.amazon.awssdk")
module.set("sns")
versions.set("[2.2.0,)")
// Used by all SDK services, the only case it isn't is an SDK extension such as a custom HTTP
// client, which is not target of instrumentation anyways.
extraDependency("software.amazon.awssdk:protocol-core")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.BedrockRuntimeInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.SqsInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.LambdaInstrumentationModule")
}
pass {
group.set("software.amazon.awssdk")
module.set("lambda")
versions.set("[2.17.0,)")
skip("2.17.200") // broken AWS SDK release: sdk-core 2.17.200 was not published
// Used by all SDK services, the only case it isn't is an SDK extension such as a custom HTTP
// client, which is not target of instrumentation anyways.
extraDependency("software.amazon.awssdk:protocol-core")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.BedrockRuntimeInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.SqsInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.SnsInstrumentationModule")
}
pass {
group.set("software.amazon.awssdk")
module.set("bedrockruntime")
versions.set("[2.25.63,)")
// Used by all SDK services, the only case it isn't is an SDK extension such as a custom HTTP
// client, which is not target of instrumentation anyways.
extraDependency("software.amazon.awssdk:protocol-core")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.LambdaInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.SqsInstrumentationModule")
excludeInstrumentationModule("io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.SnsInstrumentationModule")
}
}
dependencies {
implementation(project(":instrumentation:aws-sdk:aws-sdk-2.2:library"))
library("software.amazon.awssdk:aws-core:2.2.0")
library("software.amazon.awssdk:sqs:2.2.0")
// Don't use library to make sure base test is run with the floor version.
// bedrock runtime is tested separately in testBedrockRuntime.
// First release with Converse API
compileOnly("software.amazon.awssdk:bedrockruntime:2.25.63")
testImplementation(project(":instrumentation:aws-sdk:aws-sdk-2.2:testing"))
testImplementation("io.opentelemetry.contrib:opentelemetry-aws-xray-propagator")
// Make sure these don't add HTTP headers
testInstrumentation(project(":instrumentation:apache-httpclient:apache-httpclient-4.0:javaagent"))
testInstrumentation(project(":instrumentation:apache-httpclient:apache-httpclient-5.0:javaagent"))
testInstrumentation(project(":instrumentation:aws-sdk:aws-sdk-1.11:javaagent"))
testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
testLibrary("software.amazon.awssdk:dynamodb:2.2.0")
testLibrary("software.amazon.awssdk:ec2:2.2.0")
testLibrary("software.amazon.awssdk:kinesis:2.2.0")
testLibrary("software.amazon.awssdk:lambda:2.2.0")
testLibrary("software.amazon.awssdk:rds:2.2.0")
testLibrary("software.amazon.awssdk:s3:2.2.0")
testLibrary("software.amazon.awssdk:ses:2.2.0")
testLibrary("software.amazon.awssdk:secretsmanager:2.2.0")
testLibrary("software.amazon.awssdk:sfn:2.2.0")
testLibrary("software.amazon.awssdk:sns:2.2.0")
testLibrary("software.amazon.awssdk:sqs:2.2.0")
}
testing {
suites {
register<JvmTestSuite>("s3PresignerTest") {
dependencies {
val version = baseVersion("2.10.12").orLatest()
implementation("software.amazon.awssdk:s3:$version")
implementation(project(":instrumentation:aws-sdk:aws-sdk-2.2:library"))
}
}
register<JvmTestSuite>("s3CrtTest") {
dependencies {
implementation("software.amazon.awssdk:s3:${baseVersion("2.27.21").orLatest()}")
implementation("software.amazon.awssdk.crt:aws-crt:${baseVersion("0.30.11").orLatest()}")
implementation(project(":instrumentation:aws-sdk:aws-sdk-2.2:library"))
implementation("org.testcontainers:testcontainers-localstack")
}
}
register<JvmTestSuite>("testBedrockRuntime") {
dependencies {
implementation(project(":instrumentation:aws-sdk:aws-sdk-2.2:testing"))
// 2.25.63 is the first release with Converse API
val version = baseVersion("2.25.63").orLatest()
implementation("software.amazon.awssdk:bedrockruntime:$version")
}
}
register<JvmTestSuite>("testRdsData") {
dependencies {
implementation(project(":instrumentation:aws-sdk:aws-sdk-2.2:testing"))
val version = baseVersion("2.5.54").orLatest()
implementation("software.amazon.awssdk:rdsdata:$version")
}
}
}
}
tasks {
val testExperimentalSqs = register<Test>("testExperimentalSqs") {
testClassesDirs = sourceSets.test.get().output.classesDirs
classpath = sourceSets.test.get().runtimeClasspath
filter.includeTestsMatching("Aws2SqsTracingTest")
systemProperty("otel.instrumentation.aws-sdk.experimental-use-propagator-for-messaging", "true")
systemProperty("otel.instrumentation.common.messaging.experimental.receive-telemetry.enabled", "true")
}
val testReceiveSpansDisabled = register<Test>("testReceiveSpansDisabled") {
testClassesDirs = sourceSets.test.get().output.classesDirs
classpath = sourceSets.test.get().runtimeClasspath
filter {
includeTestsMatching("Aws2SqsSuppressReceiveSpansTest")
}
include("**/Aws2SqsSuppressReceiveSpansTest.*")
}
test {
filter {
excludeTestsMatching("Aws2SqsSuppressReceiveSpansTest")
}
}
withType<Test>().configureEach {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
systemProperty("testLatestDeps", otelProps.testLatestDeps)
}
val testExperimentalAttributes = register<Test>("testExperimentalAttributes") {
testClassesDirs = sourceSets.test.get().output.classesDirs
classpath = sourceSets.test.get().runtimeClasspath
filter.excludeTestsMatching("Aws2SqsSuppressReceiveSpansTest")
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", "true")
systemProperty(
"metadataConfig",
"otel.instrumentation.aws-sdk.experimental-span-attributes=true",
)
}
val testIndividualHttpErrors = register<Test>("testIndividualHttpErrors") {
testClassesDirs = sourceSets.test.get().output.classesDirs
classpath = sourceSets.test.get().runtimeClasspath
filter.includeTestsMatching("Aws2ClientRecordHttpErrorTest")
systemProperty("otel.instrumentation.aws-sdk.experimental-record-individual-http-error", "true")
systemProperty(
"metadataConfig",
"otel.instrumentation.aws-sdk.experimental-record-individual-http-error=true",
)
}
val testReceiveTelemetry = register<Test>("testReceiveTelemetry") {
testClassesDirs = sourceSets.test.get().output.classesDirs
classpath = sourceSets.test.get().runtimeClasspath
filter.includeTestsMatching("Aws2SqsTracingTest")
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", "true")
systemProperty("otel.instrumentation.common.messaging.experimental.receive-telemetry.enabled", "true")
systemProperty(
"metadataConfig",
"otel.instrumentation.aws-sdk.experimental-span-attributes=true," +
"otel.instrumentation.common.messaging.experimental.receive-telemetry.enabled=true",
)
}
val testBedrockRuntimeCaptureMessageContent = register<Test>("testBedrockRuntimeCaptureMessageContent") {
testClassesDirs = sourceSets["testBedrockRuntime"].output.classesDirs
classpath = sourceSets["testBedrockRuntime"].runtimeClasspath
systemProperty("otel.instrumentation.genai.capture-message-content", "true")
systemProperty("metadataConfig", "otel.instrumentation.genai.capture-message-content=true")
}
val testRdsDataExperimentalAttributes = register<Test>("testRdsDataExperimentalAttributes") {
testClassesDirs = sourceSets["testRdsData"].output.classesDirs
classpath = sourceSets["testRdsData"].runtimeClasspath
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", "true")
}
check {
dependsOn(
testing.suites,
testExperimentalSqs,
testReceiveSpansDisabled,
testExperimentalAttributes,
testIndividualHttpErrors,
testReceiveTelemetry,
testBedrockRuntimeCaptureMessageContent,
testRdsDataExperimentalAttributes,
)
}
withType<ShadowJar>().configureEach {
mergeServiceFiles {
include("software/amazon/awssdk/global/handlers/execution.interceptors")
}
// mergeServiceFiles requires that duplicate strategy is set to include
filesMatching("software/amazon/awssdk/global/handlers/execution.interceptors") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
if (otelProps.denyUnsafe) {
// Aws2SqsTracingTest uses org.elasticmq:elasticmq-rest-sqs_2.13 that uses unsafe. Future
// versions are likely to fix this.
withType<Test>().configureEach {
enabled = false
}
}
}