You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/07/22 12:05:56 UTC

(pulsar) 16/16: [fix][ci][branch-4.0] Fix OpenTelemetrySanityTest after Otel library upgrade

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit f9345906ef898f20002ac22dbae9186789b9ab0b
Author: Lari Hotari <lh...@apache.org>
AuthorDate: Wed Jul 22 13:05:40 2026 +0300

    [fix][ci][branch-4.0] Fix OpenTelemetrySanityTest after Otel library upgrade
---
 .../pulsar/tests/integration/metrics/OpenTelemetrySanityTest.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/metrics/OpenTelemetrySanityTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/metrics/OpenTelemetrySanityTest.java
index 4e6847d17235..6f909c2fd5b7 100644
--- a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/metrics/OpenTelemetrySanityTest.java
+++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/metrics/OpenTelemetrySanityTest.java
@@ -45,6 +45,7 @@ public class OpenTelemetrySanityTest {
 
     // Validate that the OpenTelemetry metrics can be exported to a remote OpenTelemetry collector.
     @Test(timeOut = 360_000)
+    @SuppressWarnings("unchecked")
     public void testOpenTelemetryMetricsOtlpExport() throws Exception {
         var clusterName = "testOpenTelemetryMetrics-" + UUID.randomUUID();
         var openTelemetryCollectorContainer = new OpenTelemetryCollectorContainer(clusterName);
@@ -71,7 +72,7 @@ public class OpenTelemetrySanityTest {
 
         // TODO: Validate cluster name and service version are present once
         // https://github.com/open-telemetry/opentelemetry-java/issues/6108 is solved.
-        var metricName = "queueSize_ratio"; // Sent automatically by the OpenTelemetry SDK.
+        var metricName = "jvm_cpu_count"; // Configured by the OpenTelemetryService.
         waitAtMost(90, TimeUnit.SECONDS).ignoreExceptions().pollInterval(1, TimeUnit.SECONDS).until(() -> {
             var metrics = getMetricsFromPrometheus(
                     openTelemetryCollectorContainer, OpenTelemetryCollectorContainer.PROMETHEUS_EXPORTER_PORT);
@@ -95,6 +96,7 @@ public class OpenTelemetrySanityTest {
      * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#prometheus-exporter
      */
     @Test(timeOut = 360_000)
+    @SuppressWarnings("unchecked")
     public void testOpenTelemetryMetricsPrometheusExport() throws Exception {
         var prometheusExporterPort = 9464;
         var clusterName = "testOpenTelemetryMetrics-" + UUID.randomUUID();
@@ -158,6 +160,7 @@ public class OpenTelemetrySanityTest {
         return client.getMetrics();
     }
 
+    @SuppressWarnings("unchecked")
     private static Map<String, String> getOpenTelemetryProps(String exporter, Pair<String, String> ... extraProps) {
         var defaultProps = Map.of(
                 "OTEL_SDK_DISABLED", "false",