Skip to content

Commit 4122805

Browse files
ezhang6811ADOT Patch workflow
andauthored
Fix failing upstream test in PR build (#1239)
*Issue #, if available:* *Description of changes:* PR builds have been failing for the last 2+ weeks on the `Test patches applied to dependencies` job: https://github.com/aws-observability/aws-otel-java-instrumentation/actions/runs/18328141549/job/52275908381 This was due to a failing `jmx-metrics` test in the upstream opentelemetry-java-instrumentation repo that we clone and patch, where several metrics seem to be delayed and thus missing when being verified. ``` java.lang.AssertionError: Metrics expected but not received: [tomcat.session.active.count, tomcat.session.active.limit] Received only: [tomcat.network.io, tomcat.thread.busy.count, tomcat.request.duration.sum, tomcat.thread.count, tomcat.request.count, tomcat.error.count, tomcat.thread.limit, tomcat.request.duration.max] ``` I tried to build the upstream repo standalone on the release/2.18.x branch and got the same issue, confirming that our patches don't affect this. This test seems to depend on a [floating tag version](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/083d8639c634d9fb5803efd984956d870a572654/instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/TomcatIntegrationTest.java#L27) of the Tomcat docker image which new changes can be pushed to. Add a temporary patch fix to skip the old Tomcat 9.0 dependency where the test failure is happening. **We can remove this after bumping the opentelemetry-java-instrumentation dependency**, as the error is fixed in future versions. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: ADOT Patch workflow <adot-patch-workflow@github.com>
1 parent ba49eef commit 4122805

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ index 98def282f8..65fd6a8a13 100644
1111
"io.opentelemetry.contrib:opentelemetry-gcp-resources:${otelContribVersion}",
1212
"io.opentelemetry.contrib:opentelemetry-cloudfoundry-resources:${otelContribVersion}",
1313
"io.opentelemetry.contrib:opentelemetry-baggage-processor:${otelContribVersion}",
14+
diff --git a/instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/TomcatIntegrationTest.java b/instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/TomcatIntegrationTest.java
15+
index 1234567890..abcdef1234 100644
16+
--- a/instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/TomcatIntegrationTest.java
17+
+++ b/instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/TomcatIntegrationTest.java
18+
@@ -20,8 +20,8 @@ public class TomcatIntegrationTest extends TargetSystemTest {
19+
20+
@ParameterizedTest
21+
@CsvSource({
22+
+ // TODO: Remove this patch after we no longer depend on 2.18.1 of opentelemetry-java-instrumentation.
23+
"tomcat:10.0, https://tomcat.apache.org/tomcat-10.0-doc/appdev/sample/sample.war",
24+
- "tomcat:9.0, https://tomcat.apache.org/tomcat-9.0-doc/appdev/sample/sample.war"
25+
})
26+
void testCollectedMetrics(String dockerImageName, String sampleWebApplicationUrl)
27+
throws Exception {
1428
diff --git a/version.gradle.kts b/version.gradle.kts
1529
index 023d04703c..ec9690086c 100644
1630
--- a/version.gradle.kts
@@ -25,4 +39,3 @@ index 023d04703c..ec9690086c 100644
2539
if (findProperty("otel.stable") != "true") {
2640
--
2741
2.45.1
28-

0 commit comments

Comments
 (0)