Skip to content

Commit 9776453

Browse files
committed
A fresh start
1 parent 1df9921 commit 9776453

File tree

5 files changed

+197
-0
lines changed

5 files changed

+197
-0
lines changed

config.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
receivers:
2+
otlp:
3+
protocols:
4+
grpc:
5+
endpoint: 0.0.0.0:4317
6+
http:
7+
endpoint: 0.0.0.0:4318
8+
9+
exporters:
10+
otlphttp/logs:
11+
compression: gzip
12+
logs_endpoint: https://logs.us-east-1.amazonaws.com/v1/logs
13+
headers:
14+
x-aws-log-group: MyApplicationLogs
15+
x-aws-log-stream: default
16+
auth:
17+
authenticator: sigv4auth/logs
18+
19+
otlphttp/traces:
20+
compression: gzip
21+
traces_endpoint: https://xray.us-east-1.amazonaws.com/v1/traces
22+
auth:
23+
authenticator: sigv4auth/traces
24+
25+
extensions:
26+
sigv4auth/logs:
27+
region: "us-east-1"
28+
service: "logs"
29+
sigv4auth/traces:
30+
region: "us-east-1"
31+
service: "xray"
32+
33+
service:
34+
telemetry:
35+
extensions: [sigv4auth/logs, sigv4auth/traces]
36+
pipelines:
37+
logs:
38+
receivers: [otlp]
39+
exporters: [otlphttp/logs]
40+
traces:
41+
receivers: [otlp]
42+
exporters: [otlphttp/traces]
43+
44+
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
17+
import com.github.jk1.license.LicenseReportExtension
18+
19+
plugins {
20+
`java-platform`
21+
22+
id("com.github.ben-manes.versions")
23+
}
24+
25+
data class DependencySet(val group: String, val version: String, val modules: List<String>)
26+
27+
val testSnapshots = rootProject.findProperty("testUpstreamSnapshots") == "true"
28+
29+
// This is the version of the upstream instrumentation BOM
30+
val otelVersion = "2.10.0-adot2"
31+
val otelSnapshotVersion = "2.11.0"
32+
val otelAlphaVersion = if (!testSnapshots) "$otelVersion-alpha" else "$otelSnapshotVersion-alpha-SNAPSHOT"
33+
val otelJavaAgentVersion = if (!testSnapshots) otelVersion else "$otelSnapshotVersion-SNAPSHOT"
34+
// All versions below are only used in testing and do not affect the released artifact.
35+
36+
val dependencyBoms = listOf(
37+
"com.amazonaws:aws-java-sdk-bom:1.12.599",
38+
"com.fasterxml.jackson:jackson-bom:2.16.0",
39+
"com.google.guava:guava-bom:33.0.0-jre",
40+
"com.google.protobuf:protobuf-bom:3.25.1",
41+
"com.linecorp.armeria:armeria-bom:1.26.4",
42+
"io.grpc:grpc-bom:1.59.1",
43+
"io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:$otelAlphaVersion",
44+
"org.apache.logging.log4j:log4j-bom:2.21.1",
45+
"org.junit:junit-bom:5.10.1",
46+
"org.springframework.boot:spring-boot-dependencies:2.7.17",
47+
"org.testcontainers:testcontainers-bom:1.19.3",
48+
"software.amazon.awssdk:bom:2.21.33",
49+
)
50+
51+
val dependencySets = listOf(
52+
DependencySet(
53+
"org.assertj",
54+
"3.24.2",
55+
listOf("assertj-core"),
56+
),
57+
DependencySet(
58+
"org.curioswitch.curiostack",
59+
"2.2.0",
60+
listOf("protobuf-jackson"),
61+
),
62+
DependencySet(
63+
"org.slf4j",
64+
"1.7.36",
65+
listOf(
66+
"slf4j-api",
67+
"slf4j-simple",
68+
),
69+
),
70+
)
71+
72+
val dependencyLists = listOf(
73+
"commons-logging:commons-logging:1.2",
74+
"com.sparkjava:spark-core:2.9.4",
75+
"com.squareup.okhttp3:okhttp:4.12.0",
76+
"io.opentelemetry.contrib:opentelemetry-aws-xray:1.39.0",
77+
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.39.0-alpha",
78+
"io.opentelemetry.proto:opentelemetry-proto:1.0.0-alpha",
79+
"io.opentelemetry.javaagent:opentelemetry-javaagent:$otelJavaAgentVersion",
80+
"io.opentelemetry:opentelemetry-extension-aws:1.20.1",
81+
"net.bytebuddy:byte-buddy:1.14.10",
82+
)
83+
84+
javaPlatform {
85+
allowDependencies()
86+
}
87+
88+
dependencies {
89+
for (bom in dependencyBoms) {
90+
api(platform(bom))
91+
}
92+
constraints {
93+
for (set in dependencySets) {
94+
for (module in set.modules) {
95+
api("${set.group}:$module:${set.version}")
96+
}
97+
}
98+
99+
for (dependency in dependencyLists) {
100+
api(dependency)
101+
}
102+
}
103+
}
104+
105+
rootProject.allprojects {
106+
plugins.withId("com.github.jk1.dependency-license-report") {
107+
configure<LicenseReportExtension> {
108+
val bomExcludes = dependencyBoms.stream()
109+
.map { it.substring(0, it.lastIndexOf(':')) }
110+
.toArray { length -> arrayOfNulls<String>(length) }
111+
excludes = bomExcludes
112+
}
113+
}
114+
}
115+
116+
fun isNonStable(version: String): Boolean {
117+
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
118+
val regex = "^[0-9,.v-]+(-r|-alpha)?$".toRegex()
119+
val isGuava = version.endsWith("-jre")
120+
val isStable = stableKeyword || regex.matches(version) || isGuava
121+
return isStable.not()
122+
}
123+
124+
tasks {
125+
named<DependencyUpdatesTask>("dependencyUpdates") {
126+
revision = "release"
127+
checkConstraints = true
128+
129+
rejectVersionIf {
130+
isNonStable(candidate.version)
131+
}
132+
}
133+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@@ -27,7 +27,7 @@
2+
val TEST_SNAPSHOTS = rootProject.findProperty("testUpstreamSnapshots") == "true"
3+
4+
// This is the version of the upstream instrumentation BOM
5+
-val otelVersion = "1.32.1-adot2"
6+
+val otelVersion = "1.32.1-adot-lambda1"
7+
val otelSnapshotVersion = "1.33.0"
8+
val otelAlphaVersion = if (!TEST_SNAPSHOTS) "$otelVersion-alpha" else "$otelSnapshotVersion-alpha-SNAPSHOT"
9+
val otelJavaAgentVersion = if (!TEST_SNAPSHOTS) otelVersion else "$otelSnapshotVersion-SNAPSHOT"
10+
\ No newline at end of line
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@@ -27,7 +27,7 @@
2+
val TEST_SNAPSHOTS = rootProject.findProperty("testUpstreamSnapshots") == "true"
3+
4+
// This is the version of the upstream instrumentation BOM
5+
-val otelVersion = "1.32.1-adot2"
6+
+val otelVersion = "1.32.1-adot-lambda1"
7+
val otelSnapshotVersion = "1.33.0"
8+
val otelAlphaVersion = if (!TEST_SNAPSHOTS) "$otelVersion-alpha" else "$otelSnapshotVersion-alpha-SNAPSHOT"
9+
val otelJavaAgentVersion = if (!TEST_SNAPSHOTS) otelVersion else "$otelSnapshotVersion-SNAPSHOT"
10+
\ No newline at end of line
863 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)