From a11891708ad6ec6b1d0c67971f2fa973ff5e823f Mon Sep 17 00:00:00 2001 From: Ryan Lubke Date: Fri, 17 Jan 2025 16:04:18 -0500 Subject: [PATCH] Bug 37492472 - [37481437->25.03] Update OpenTelemetry to latest version (merge main -> ce/main @ 113624) [git-p4: depot-paths = "//dev/coherence-ce/main/": change = 113625] --- prj/coherence-dependencies/pom.xml | 8 +++++--- prj/coherence-javadoc/pom.xml | 2 +- .../tracing/opentelemetry/OpenTelemetryScope.java | 4 ++-- .../tracing/opentelemetry/OpenTelemetryShim.java | 8 ++++---- .../opentelemetry/OpenTelemetryShimLoader.java | 11 ++++++----- .../opentelemetry/OpenTelemetrySpanContext.java | 8 ++++---- .../src/main/java/opentelemetry/core/TracingIT.java | 6 +++--- .../functional/tracing/opentelemetry/grpc/pom.xml | 4 ++-- prj/test/functional/tracing/opentelemetry/pom.xml | 4 ++-- 9 files changed, 29 insertions(+), 26 deletions(-) diff --git a/prj/coherence-dependencies/pom.xml b/prj/coherence-dependencies/pom.xml index a4e7646110940..d9354ee010283 100644 --- a/prj/coherence-dependencies/pom.xml +++ b/prj/coherence-dependencies/pom.xml @@ -240,7 +240,9 @@ 4.1.115.Final - 1.29.0 + 1.46.0 + 2.11.0-alpha + 1.0.0-alpha 0.2.3 0.33.0 @@ -363,11 +365,11 @@ io.opentelemetry.instrumentation opentelemetry-grpc-1.6 - ${opentelemetry.version}-alpha + ${opentelemetry.grpc.version} io.opentelemetry - opentelemetry-api-events + opentelemetry-api-incubator ${opentelemetry.version}-alpha diff --git a/prj/coherence-javadoc/pom.xml b/prj/coherence-javadoc/pom.xml index 9051d6bce0be5..52ba02761b87e 100644 --- a/prj/coherence-javadoc/pom.xml +++ b/prj/coherence-javadoc/pom.xml @@ -320,7 +320,7 @@ io.opentelemetry.instrumentation opentelemetry-grpc-1.6 - ${opentelemetry.version}-alpha + ${opentelemetry.grpc.version} true provided diff --git a/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryScope.java b/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryScope.java index 3aaaab955a179..5ef9f05132382 100644 --- a/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryScope.java +++ b/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryScope.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. @@ -62,7 +62,7 @@ public T underlying() // ----- data members --------------------------------------------------- /** - * The underlying {@code OpenTracing} {@link io.opentelemetry.context.Scope}. + * The underlying {@code OpenTelemetry} {@link io.opentelemetry.context.Scope}. */ protected final io.opentelemetry.context.Scope f_scope; diff --git a/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryShim.java b/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryShim.java index af636fca33ce3..7b3a243d0a84e 100644 --- a/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryShim.java +++ b/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryShim.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. @@ -17,7 +17,7 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.api.events.GlobalEventEmitterProvider; +import io.opentelemetry.api.incubator.events.GlobalEventLoggerProvider; import io.opentelemetry.api.trace.TracerProvider; @@ -87,7 +87,7 @@ public Control initialize(Dependencies dependencies) if (INTERNAL_NOOP.equals(underlying)) { GlobalOpenTelemetry.resetForTest(); - GlobalEventEmitterProvider.resetForTest(); + GlobalEventLoggerProvider.resetForTest(); } GlobalOpenTelemetry.get(); // initialize OT @@ -120,7 +120,7 @@ public synchronized void close() } GlobalOpenTelemetry.resetForTest(); - GlobalEventEmitterProvider.resetForTest(); + GlobalEventLoggerProvider.resetForTest(); GlobalOpenTelemetry.set(INTERNAL_NOOP); } } diff --git a/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryShimLoader.java b/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryShimLoader.java index d1fced0dfb10c..2f7eac7b15d16 100644 --- a/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryShimLoader.java +++ b/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetryShimLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. @@ -54,7 +54,7 @@ public TracingShim loadTracingShim() // ----- helper methods ------------------------------------------------- /** - * Ensures the expected OpenTracing classes are available and are compatible with + * Ensures the expected OpenTelemetry classes are available and are compatible with * Coherence's tracing implementation. * * @return {@code true} if the classpath looks good, otherwise {@code false} @@ -117,9 +117,10 @@ protected boolean ensureClassPresent(String sClassName, ClassLoader classLoader) * in order to enable tracing. */ protected static final Map EXPECTED_CLASSES = Map.of( - "io.opentelemetry.api.OpenTelemetry", "opentelemetry-api", - "io.opentelemetry.context.Context", "opentelemetry-context", - "io.opentelemetry.sdk.OpenTelemetrySdk", "opentracing-util"); + "io.opentelemetry.api.OpenTelemetry", "opentelemetry-api", + "io.opentelemetry.api.incubator.events.GlobalEventLoggerProvider", "opentelemetry-api-incubator", + "io.opentelemetry.context.Context", "opentelemetry-context", + "io.opentelemetry.sdk.OpenTelemetrySdk", "opentelemetry-sdk"); /** * A flag that allows the explicit disabling of OpenTelemetry. diff --git a/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetrySpanContext.java b/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetrySpanContext.java index 1fc35e9bb6991..ea36743e64734 100644 --- a/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetrySpanContext.java +++ b/prj/coherence-tracing/opentelemetry/src/main/java/com/tangosol/internal/tracing/opentelemetry/OpenTelemetrySpanContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. @@ -11,7 +11,7 @@ import java.util.Objects; /** - * {@link SpanContext} adapter for {@code OpenTracing}. + * {@link SpanContext} adapter for {@code OpenTelemetry}. * * @author rl 8.25.2023 * @since 24.03 @@ -22,7 +22,7 @@ public class OpenTelemetrySpanContext // ----- constructors --------------------------------------------------- /** - * Construct a new {@code OpenTracingSpanContext}. + * Construct a new {@code OpenTelemetrySpanContext}. * * @param spanContext the {@link io.opentelemetry.api.trace.SpanContext} delegate * @@ -104,7 +104,7 @@ public String toString() // ----- data members --------------------------------------------------- /** - * The underlying {@code OpenTracing} {@link io.opentelemetry.api.trace.SpanContext}. + * The underlying {@code OpenTelemetry} {@link io.opentelemetry.api.trace.SpanContext}. */ protected final io.opentelemetry.api.trace.SpanContext f_spanContext; diff --git a/prj/test/functional/tracing/opentelemetry/core/src/main/java/opentelemetry/core/TracingIT.java b/prj/test/functional/tracing/opentelemetry/core/src/main/java/opentelemetry/core/TracingIT.java index 4132ce8bfe0ec..28aa15fe2c544 100644 --- a/prj/test/functional/tracing/opentelemetry/core/src/main/java/opentelemetry/core/TracingIT.java +++ b/prj/test/functional/tracing/opentelemetry/core/src/main/java/opentelemetry/core/TracingIT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl. @@ -26,7 +26,7 @@ import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.api.events.GlobalEventEmitterProvider; +import io.opentelemetry.api.incubator.events.GlobalEventLoggerProvider; import io.opentelemetry.api.trace.Tracer; @@ -254,7 +254,7 @@ public void testTelemetryLifecycleNotManagedByCoherence() { propsTest.forEach((key, value) -> System.clearProperty(key.toString())); GlobalOpenTelemetry.resetForTest(); - GlobalEventEmitterProvider.resetForTest(); + GlobalEventLoggerProvider.resetForTest(); } } diff --git a/prj/test/functional/tracing/opentelemetry/grpc/pom.xml b/prj/test/functional/tracing/opentelemetry/grpc/pom.xml index 9da1a38e13745..31afdb4249b84 100644 --- a/prj/test/functional/tracing/opentelemetry/grpc/pom.xml +++ b/prj/test/functional/tracing/opentelemetry/grpc/pom.xml @@ -1,6 +1,6 @@