Skip to content

Commit b435fb1

Browse files
liustvejj22eethpierceyiyuan-heADOT Patch workflow
authored
Release/v2.11.1 (#1094)
*Description of changes:* Merges changes from mainline to v2.11.1 Namely: #1085 and #1089 ``` The following dependencies are using the latest release version: - com.sparkjava:spark-core:2.9.4 - com.squareup.okhttp3:okhttp:4.12.0 - io.opentelemetry:opentelemetry-extension-aws:1.20.1 The following dependencies have later release versions: - com.amazonaws:aws-java-sdk-bom [1.12.599 -> 1.12.785] https://aws.amazon.com/sdkforjava - com.fasterxml.jackson:jackson-bom [2.16.0 -> 2.19.0] https://github.com/FasterXML/jackson-bom - com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin [0.50.0 -> 0.52.0] - com.google.guava:guava-bom [33.0.0-jre -> 33.4.8-jre] https://github.com/google/guava - com.google.protobuf:protobuf-bom [3.25.1 -> 4.31.1] https://developers.google.com/protocol-buffers/ - com.linecorp.armeria:armeria-bom [1.26.4 -> 1.32.5] https://armeria.dev/ - commons-logging:commons-logging [1.2 -> 1.3.5] https://commons.apache.org/proper/commons-logging/ - io.grpc:grpc-bom [1.59.1 -> 1.73.0] https://github.com/grpc/grpc-java - io.opentelemetry.contrib:opentelemetry-aws-resources [1.39.0-alpha -> 1.46.0-alpha] https://github.com/open-telemetry/opentelemetry-java-contrib - io.opentelemetry.contrib:opentelemetry-aws-xray [1.39.0-adot1 -> 1.46.0] https://github.com/open-telemetry/opentelemetry-java-contrib - io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha [2.11.0-adot2-alpha -> 2.16.0-alpha] https://github.com/open-telemetry/opentelemetry-java-instrumentation - io.opentelemetry.javaagent:opentelemetry-javaagent [2.11.0-adot2 -> 2.16.0] https://github.com/open-telemetry/opentelemetry-java-instrumentation - io.opentelemetry.proto:opentelemetry-proto [1.0.0-alpha -> 1.7.0-alpha] https://github.com/open-telemetry/opentelemetry-proto-java - net.bytebuddy:byte-buddy [1.14.10 -> 1.17.5] https://bytebuddy.net - org.apache.logging.log4j:log4j-bom [2.21.1 -> 2.24.3] https://logging.apache.org/log4j/2.x/ - org.assertj:assertj-core [3.24.2 -> 3.27.3] https://assertj.github.io/doc/#assertj-core - org.curioswitch.curiostack:protobuf-jackson [2.2.0 -> 2.7.0] https://github.com/curioswitch/protobuf-jackson - org.junit:junit-bom [5.10.1 -> 5.13.0] https://junit.org/junit5/ - org.slf4j:slf4j-api [1.7.36 -> 2.0.17] http://www.slf4j.org - org.slf4j:slf4j-simple [1.7.36 -> 2.0.17] http://www.slf4j.org - org.springframework.boot:spring-boot-dependencies [2.7.17 -> 3.5.0] https://spring.io/projects/spring-boot - org.testcontainers:testcontainers-bom [1.19.3 -> 1.21.1] https://java.testcontainers.org - software.amazon.awssdk:bom [2.21.33 -> 2.31.56] https://aws.amazon.com/sdkforjava Gradle release-candidate updates: - Gradle: [8.10 -> 8.14.1] ``` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Jonathan Lee <[email protected]> Co-authored-by: Thomas Pierce <[email protected]> Co-authored-by: Michael He <[email protected]> Co-authored-by: ADOT Patch workflow <[email protected]> Co-authored-by: Prashant Srivastava <[email protected]> Co-authored-by: Mohamed Asaker <[email protected]>
1 parent 60cab1e commit b435fb1

File tree

15 files changed

+571
-18
lines changed

15 files changed

+571
-18
lines changed
Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplier.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplier.java
2+
index 1ef8abf..ef84f35 100644
3+
--- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplier.java
4+
+++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplier.java
5+
@@ -35,6 +35,11 @@ final class SamplingRuleApplier {
6+
7+
private static final Map<String, String> XRAY_CLOUD_PLATFORM;
8+
9+
+ private static final AttributeKey<String> URL_PATH = AttributeKey.stringKey("url.path");
10+
+ private static final AttributeKey<String> URL_FULL = AttributeKey.stringKey("url.full");
11+
+ private static final AttributeKey<String> HTTP_REQUEST_METHOD =
12+
+ AttributeKey.stringKey("http.request.method");
13+
+
14+
static {
15+
Map<String, String> xrayCloudPlatform = new HashMap<>();
16+
xrayCloudPlatform.put(ResourceAttributes.CloudPlatformValues.AWS_EC2, "AWS::EC2::Instance");
17+
@@ -162,11 +167,14 @@ final class SamplingRuleApplier {
18+
String host = null;
19+
20+
for (Map.Entry<AttributeKey<?>, Object> entry : attributes.asMap().entrySet()) {
21+
- if (entry.getKey().equals(SemanticAttributes.HTTP_TARGET)) {
22+
+ if (entry.getKey().equals(SemanticAttributes.HTTP_TARGET)
23+
+ || entry.getKey().equals(URL_PATH)) {
24+
httpTarget = (String) entry.getValue();
25+
- } else if (entry.getKey().equals(SemanticAttributes.HTTP_URL)) {
26+
+ } else if (entry.getKey().equals(SemanticAttributes.HTTP_URL)
27+
+ || entry.getKey().equals(URL_FULL)) {
28+
httpUrl = (String) entry.getValue();
29+
- } else if (entry.getKey().equals(SemanticAttributes.HTTP_METHOD)) {
30+
+ } else if (entry.getKey().equals(SemanticAttributes.HTTP_METHOD)
31+
+ || entry.getKey().equals(HTTP_REQUEST_METHOD)) {
32+
httpMethod = (String) entry.getValue();
33+
} else if (entry.getKey().equals(SemanticAttributes.NET_HOST_NAME)) {
34+
host = (String) entry.getValue();
35+
diff --git a/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplierTest.java b/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplierTest.java
36+
index 6bb6e82..55dabbd 100644
37+
--- a/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplierTest.java
38+
+++ b/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplierTest.java
39+
@@ -42,6 +42,11 @@ class SamplingRuleApplierTest {
40+
41+
private static final String CLIENT_ID = "test-client-id";
42+
43+
+ private static final AttributeKey<String> URL_PATH = AttributeKey.stringKey("url.path");
44+
+ private static final AttributeKey<String> URL_FULL = AttributeKey.stringKey("url.full");
45+
+ private static final AttributeKey<String> HTTP_REQUEST_METHOD =
46+
+ AttributeKey.stringKey("http.request.method");
47+
+
48+
@Nested
49+
@SuppressWarnings("ClassCanBeStatic")
50+
class ExactMatch {
51+
@@ -68,6 +73,15 @@ class SamplingRuleApplierTest {
52+
.put(AttributeKey.longKey("speed"), 10)
53+
.build();
54+
55+
+ private final Attributes newSemCovAttributes =
56+
+ Attributes.builder()
57+
+ .put(HTTP_REQUEST_METHOD, "GET")
58+
+ .put(SemanticAttributes.NET_HOST_NAME, "opentelemetry.io")
59+
+ .put(URL_PATH, "/instrument-me")
60+
+ .put(AttributeKey.stringKey("animal"), "cat")
61+
+ .put(AttributeKey.longKey("speed"), 10)
62+
+ .build();
63+
+
64+
// FixedRate set to 1.0 in rule and no reservoir
65+
@Test
66+
void fixedRateAlwaysSample() {
67+
@@ -116,6 +130,21 @@ class SamplingRuleApplierTest {
68+
.isTrue();
69+
}
70+
71+
+ @Test
72+
+ void matchesURLFullNewSemCov() {
73+
+ assertThat(applier.matches(newSemCovAttributes, resource)).isTrue();
74+
+
75+
+ // http.url works too
76+
+ assertThat(
77+
+ applier.matches(
78+
+ attributes.toBuilder()
79+
+ .remove(URL_FULL)
80+
+ .put(URL_FULL, "scheme://host:port/instrument-me")
81+
+ .build(),
82+
+ resource))
83+
+ .isTrue();
84+
+ }
85+
+
86+
@Test
87+
void serviceNameNotMatch() {
88+
assertThat(
89+
@@ -137,6 +166,13 @@ class SamplingRuleApplierTest {
90+
assertThat(applier.matches(attributes, resource)).isFalse();
91+
}
92+
93+
+ @Test
94+
+ void methodNewSemCovNotMatch() {
95+
+ Attributes attributes =
96+
+ this.newSemCovAttributes.toBuilder().put(HTTP_REQUEST_METHOD, "POST").build();
97+
+ assertThat(applier.matches(attributes, resource)).isFalse();
98+
+ }
99+
+
100+
@Test
101+
void hostNotMatch() {
102+
// Replacing dot with character makes sure we're not accidentally treating dot as regex
103+
@@ -178,6 +214,34 @@ class SamplingRuleApplierTest {
104+
assertThat(applier.matches(attributes, resource)).isFalse();
105+
}
106+
107+
+ @Test
108+
+ void pathNewSemCovNotMatch() {
109+
+ Attributes attributes =
110+
+ this.newSemCovAttributes.toBuilder().put(URL_PATH, "/instrument-you").build();
111+
+ assertThat(applier.matches(attributes, resource)).isFalse();
112+
+ attributes =
113+
+ this.newSemCovAttributes.toBuilder()
114+
+ .remove(URL_PATH)
115+
+ .put(URL_FULL, "scheme://host:port/instrument-you")
116+
+ .build();
117+
+ assertThat(applier.matches(attributes, resource)).isFalse();
118+
+ attributes =
119+
+ this.newSemCovAttributes.toBuilder()
120+
+ .remove(URL_PATH)
121+
+ .put(URL_FULL, "scheme://host:port")
122+
+ .build();
123+
+ assertThat(applier.matches(attributes, resource)).isFalse();
124+
+
125+
+ // Correct path, but we ignore anyways since the URL is malformed per spec, scheme is always
126+
+ // present.
127+
+ attributes =
128+
+ this.newSemCovAttributes.toBuilder()
129+
+ .remove(URL_PATH)
130+
+ .put(URL_FULL, "host:port/instrument-me")
131+
+ .build();
132+
+ assertThat(applier.matches(attributes, resource)).isFalse();
133+
+ }
134+
+
135+
@Test
136+
void attributeNotMatch() {
137+
Attributes attributes =
138+
@@ -243,6 +307,15 @@ class SamplingRuleApplierTest {
139+
.put(AttributeKey.longKey("speed"), 10)
140+
.build();
141+
142+
+ private final Attributes newSemCovAttributes =
143+
+ Attributes.builder()
144+
+ .put(HTTP_REQUEST_METHOD, "GET")
145+
+ .put(SemanticAttributes.NET_HOST_NAME, "opentelemetry.io")
146+
+ .put(URL_PATH, "/instrument-me?foo=bar&cat=meow")
147+
+ .put(AttributeKey.stringKey("animal"), "cat")
148+
+ .put(AttributeKey.longKey("speed"), 10)
149+
+ .build();
150+
+
151+
// FixedRate set to 0.0 in rule and no reservoir
152+
@Test
153+
void fixedRateNeverSample() {
154+
@@ -329,6 +402,26 @@ class SamplingRuleApplierTest {
155+
assertThat(applier.matches(attributes, resource)).isFalse();
156+
}
157+
158+
+ @Test
159+
+ void newSemCovMethodMatches() {
160+
+ Attributes attributes =
161+
+ this.newSemCovAttributes.toBuilder().put(HTTP_REQUEST_METHOD, "BADGETGOOD").build();
162+
+ assertThat(applier.matches(attributes, resource)).isTrue();
163+
+ attributes = newSemCovAttributes.toBuilder().put(HTTP_REQUEST_METHOD, "BADGET").build();
164+
+ assertThat(applier.matches(attributes, resource)).isTrue();
165+
+ attributes = newSemCovAttributes.toBuilder().put(HTTP_REQUEST_METHOD, "GETGET").build();
166+
+ assertThat(applier.matches(attributes, resource)).isTrue();
167+
+ }
168+
+
169+
+ @Test
170+
+ void newSemCovMethodNotMatch() {
171+
+ Attributes attributes =
172+
+ newSemCovAttributes.toBuilder().put(HTTP_REQUEST_METHOD, "POST").build();
173+
+ assertThat(applier.matches(attributes, resource)).isFalse();
174+
+ attributes = removeAttribute(newSemCovAttributes, HTTP_REQUEST_METHOD);
175+
+ assertThat(applier.matches(attributes, resource)).isFalse();
176+
+ }
177+
+
178+
@Test
179+
void hostMatches() {
180+
Attributes attributes =
181+
@@ -410,6 +503,29 @@ class SamplingRuleApplierTest {
182+
assertThat(applier.matches(attributes, resource)).isFalse();
183+
}
184+
185+
+ @Test
186+
+ void pathNewSemCovMatches() {
187+
+ Attributes attributes =
188+
+ newSemCovAttributes.toBuilder().put(URL_PATH, "/instrument-me?foo=bar&cat=").build();
189+
+ assertThat(applier.matches(attributes, resource)).isTrue();
190+
+ // Deceptive question mark, it's actually a wildcard :-)
191+
+ attributes =
192+
+ newSemCovAttributes.toBuilder().put(URL_PATH, "/instrument-meafoo=bar&cat=").build();
193+
+ assertThat(applier.matches(attributes, resource)).isTrue();
194+
+ }
195+
+
196+
+ @Test
197+
+ void pathNewSemCovNotMatch() {
198+
+ Attributes attributes =
199+
+ newSemCovAttributes.toBuilder().put(URL_PATH, "/instrument-mea?foo=bar&cat=").build();
200+
+ assertThat(applier.matches(attributes, resource)).isFalse();
201+
+ attributes =
202+
+ newSemCovAttributes.toBuilder().put(URL_PATH, "foo/instrument-meafoo=bar&cat=").build();
203+
+ assertThat(applier.matches(attributes, resource)).isFalse();
204+
+ attributes = removeAttribute(newSemCovAttributes, URL_PATH);
205+
+ assertThat(applier.matches(attributes, resource)).isFalse();
206+
+ }
207+
+
208+
@Test
209+
void attributeMatches() {
210+
Attributes attributes =
211+
diff --git a/disk-buffering/build.gradle.kts b/disk-buffering/build.gradle.kts
212+
index 041d2e9..e3d60f4 100644
213+
--- a/disk-buffering/build.gradle.kts
214+
+++ b/disk-buffering/build.gradle.kts
215+
@@ -70,6 +70,10 @@ tasks.named<ShadowJar>("shadowJar") {
216+
mustRunAfter("jar")
217+
}
218+
219+
+tasks.withType<Test>().configureEach {
220+
+ dependsOn("shadowJar")
221+
+}
222+
+
223+
// The javadoc from wire's generated classes has errors that make the task that generates the "javadoc" artifact to fail. This
224+
// makes the javadoc task to ignore those generated classes.
225+
tasks.withType(Javadoc::class.java) {
226+
diff --git a/version.gradle.kts b/version.gradle.kts
227+
index acefcee..329b524 100644
228+
--- a/version.gradle.kts
229+
+++ b/version.gradle.kts
230+
@@ -1,5 +1,5 @@
231+
-val stableVersion = "1.39.0"
232+
-val alphaVersion = "1.39.0-alpha"
233+
+val stableVersion = "1.39.0-adot1"
234+
+val alphaVersion = "1.39.0-alpha-adot1"
235+
236+
allprojects {
237+
if (findProperty("otel.stable") != "true") {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3573,8 +3573,8 @@ index a1cae43b4b..c1520e9947 100644
35733573
@@ -1,5 +1,5 @@
35743574
-val stableVersion = "2.11.0"
35753575
-val alphaVersion = "2.11.0-alpha"
3576-
+val stableVersion = "2.11.0-adot1"
3577-
+val alphaVersion = "2.11.0-adot1-alpha"
3576+
+val stableVersion = "2.11.0-adot2"
3577+
+val alphaVersion = "2.11.0-adot2-alpha"
35783578

35793579
allprojects {
35803580
if (findProperty("otel.stable") != "true") {

.github/patches/versions

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

.github/workflows/owasp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ jobs:
9797
id: high_scan_v2
9898
uses: ./.github/actions/image_scan
9999
with:
100-
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v2.10.0"
100+
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v2.11.0"
101101
severity: 'CRITICAL,HIGH'
102102

103103
- name: Perform low image scan on v2
104104
if: always()
105105
id: low_scan_v2
106106
uses: ./.github/actions/image_scan
107107
with:
108-
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v2.10.0"
108+
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v2.11.0"
109109
severity: 'MEDIUM,LOW,UNKNOWN'
110110

111111
- name: Configure AWS Credentials for emitting metrics

.github/workflows/release-udp-exporter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ jobs:
6565
--title "Release aws-distro-opentelemetry-xray-udp-span-exporter v${{ inputs.udp-exporter-version }}" \
6666
--notes "Please refer to the [Changelog](https://github.com/aws-observability/aws-otel-java-instrumentation/blob/main/exporters/aws-distro-opentelemetry-xray-udp-span-exporter/CHANGELOG.md) for more details" \
6767
--draft \
68-
"v${{ inputs.udp-exporter-version }}"
68+
"aws-distro-opentelemetry-xray-udp-span-exporter/v${{ inputs.udp-exporter-version }}"

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsApplicationSignalsCustomizerProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
public final class AwsApplicationSignalsCustomizerProvider
7878
implements AutoConfigurationCustomizerProvider {
7979
static final String AWS_LAMBDA_FUNCTION_NAME_CONFIG = "AWS_LAMBDA_FUNCTION_NAME";
80+
static final String LAMBDA_APPLICATION_SIGNALS_REMOTE_ENVIRONMENT =
81+
"LAMBDA_APPLICATION_SIGNALS_REMOTE_ENVIRONMENT";
8082

8183
private static final Duration DEFAULT_METRIC_EXPORT_INTERVAL = Duration.ofMinutes(1);
8284
private static final Logger logger =

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsAttributeKeys.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ private AwsAttributeKeys() {}
3232
static final AttributeKey<String> AWS_REMOTE_SERVICE =
3333
AttributeKey.stringKey("aws.remote.service");
3434

35+
static final AttributeKey<String> AWS_REMOTE_ENVIRONMENT =
36+
AttributeKey.stringKey("aws.remote.environment");
37+
3538
static final AttributeKey<String> AWS_REMOTE_OPERATION =
3639
AttributeKey.stringKey("aws.remote.operation");
3740

@@ -64,6 +67,9 @@ private AwsAttributeKeys() {}
6467
static final AttributeKey<String> AWS_SECRET_ARN =
6568
AttributeKey.stringKey("aws.secretsmanager.secret.arn");
6669

70+
static final AttributeKey<String> AWS_LAMBDA_NAME =
71+
AttributeKey.stringKey("aws.lambda.function.name");
72+
6773
static final AttributeKey<String> AWS_LAMBDA_ARN =
6874
AttributeKey.stringKey("aws.lambda.function.arn");
6975

0 commit comments

Comments
 (0)