diff --git a/conventions/src/main/kotlin/io.opentelemetry.instrumentation.javaagent-testing.gradle.kts b/conventions/src/main/kotlin/io.opentelemetry.instrumentation.javaagent-testing.gradle.kts index f21aeffc9000..d06428c99f16 100644 --- a/conventions/src/main/kotlin/io.opentelemetry.instrumentation.javaagent-testing.gradle.kts +++ b/conventions/src/main/kotlin/io.opentelemetry.instrumentation.javaagent-testing.gradle.kts @@ -25,14 +25,10 @@ dependencies { compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api") { // OpenTelemetry SDK is not needed for compilation exclude(group = "io.opentelemetry", module = "opentelemetry-sdk") - exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-metrics") - exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-logs") } compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling") { // OpenTelemetry SDK is not needed for compilation exclude(group = "io.opentelemetry", module = "opentelemetry-sdk") - exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-metrics") - exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-logs") } // Used by byte-buddy but not brought in as a transitive dependency diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 912d6a18bac2..9612a927c3c3 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -12,7 +12,7 @@ val dependencyVersions = hashMapOf() rootProject.extra["versions"] = dependencyVersions // this line is managed by .github/scripts/update-sdk-version.sh -val otelSdkVersion = "1.26.0" +val otelSdkVersion = "1.27.0" val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1") // Need both BOM and groovy jars diff --git a/examples/distro/agent/build.gradle b/examples/distro/agent/build.gradle index f2d10b847995..dab66be0c884 100644 --- a/examples/distro/agent/build.gradle +++ b/examples/distro/agent/build.gradle @@ -74,7 +74,6 @@ tasks { dependencies { exclude("io.opentelemetry:opentelemetry-api") exclude("io.opentelemetry:opentelemetry-api-events") - exclude("io.opentelemetry:opentelemetry-api-logs") exclude("io.opentelemetry:opentelemetry-context") exclude("io.opentelemetry:opentelemetry-semconv") // metrics advice API diff --git a/examples/distro/build.gradle b/examples/distro/build.gradle index 0737cc204597..70a50c9ffd80 100644 --- a/examples/distro/build.gradle +++ b/examples/distro/build.gradle @@ -27,7 +27,7 @@ subprojects { ext { versions = [ // this line is managed by .github/scripts/update-sdk-version.sh - opentelemetrySdk : "1.26.0", + opentelemetrySdk : "1.27.0", // these lines are managed by .github/scripts/update-version.sh opentelemetryJavaagent : "1.27.0-SNAPSHOT", diff --git a/examples/distro/testing/agent-for-testing/build.gradle b/examples/distro/testing/agent-for-testing/build.gradle index 72a54b0b62bc..47dae7e74019 100644 --- a/examples/distro/testing/agent-for-testing/build.gradle +++ b/examples/distro/testing/agent-for-testing/build.gradle @@ -71,7 +71,6 @@ tasks { dependencies { exclude("io.opentelemetry:opentelemetry-api") exclude("io.opentelemetry:opentelemetry-api-events") - exclude("io.opentelemetry:opentelemetry-api-logs") exclude("io.opentelemetry:opentelemetry-context") exclude("io.opentelemetry:opentelemetry-semconv") // metrics advice API diff --git a/instrumentation-annotations-support/build.gradle.kts b/instrumentation-annotations-support/build.gradle.kts index 4d9c296060b8..b64c96857519 100644 --- a/instrumentation-annotations-support/build.gradle.kts +++ b/instrumentation-annotations-support/build.gradle.kts @@ -17,6 +17,5 @@ dependencies { annotationProcessor("com.google.auto.value:auto-value") testImplementation(project(":testing-common")) - testImplementation("io.opentelemetry:opentelemetry-sdk-metrics") testImplementation("io.opentelemetry:opentelemetry-sdk-testing") } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java index a3b3100bee9c..6cfe85d8465b 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java @@ -67,10 +67,6 @@ public static MessagingAttributesExtractorBuilder { @Nullable String getSystem(REQUEST request); + /** + * @deprecated This method is deprecated and will be removed in a future release. There is no + * replacement for this concept. + */ @Nullable - String getDestinationKind(REQUEST request); + @Deprecated + default String getDestinationKind(REQUEST request) { + return null; + } @Nullable String getDestination(REQUEST request); diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java index 70b8094e9c24..d98fde90fb06 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java @@ -63,7 +63,6 @@ void shouldExtractAllAvailableAttributes( // then List, Object>> expectedEntries = new ArrayList<>(); expectedEntries.add(entry(SemanticAttributes.MESSAGING_SYSTEM, "myQueue")); - expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic")); expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_NAME, expectedDestination)); if (temporary) { expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY, true)); @@ -118,11 +117,6 @@ public String getSystem(Map request) { return request.get("system"); } - @Override - public String getDestinationKind(Map request) { - return request.get("destinationKind"); - } - @Override public String getDestination(Map request) { return request.get("destination"); diff --git a/instrumentation-api/build.gradle.kts b/instrumentation-api/build.gradle.kts index 572e5d91aff1..ec73a8ed0c2f 100644 --- a/instrumentation-api/build.gradle.kts +++ b/instrumentation-api/build.gradle.kts @@ -19,7 +19,6 @@ dependencies { annotationProcessor("com.google.auto.value:auto-value") testImplementation(project(":testing-common")) - testImplementation("io.opentelemetry:opentelemetry-sdk-metrics") testImplementation("io.opentelemetry:opentelemetry-sdk-testing") testImplementation("org.junit-pioneer:junit-pioneer") diff --git a/instrumentation/camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/KafkaSpanDecorator.java b/instrumentation/camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/KafkaSpanDecorator.java index 04cdfd23e944..9efd4f9e7c2e 100644 --- a/instrumentation/camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/KafkaSpanDecorator.java +++ b/instrumentation/camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/KafkaSpanDecorator.java @@ -61,7 +61,6 @@ public void pre( super.pre(attributes, exchange, endpoint, camelDirection); attributes.put(SemanticAttributes.MESSAGING_OPERATION, "process"); - attributes.put(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"); Integer partition = exchange.getIn().getHeader(PARTITION, Integer.class); if (partition != null) { diff --git a/instrumentation/java-util-logging/javaagent/build.gradle.kts b/instrumentation/java-util-logging/javaagent/build.gradle.kts index fd5f1a23bc5e..8169390cc18e 100644 --- a/instrumentation/java-util-logging/javaagent/build.gradle.kts +++ b/instrumentation/java-util-logging/javaagent/build.gradle.kts @@ -5,7 +5,6 @@ plugins { dependencies { compileOnly(project(":instrumentation:java-util-logging:shaded-stub-for-instrumenting")) - compileOnly("io.opentelemetry:opentelemetry-api-logs") compileOnly(project(":javaagent-bootstrap")) // ensure no cross interference diff --git a/instrumentation/java-util-logging/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingHelper.java b/instrumentation/java-util-logging/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingHelper.java index 68a1f32cf4b7..bc9867c2160e 100644 --- a/instrumentation/java-util-logging/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingHelper.java +++ b/instrumentation/java-util-logging/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingHelper.java @@ -6,9 +6,9 @@ package io.opentelemetry.javaagent.instrumentation.jul; import application.java.util.logging.Logger; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.api.logs.LogRecordBuilder; import io.opentelemetry.api.logs.Severity; import io.opentelemetry.context.Context; @@ -41,7 +41,11 @@ public static void capture(Logger logger, LogRecord logRecord) { instrumentationName = "ROOT"; } LogRecordBuilder builder = - GlobalLoggerProvider.get().loggerBuilder(instrumentationName).build().logRecordBuilder(); + GlobalOpenTelemetry.get() + .getLogsBridge() + .loggerBuilder(instrumentationName) + .build() + .logRecordBuilder(); mapLogRecord(builder, logRecord); builder.emit(); } @@ -81,7 +85,7 @@ private static void mapLogRecord(LogRecordBuilder builder, LogRecord logRecord) Throwable throwable = logRecord.getThrown(); if (throwable != null) { // TODO (trask) extract method for recording exception into - // io.opentelemetry:opentelemetry-api-logs + // io.opentelemetry:opentelemetry-api attributes.put(SemanticAttributes.EXCEPTION_TYPE, throwable.getClass().getName()); attributes.put(SemanticAttributes.EXCEPTION_MESSAGE, throwable.getMessage()); StringWriter writer = new StringWriter(); diff --git a/instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java b/instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java index 5122483f5552..aec5d7a342d3 100644 --- a/instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java +++ b/instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java @@ -5,7 +5,7 @@ package io.opentelemetry.javaagent.instrumentation.jul; -import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat; +import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; diff --git a/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/build.gradle.kts b/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/build.gradle.kts index f49b71cbad85..387c0000e008 100644 --- a/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/build.gradle.kts +++ b/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/build.gradle.kts @@ -14,7 +14,6 @@ muzzle { dependencies { library("org.jboss.logmanager:jboss-logmanager:1.1.0.GA") - compileOnly("io.opentelemetry:opentelemetry-api-logs") compileOnly(project(":javaagent-bootstrap")) // ensure no cross interference diff --git a/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/LoggingEventMapper.java b/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/LoggingEventMapper.java index dc962bfc7797..5bbe19c51ce9 100644 --- a/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/LoggingEventMapper.java +++ b/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/LoggingEventMapper.java @@ -7,10 +7,10 @@ import static java.util.Collections.emptyList; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.api.logs.LogRecordBuilder; import io.opentelemetry.api.logs.Severity; import io.opentelemetry.context.Context; @@ -58,7 +58,11 @@ public void capture(Logger logger, ExtLogRecord record) { } LogRecordBuilder builder = - GlobalLoggerProvider.get().loggerBuilder(instrumentationName).build().logRecordBuilder(); + GlobalOpenTelemetry.get() + .getLogsBridge() + .loggerBuilder(instrumentationName) + .build() + .logRecordBuilder(); String message = record.getFormattedMessage(); if (message != null) { @@ -76,7 +80,7 @@ public void capture(Logger logger, ExtLogRecord record) { Throwable throwable = record.getThrown(); if (throwable != null) { // TODO (trask) extract method for recording exception into - // io.opentelemetry:opentelemetry-api-logs + // io.opentelemetry:opentelemetry-api attributes.put(SemanticAttributes.EXCEPTION_TYPE, throwable.getClass().getName()); attributes.put(SemanticAttributes.EXCEPTION_MESSAGE, throwable.getMessage()); StringWriter writer = new StringWriter(); diff --git a/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/JbossLogmanagerTest.java b/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/JbossLogmanagerTest.java index e716a541a5f8..cd3268443659 100644 --- a/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/JbossLogmanagerTest.java +++ b/instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/JbossLogmanagerTest.java @@ -5,7 +5,7 @@ package io.opentelemetry.javaagent.instrumentation.jbosslogmanager.appender.v1_1; -import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat; +import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; import static org.assertj.core.api.Assertions.assertThat; diff --git a/instrumentation/jms/jms-1.1/javaagent/src/jms2Test/groovy/Jms2Test.groovy b/instrumentation/jms/jms-1.1/javaagent/src/jms2Test/groovy/Jms2Test.groovy index ccf6b7a7fba3..770586e3cf87 100644 --- a/instrumentation/jms/jms-1.1/javaagent/src/jms2Test/groovy/Jms2Test.groovy +++ b/instrumentation/jms/jms-1.1/javaagent/src/jms2Test/groovy/Jms2Test.groovy @@ -81,7 +81,7 @@ class Jms2Test extends AgentInstrumentationSpecification { server.stop() } - def "sending a message to #destinationName #destinationType generates spans"() { + def "sending a message to #destinationName generates spans"() { setup: def producer = session.createProducer(destination) def consumer = session.createConsumer(destination) @@ -104,7 +104,7 @@ class Jms2Test extends AgentInstrumentationSpecification { name "producer parent" hasNoParent() } - producerSpan(it, 1, destinationType, destinationName, span(0)) + producerSpan(it, 1, destinationName, span(0)) producerSpanData = span(1) } @@ -113,7 +113,7 @@ class Jms2Test extends AgentInstrumentationSpecification { name "consumer parent" hasNoParent() } - consumerSpan(it, 1, destinationType, destinationName, messageId, "receive", span(0), producerSpanData) + consumerSpan(it, 1, destinationName, messageId, "receive", span(0), producerSpanData) } } @@ -122,14 +122,14 @@ class Jms2Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" - session.createTemporaryQueue() | "queue" | "(temporary)" - session.createTemporaryTopic() | "topic" | "(temporary)" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" + session.createTemporaryQueue() | "(temporary)" + session.createTemporaryTopic() | "(temporary)" } - def "sending to a MessageListener on #destinationName #destinationType generates a span"() { + def "sending to a MessageListener on #destinationName generates a span"() { setup: def lock = new CountDownLatch(1) def messageRef = new AtomicReference() @@ -155,8 +155,8 @@ class Jms2Test extends AgentInstrumentationSpecification { name "parent" hasNoParent() } - producerSpan(it, 1, destinationType, destinationName, span(0)) - consumerSpan(it, 2, destinationType, destinationName, messageRef.get().getJMSMessageID(), "process", span(1)) + producerSpan(it, 1, destinationName, span(0)) + consumerSpan(it, 2, destinationName, messageRef.get().getJMSMessageID(), "process", span(1)) } } // This check needs to go after all traces have been accounted for @@ -167,14 +167,14 @@ class Jms2Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" - session.createTemporaryQueue() | "queue" | "(temporary)" - session.createTemporaryTopic() | "topic" | "(temporary)" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" + session.createTemporaryQueue() | "(temporary)" + session.createTemporaryTopic() | "(temporary)" } - def "failing to receive message with receiveNoWait on #destinationName #destinationType works"() { + def "failing to receive message with receiveNoWait on #destinationName works"() { setup: def consumer = session.createConsumer(destination) @@ -190,12 +190,12 @@ class Jms2Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" } - def "failing to receive message with wait(timeout) on #destinationName #destinationType works"() { + def "failing to receive message with wait(timeout) on #destinationName works"() { setup: def consumer = session.createConsumer(destination) @@ -211,12 +211,12 @@ class Jms2Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" } - def "sending a message to #destinationName #destinationType with explicit destination propagates context"() { + def "sending a message to #destinationName with explicit destination propagates context"() { given: def producer = session.createProducer(null) def consumer = session.createConsumer(destination) @@ -244,8 +244,8 @@ class Jms2Test extends AgentInstrumentationSpecification { name "parent" hasNoParent() } - producerSpan(it, 1, destinationType, destinationName, span(0)) - consumerSpan(it, 2, destinationType, destinationName, messageRef.get().getJMSMessageID(), "process", span(1)) + producerSpan(it, 1, destinationName, span(0)) + consumerSpan(it, 2, destinationName, messageRef.get().getJMSMessageID(), "process", span(1)) } } // This check needs to go after all traces have been accounted for @@ -256,14 +256,14 @@ class Jms2Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" - session.createTemporaryQueue() | "queue" | "(temporary)" - session.createTemporaryTopic() | "topic" | "(temporary)" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" + session.createTemporaryQueue() | "(temporary)" + session.createTemporaryTopic() | "(temporary)" } - static producerSpan(TraceAssert trace, int index, String destinationType, String destinationName, SpanData parentSpan = null) { + static producerSpan(TraceAssert trace, int index, String destinationName, SpanData parentSpan = null) { trace.span(index) { name destinationName + " send" kind PRODUCER @@ -275,7 +275,6 @@ class Jms2Test extends AgentInstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "jms" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType if (destinationName == "(temporary)") { "$SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY" true } @@ -287,7 +286,7 @@ class Jms2Test extends AgentInstrumentationSpecification { // passing messageId = null will verify message.id is not captured, // passing messageId = "" will verify message.id is captured (but won't verify anything about the value), // any other value for messageId will verify that message.id is captured and has that same value - static consumerSpan(TraceAssert trace, int index, String destinationType, String destinationName, String messageId, String operation, SpanData parentSpan, SpanData linkedSpan = null) { + static consumerSpan(TraceAssert trace, int index, String destinationName, String messageId, String operation, SpanData parentSpan, SpanData linkedSpan = null) { trace.span(index) { name destinationName + " " + operation kind CONSUMER @@ -304,7 +303,6 @@ class Jms2Test extends AgentInstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "jms" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType "$SemanticAttributes.MESSAGING_OPERATION" operation if (messageId != null) { //In some tests we don't know exact messageId, so we pass "" and verify just the existence of the attribute diff --git a/instrumentation/jms/jms-1.1/javaagent/src/test/groovy/Jms1Test.groovy b/instrumentation/jms/jms-1.1/javaagent/src/test/groovy/Jms1Test.groovy index 1dfb21e511d3..330dc33851df 100644 --- a/instrumentation/jms/jms-1.1/javaagent/src/test/groovy/Jms1Test.groovy +++ b/instrumentation/jms/jms-1.1/javaagent/src/test/groovy/Jms1Test.groovy @@ -56,7 +56,7 @@ class Jms1Test extends AgentInstrumentationSpecification { broker.stop() } - def "sending a message to #destinationName #destinationType generates spans"() { + def "sending a message to #destinationName generates spans"() { setup: def producer = session.createProducer(destination) def consumer = session.createConsumer(destination) @@ -79,7 +79,7 @@ class Jms1Test extends AgentInstrumentationSpecification { name "producer parent" hasNoParent() } - producerSpan(it, 1, destinationType, destinationName, span(0)) + producerSpan(it, 1, destinationName, span(0)) producerSpanData = span(1) } @@ -88,7 +88,7 @@ class Jms1Test extends AgentInstrumentationSpecification { name "consumer parent" hasNoParent() } - consumerSpan(it, 1, destinationType, destinationName, messageId, "receive", span(0), producerSpanData) + consumerSpan(it, 1, destinationName, messageId, "receive", span(0), producerSpanData) } } @@ -97,14 +97,14 @@ class Jms1Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" - session.createTemporaryQueue() | "queue" | "(temporary)" - session.createTemporaryTopic() | "topic" | "(temporary)" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" + session.createTemporaryQueue() | "(temporary)" + session.createTemporaryTopic() | "(temporary)" } - def "sending to a MessageListener on #destinationName #destinationType generates a span"() { + def "sending to a MessageListener on #destinationName generates a span"() { setup: def lock = new CountDownLatch(1) def messageRef = new AtomicReference() @@ -124,8 +124,8 @@ class Jms1Test extends AgentInstrumentationSpecification { expect: assertTraces(1) { trace(0, 2) { - producerSpan(it, 0, destinationType, destinationName) - consumerSpan(it, 1, destinationType, destinationName, messageRef.get().getJMSMessageID(), "process", span(0)) + producerSpan(it, 0, destinationName) + consumerSpan(it, 1, destinationName, messageRef.get().getJMSMessageID(), "process", span(0)) } } // This check needs to go after all traces have been accounted for @@ -136,14 +136,14 @@ class Jms1Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" - session.createTemporaryQueue() | "queue" | "(temporary)" - session.createTemporaryTopic() | "topic" | "(temporary)" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" + session.createTemporaryQueue() | "(temporary)" + session.createTemporaryTopic() | "(temporary)" } - def "failing to receive message with receiveNoWait on #destinationName #destinationType works"() { + def "failing to receive message with receiveNoWait on #destinationName works"() { setup: def consumer = session.createConsumer(destination) @@ -159,12 +159,12 @@ class Jms1Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" } - def "failing to receive message with wait(timeout) on #destinationName #destinationType works"() { + def "failing to receive message with wait(timeout) on #destinationName works"() { setup: def consumer = session.createConsumer(destination) @@ -180,12 +180,12 @@ class Jms1Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" } - def "sending a read-only message to #destinationName #destinationType fails"() { + def "sending a read-only message to #destinationName fails"() { setup: def producer = session.createProducer(destination) def consumer = session.createConsumer(destination) @@ -208,10 +208,10 @@ class Jms1Test extends AgentInstrumentationSpecification { // The consumer span will also not be linked to the parent. assertTraces(2) { trace(0, 1) { - producerSpan(it, 0, destinationType, destinationName) + producerSpan(it, 0, destinationName) } trace(1, 1) { - consumerSpan(it, 0, destinationType, destinationName, "", "receive", null) + consumerSpan(it, 0, destinationName, "", "receive", null) } } @@ -220,14 +220,14 @@ class Jms1Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" - session.createTemporaryQueue() | "queue" | "(temporary)" - session.createTemporaryTopic() | "topic" | "(temporary)" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" + session.createTemporaryQueue() | "(temporary)" + session.createTemporaryTopic() | "(temporary)" } - def "sending a message to #destinationName #destinationType with explicit destination propagates context"() { + def "sending a message to #destinationName with explicit destination propagates context"() { given: def producer = session.createProducer(null) def consumer = session.createConsumer(destination) @@ -255,8 +255,8 @@ class Jms1Test extends AgentInstrumentationSpecification { name "parent" hasNoParent() } - producerSpan(it, 1, destinationType, destinationName, span(0)) - consumerSpan(it, 2, destinationType, destinationName, messageRef.get().getJMSMessageID(), "process", span(1)) + producerSpan(it, 1, destinationName, span(0)) + consumerSpan(it, 2, destinationName, messageRef.get().getJMSMessageID(), "process", span(1)) } } // This check needs to go after all traces have been accounted for @@ -267,17 +267,16 @@ class Jms1Test extends AgentInstrumentationSpecification { consumer.close() where: - destination | destinationType | destinationName - session.createQueue("someQueue") | "queue" | "someQueue" - session.createTopic("someTopic") | "topic" | "someTopic" - session.createTemporaryQueue() | "queue" | "(temporary)" - session.createTemporaryTopic() | "topic" | "(temporary)" + destination | destinationName + session.createQueue("someQueue") | "someQueue" + session.createTopic("someTopic") | "someTopic" + session.createTemporaryQueue() | "(temporary)" + session.createTemporaryTopic() | "(temporary)" } def "capture message header as span attribute"() { setup: def destinationName = "someQueue" - def destinationType = "queue" def destination = session.createQueue(destinationName) def producer = session.createProducer(destination) def consumer = session.createConsumer(destination) @@ -303,7 +302,7 @@ class Jms1Test extends AgentInstrumentationSpecification { name "producer parent" hasNoParent() } - producerSpan(it, 1, destinationType, destinationName, span(0), true) + producerSpan(it, 1, destinationName, span(0), true) producerSpanData = span(1) } @@ -312,7 +311,7 @@ class Jms1Test extends AgentInstrumentationSpecification { name "consumer parent" hasNoParent() } - consumerSpan(it, 1, destinationType, destinationName, messageId, "receive", span(0), producerSpanData, true) + consumerSpan(it, 1, destinationName, messageId, "receive", span(0), producerSpanData, true) } } @@ -321,7 +320,7 @@ class Jms1Test extends AgentInstrumentationSpecification { consumer.close() } - static producerSpan(TraceAssert trace, int index, String destinationType, String destinationName, SpanData parentSpan = null, boolean testHeaders = false) { + static producerSpan(TraceAssert trace, int index, String destinationName, SpanData parentSpan = null, boolean testHeaders = false) { trace.span(index) { name destinationName + " send" kind PRODUCER @@ -333,7 +332,6 @@ class Jms1Test extends AgentInstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "jms" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType if (destinationName == "(temporary)") { "$SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY" true } @@ -349,7 +347,7 @@ class Jms1Test extends AgentInstrumentationSpecification { // passing messageId = null will verify message.id is not captured, // passing messageId = "" will verify message.id is captured (but won't verify anything about the value), // any other value for messageId will verify that message.id is captured and has that same value - static consumerSpan(TraceAssert trace, int index, String destinationType, String destinationName, String messageId, String operation, SpanData parentSpan, SpanData linkedSpan = null, boolean testHeaders = false) { + static consumerSpan(TraceAssert trace, int index, String destinationName, String messageId, String operation, SpanData parentSpan, SpanData linkedSpan = null, boolean testHeaders = false) { trace.span(index) { name destinationName + " " + operation kind CONSUMER @@ -366,7 +364,6 @@ class Jms1Test extends AgentInstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "jms" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType "$SemanticAttributes.MESSAGING_OPERATION" operation if (messageId != null) { //In some tests we don't know exact messageId, so we pass "" and verify just the existence of the attribute diff --git a/instrumentation/jms/jms-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jms/v3_0/Jms3InstrumentationTest.java b/instrumentation/jms/jms-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jms/v3_0/Jms3InstrumentationTest.java index c7f0bb0c7c86..463524cd2223 100644 --- a/instrumentation/jms/jms-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jms/v3_0/Jms3InstrumentationTest.java +++ b/instrumentation/jms/jms-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jms/v3_0/Jms3InstrumentationTest.java @@ -107,8 +107,7 @@ static void tearDown() throws JMSException { @ArgumentsSource(DestinationsProvider.class) @ParameterizedTest - void testMessageConsumer( - DestinationFactory destinationFactory, String destinationKind, boolean isTemporary) + void testMessageConsumer(DestinationFactory destinationFactory, boolean isTemporary) throws JMSException { // given @@ -148,7 +147,6 @@ void testMessageConsumer( equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, producerDestinationName), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, destinationKind), equalTo(SemanticAttributes.MESSAGING_MESSAGE_ID, messageId), messagingTempDestination(isTemporary))); @@ -167,15 +165,13 @@ void testMessageConsumer( equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, actualDestinationName), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, destinationKind), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), equalTo(SemanticAttributes.MESSAGING_MESSAGE_ID, messageId)))); } @ArgumentsSource(DestinationsProvider.class) @ParameterizedTest - void testMessageListener( - DestinationFactory destinationFactory, String destinationKind, boolean isTemporary) + void testMessageListener(DestinationFactory destinationFactory, boolean isTemporary) throws Exception { // given @@ -218,7 +214,6 @@ void testMessageListener( equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, producerDestinationName), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, destinationKind), equalTo(SemanticAttributes.MESSAGING_MESSAGE_ID, messageId), messagingTempDestination(isTemporary)), span -> @@ -230,7 +225,6 @@ void testMessageListener( equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, actualDestinationName), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, destinationKind), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), equalTo(SemanticAttributes.MESSAGING_MESSAGE_ID, messageId)), span -> span.hasName("consumer").hasParent(trace.getSpan(2)))); @@ -258,8 +252,7 @@ void shouldNotEmitTelemetryOnEmptyReceive( @ArgumentsSource(DestinationsProvider.class) @ParameterizedTest - void shouldCaptureMessageHeaders( - DestinationFactory destinationFactory, String destinationKind, boolean isTemporary) + void shouldCaptureMessageHeaders(DestinationFactory destinationFactory, boolean isTemporary) throws Exception { // given @@ -304,7 +297,6 @@ void shouldCaptureMessageHeaders( equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, producerDestinationName), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, destinationKind), equalTo(SemanticAttributes.MESSAGING_MESSAGE_ID, messageId), messagingTempDestination(isTemporary), equalTo( @@ -322,7 +314,6 @@ void shouldCaptureMessageHeaders( equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, actualDestinationName), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, destinationKind), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), equalTo(SemanticAttributes.MESSAGING_MESSAGE_ID, messageId), equalTo( @@ -367,10 +358,10 @@ public Stream provideArguments(ExtensionContext context) { DestinationFactory tempQueue = Session::createTemporaryQueue; return Stream.of( - arguments(topic, "topic", false), - arguments(queue, "queue", false), - arguments(tempTopic, "topic", true), - arguments(tempQueue, "queue", true)); + arguments(topic, false), + arguments(queue, false), + arguments(tempTopic, true), + arguments(tempQueue, true)); } } diff --git a/instrumentation/jms/jms-common/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/jms/MessageWithDestinationTest.java b/instrumentation/jms/jms-common/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/jms/MessageWithDestinationTest.java index 4f28fcec6937..b76091d203fa 100644 --- a/instrumentation/jms/jms-common/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/jms/MessageWithDestinationTest.java +++ b/instrumentation/jms/jms-common/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/jms/MessageWithDestinationTest.java @@ -34,7 +34,7 @@ void shouldCreateMessageWithUnknownDestination() throws Exception { MessageWithDestination result = MessageWithDestination.create(message, null); // then - assertMessage("unknown", "unknown", /* expectedTemporary= */ false, result); + assertMessage("unknown", /* expectedTemporary= */ false, result); } @Test @@ -46,7 +46,7 @@ void shouldUseFallbackDestinationToCreateMessage() throws Exception { MessageWithDestination result = MessageWithDestination.create(message, destination); // then - assertMessage("unknown", "unknown", /* expectedTemporary= */ false, result); + assertMessage("unknown", /* expectedTemporary= */ false, result); } @ParameterizedTest @@ -73,7 +73,7 @@ void shouldCreateMessageWithQueue( MessageWithDestination result = MessageWithDestination.create(message, null); // then - assertMessage("queue", expectedDestinationName, expectedTemporary, result); + assertMessage(expectedDestinationName, expectedTemporary, result); } @ParameterizedTest @@ -100,7 +100,7 @@ void shouldCreateMessageWithTopic( MessageWithDestination result = MessageWithDestination.create(message, null); // then - assertMessage("topic", expectedDestinationName, expectedTemporary, result); + assertMessage(expectedDestinationName, expectedTemporary, result); } static Stream destinations() { @@ -112,13 +112,9 @@ static Stream destinations() { } private void assertMessage( - String expectedDestinationKind, - String expectedDestinationName, - boolean expectedTemporary, - MessageWithDestination actual) { + String expectedDestinationName, boolean expectedTemporary, MessageWithDestination actual) { assertSame(message, actual.message()); - assertEquals(expectedDestinationKind, actual.destinationKind()); assertEquals(expectedDestinationName, actual.destinationName()); assertEquals(expectedTemporary, actual.isTemporaryDestination()); } diff --git a/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsMessageAttributesGetter.java b/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsMessageAttributesGetter.java index 96310c187f56..93c854bfb3f9 100644 --- a/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsMessageAttributesGetter.java +++ b/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsMessageAttributesGetter.java @@ -23,12 +23,6 @@ public String getSystem(MessageWithDestination messageWithDestination) { return "jms"; } - @Nullable - @Override - public String getDestinationKind(MessageWithDestination messageWithDestination) { - return messageWithDestination.destinationKind(); - } - @Nullable @Override public String getDestination(MessageWithDestination messageWithDestination) { diff --git a/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/MessageWithDestination.java b/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/MessageWithDestination.java index 4f1367abfbbc..d394a77427bd 100644 --- a/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/MessageWithDestination.java +++ b/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/MessageWithDestination.java @@ -17,8 +17,6 @@ public abstract class MessageWithDestination { public abstract String destinationName(); - public abstract String destinationKind(); - public abstract boolean isTemporaryDestination(); public static MessageWithDestination create( @@ -40,7 +38,7 @@ public static MessageWithDestination create( return createMessageWithTopic(message, jmsDestination); } return new AutoValue_MessageWithDestination( - message, "unknown", "unknown", /* isTemporaryDestination= */ false); + message, "unknown", /* isTemporaryDestination= */ false); } private static MessageWithDestination createMessageWithQueue( @@ -49,7 +47,7 @@ private static MessageWithDestination createMessageWithQueue( String queueName = getDestinationName(queue, DestinationAdapter::getQueueName); boolean temporary = queue.isTemporaryQueue() || queueName.startsWith(TIBCO_TMP_PREFIX); - return new AutoValue_MessageWithDestination(message, queueName, "queue", temporary); + return new AutoValue_MessageWithDestination(message, queueName, temporary); } private static MessageWithDestination createMessageWithTopic( @@ -58,7 +56,7 @@ private static MessageWithDestination createMessageWithTopic( String topicName = getDestinationName(topic, DestinationAdapter::getTopicName); boolean temporary = topic.isTemporaryTopic() || topicName.startsWith(TIBCO_TMP_PREFIX); - return new AutoValue_MessageWithDestination(message, topicName, "topic", temporary); + return new AutoValue_MessageWithDestination(message, topicName, temporary); } private static String getDestinationName(DestinationAdapter destination, NameGetter nameGetter) { diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-0.11/testing/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaClientBaseTest.java b/instrumentation/kafka/kafka-clients/kafka-clients-0.11/testing/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaClientBaseTest.java index bc37560748b8..e0ad5ff5df71 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-0.11/testing/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaClientBaseTest.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-0.11/testing/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaClientBaseTest.java @@ -158,7 +158,6 @@ protected static List sendAttributes( Arrays.asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, SHARED_TOPIC), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -189,7 +188,6 @@ protected static List receiveAttributes(boolean testHeaders) Arrays.asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, SHARED_TOPIC), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, @@ -218,7 +216,6 @@ protected static List processAttributes( Arrays.asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, SHARED_TOPIC), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/InterceptorsTest.java b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/InterceptorsTest.java index 1fc0635baa35..90f658c53113 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/InterceptorsTest.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/InterceptorsTest.java @@ -85,7 +85,6 @@ void testInterceptors() throws InterruptedException { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, SHARED_TOPIC), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer"))); @@ -97,7 +96,6 @@ void testInterceptors() throws InterruptedException { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, SHARED_TOPIC), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), equalTo( SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/WrapperTest.java b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/WrapperTest.java index 58d0e61043b3..0777f55afbd1 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/WrapperTest.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/WrapperTest.java @@ -113,7 +113,6 @@ protected static List sendAttributes(boolean testHeaders) { Arrays.asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, SHARED_TOPIC), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -138,7 +137,6 @@ private static List receiveAttributes(String greeting, boole Arrays.asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, SHARED_TOPIC), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), equalTo( SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaConsumerAttributesGetter.java b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaConsumerAttributesGetter.java index ab796dec0697..18e3fa44a1ea 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaConsumerAttributesGetter.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaConsumerAttributesGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.instrumentation.kafka.internal; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.stream.Collectors; @@ -21,11 +20,6 @@ public String getSystem(KafkaProcessRequest request) { return "kafka"; } - @Override - public String getDestinationKind(KafkaProcessRequest request) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Override public String getDestination(KafkaProcessRequest request) { return request.getRecord().topic(); diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaProducerAttributesGetter.java b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaProducerAttributesGetter.java index 1c33870ddf70..2fb90ce43cbe 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaProducerAttributesGetter.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaProducerAttributesGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.instrumentation.kafka.internal; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.stream.Collectors; @@ -27,11 +26,6 @@ public String getSystem(KafkaProducerRequest request) { return "kafka"; } - @Override - public String getDestinationKind(KafkaProducerRequest request) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Override public String getDestination(KafkaProducerRequest request) { return request.getRecord().topic(); diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaReceiveAttributesGetter.java b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaReceiveAttributesGetter.java index cbc858647981..2c4ba4b99871 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaReceiveAttributesGetter.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaReceiveAttributesGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.instrumentation.kafka.internal; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Set; @@ -23,11 +22,6 @@ public String getSystem(KafkaReceiveRequest request) { return "kafka"; } - @Override - public String getDestinationKind(KafkaReceiveRequest request) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Override @Nullable public String getDestination(KafkaReceiveRequest request) { diff --git a/instrumentation/kafka/kafka-streams-0.11/javaagent/src/test/groovy/KafkaStreamsDefaultTest.groovy b/instrumentation/kafka/kafka-streams-0.11/javaagent/src/test/groovy/KafkaStreamsDefaultTest.groovy index b45cb51a1c44..385a078b8e52 100644 --- a/instrumentation/kafka/kafka-streams-0.11/javaagent/src/test/groovy/KafkaStreamsDefaultTest.groovy +++ b/instrumentation/kafka/kafka-streams-0.11/javaagent/src/test/groovy/KafkaStreamsDefaultTest.groovy @@ -99,7 +99,6 @@ class KafkaStreamsDefaultTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PENDING - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" { it.startsWith("producer") } "$SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION" { it >= 0 } "$SemanticAttributes.MESSAGING_KAFKA_MESSAGE_OFFSET" 0 @@ -118,7 +117,6 @@ class KafkaStreamsDefaultTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PENDING - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "receive" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" { it.endsWith("consumer") } if (Boolean.getBoolean("testLatestDeps")) { @@ -136,7 +134,6 @@ class KafkaStreamsDefaultTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PENDING - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" { it.endsWith("consumer") } "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long @@ -159,7 +156,6 @@ class KafkaStreamsDefaultTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PROCESSED - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" { it.endsWith("producer") } "$SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION" { it >= 0 } "$SemanticAttributes.MESSAGING_KAFKA_MESSAGE_OFFSET" 0 @@ -177,7 +173,6 @@ class KafkaStreamsDefaultTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PROCESSED - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "receive" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" { it.startsWith("consumer") } if (Boolean.getBoolean("testLatestDeps")) { @@ -195,7 +190,6 @@ class KafkaStreamsDefaultTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PROCESSED - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" { it.startsWith("consumer") } "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long diff --git a/instrumentation/kafka/kafka-streams-0.11/javaagent/src/test/groovy/KafkaStreamsSuppressReceiveSpansTest.groovy b/instrumentation/kafka/kafka-streams-0.11/javaagent/src/test/groovy/KafkaStreamsSuppressReceiveSpansTest.groovy index afa6471e95d7..d686ef0f8c57 100644 --- a/instrumentation/kafka/kafka-streams-0.11/javaagent/src/test/groovy/KafkaStreamsSuppressReceiveSpansTest.groovy +++ b/instrumentation/kafka/kafka-streams-0.11/javaagent/src/test/groovy/KafkaStreamsSuppressReceiveSpansTest.groovy @@ -94,7 +94,6 @@ class KafkaStreamsSuppressReceiveSpansTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PENDING - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" "producer-1" "$SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION" { it >= 0 } "$SemanticAttributes.MESSAGING_KAFKA_MESSAGE_OFFSET" 0 @@ -109,7 +108,6 @@ class KafkaStreamsSuppressReceiveSpansTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PENDING - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" { it.endsWith("consumer") } "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long @@ -135,7 +133,6 @@ class KafkaStreamsSuppressReceiveSpansTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PROCESSED - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" String "$SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION" { it >= 0 } "$SemanticAttributes.MESSAGING_KAFKA_MESSAGE_OFFSET" 0 @@ -149,7 +146,6 @@ class KafkaStreamsSuppressReceiveSpansTest extends KafkaStreamsBaseTest { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "kafka" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" STREAM_PROCESSED - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID" { it.startsWith("consumer") } "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long diff --git a/instrumentation/log4j/log4j-appender-1.2/javaagent/build.gradle.kts b/instrumentation/log4j/log4j-appender-1.2/javaagent/build.gradle.kts index 67f2b2269ef0..0cf053ff67e3 100644 --- a/instrumentation/log4j/log4j-appender-1.2/javaagent/build.gradle.kts +++ b/instrumentation/log4j/log4j-appender-1.2/javaagent/build.gradle.kts @@ -16,7 +16,6 @@ dependencies { // 1.2 introduces MDC and there's no version earlier than 1.2.4 available library("log4j:log4j:1.2.4") - compileOnly("io.opentelemetry:opentelemetry-api-logs") compileOnly(project(":javaagent-bootstrap")) testImplementation("org.awaitility:awaitility") diff --git a/instrumentation/log4j/log4j-appender-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/appender/v1_2/LogEventMapper.java b/instrumentation/log4j/log4j-appender-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/appender/v1_2/LogEventMapper.java index 543c24b9554c..21d57b044e5f 100644 --- a/instrumentation/log4j/log4j-appender-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/appender/v1_2/LogEventMapper.java +++ b/instrumentation/log4j/log4j-appender-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/appender/v1_2/LogEventMapper.java @@ -7,10 +7,10 @@ import static java.util.Collections.emptyList; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.api.logs.LogRecordBuilder; import io.opentelemetry.api.logs.Severity; import io.opentelemetry.context.Context; @@ -64,7 +64,11 @@ public void capture(Category logger, Priority level, Object message, Throwable t instrumentationName = "ROOT"; } LogRecordBuilder builder = - GlobalLoggerProvider.get().loggerBuilder(instrumentationName).build().logRecordBuilder(); + GlobalOpenTelemetry.get() + .getLogsBridge() + .loggerBuilder(instrumentationName) + .build() + .logRecordBuilder(); // message if (message != null) { @@ -82,7 +86,7 @@ public void capture(Category logger, Priority level, Object message, Throwable t // throwable if (throwable != null) { // TODO (trask) extract method for recording exception into - // io.opentelemetry:opentelemetry-api-logs + // io.opentelemetry:opentelemetry-api attributes.put(SemanticAttributes.EXCEPTION_TYPE, throwable.getClass().getName()); attributes.put(SemanticAttributes.EXCEPTION_MESSAGE, throwable.getMessage()); StringWriter writer = new StringWriter(); diff --git a/instrumentation/log4j/log4j-appender-1.2/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v1_2/Log4j1Test.java b/instrumentation/log4j/log4j-appender-1.2/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v1_2/Log4j1Test.java index 00a178ab7cdd..f4bd3ae46e65 100644 --- a/instrumentation/log4j/log4j-appender-1.2/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v1_2/Log4j1Test.java +++ b/instrumentation/log4j/log4j-appender-1.2/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v1_2/Log4j1Test.java @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.log4j.appender.v1_2; -import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat; +import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; diff --git a/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts b/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts index 7c21b004a49f..022c1c049eb9 100644 --- a/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts +++ b/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts @@ -16,7 +16,6 @@ val testLatestDeps = findProperty("testLatestDeps") as Boolean dependencies { library("org.apache.logging.log4j:log4j-core:2.17.0") - compileOnly("io.opentelemetry:opentelemetry-api-logs") compileOnly(project(":javaagent-bootstrap")) implementation(project(":instrumentation:log4j:log4j-appender-2.17:library")) diff --git a/instrumentation/log4j/log4j-appender-2.17/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/appender/v2_17/Log4jHelper.java b/instrumentation/log4j/log4j-appender-2.17/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/appender/v2_17/Log4jHelper.java index d15cddca5fa8..5d0cf18b17e1 100644 --- a/instrumentation/log4j/log4j-appender-2.17/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/appender/v2_17/Log4jHelper.java +++ b/instrumentation/log4j/log4j-appender-2.17/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/appender/v2_17/Log4jHelper.java @@ -7,7 +7,7 @@ import static java.util.Collections.emptyList; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.logs.LogRecordBuilder; import io.opentelemetry.instrumentation.log4j.appender.v2_17.internal.ContextDataAccessor; import io.opentelemetry.instrumentation.log4j.appender.v2_17.internal.LogEventMapper; @@ -59,7 +59,11 @@ public static void capture( instrumentationName = "ROOT"; } LogRecordBuilder builder = - GlobalLoggerProvider.get().loggerBuilder(instrumentationName).build().logRecordBuilder(); + GlobalOpenTelemetry.get() + .getLogsBridge() + .loggerBuilder(instrumentationName) + .build() + .logRecordBuilder(); Map contextData = ThreadContext.getImmutableContext(); mapper.mapLogEvent(builder, message, level, marker, throwable, contextData); builder.emit(); diff --git a/instrumentation/log4j/log4j-appender-2.17/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Log4j2Test.java b/instrumentation/log4j/log4j-appender-2.17/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Log4j2Test.java index 245b93b55552..4c753b52c4ee 100644 --- a/instrumentation/log4j/log4j-appender-2.17/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Log4j2Test.java +++ b/instrumentation/log4j/log4j-appender-2.17/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Log4j2Test.java @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.log4j.appender.v2_17; -import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat; +import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; diff --git a/instrumentation/log4j/log4j-appender-2.17/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Slf4jToLog4jTest.java b/instrumentation/log4j/log4j-appender-2.17/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Slf4jToLog4jTest.java index be724d6b9e9f..130069352c62 100644 --- a/instrumentation/log4j/log4j-appender-2.17/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Slf4jToLog4jTest.java +++ b/instrumentation/log4j/log4j-appender-2.17/javaagent/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Slf4jToLog4jTest.java @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.log4j.appender.v2_17; -import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat; +import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; diff --git a/instrumentation/log4j/log4j-appender-2.17/library/README.md b/instrumentation/log4j/log4j-appender-2.17/library/README.md index de35db0e03d6..4944d252da91 100644 --- a/instrumentation/log4j/log4j-appender-2.17/library/README.md +++ b/instrumentation/log4j/log4j-appender-2.17/library/README.md @@ -14,6 +14,7 @@ release](https://search.maven.org/search?q=g:io.opentelemetry.instrumentation%20 For Maven, add to your `pom.xml` dependencies: ```xml + io.opentelemetry.instrumentation @@ -53,17 +54,5 @@ The following demonstrates how you might configure the appender in your `log4j.x ``` -Next, configure `GlobalLoggerProvider` with an `SdkLoggerProvider` in your application. - -``` -SdkLoggerProvider sdkLoggerProvider = - SdkLoggerProvider.builder() - .setResource(Resource.create(...)) - .addLogProcessor(...) - .build(); -GlobalLoggerProvider.set(sdkLoggerProvider); -``` - In this example Log4j2 log events will be sent to both the console appender and -the `OpenTelemetryAppender`, which will drop the logs until `GlobalLoggerProvider.set(..)` is -called. Once initialized, logs will be emitted to a `Logger` obtained from the `SdkLoggerProvider`. +the `OpenTelemetryAppender`. diff --git a/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts b/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts index e56e2f8e6fa0..6a48ee260f96 100644 --- a/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts +++ b/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts @@ -3,11 +3,7 @@ plugins { } dependencies { - implementation("io.opentelemetry:opentelemetry-api-logs") - library("org.apache.logging.log4j:log4j-core:2.17.0") - testImplementation("io.opentelemetry:opentelemetry-sdk-logs") testImplementation("io.opentelemetry:opentelemetry-sdk-testing") - testImplementation("io.opentelemetry:opentelemetry-sdk-logs-testing") } diff --git a/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppender.java b/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppender.java index b1cc3047b74a..da324cb6aa52 100644 --- a/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppender.java +++ b/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppender.java @@ -8,7 +8,7 @@ import static java.util.Collections.emptyList; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.logs.LogRecordBuilder; import io.opentelemetry.instrumentation.log4j.appender.v2_17.internal.ContextDataAccessor; import io.opentelemetry.instrumentation.log4j.appender.v2_17.internal.LogEventMapper; @@ -146,7 +146,11 @@ public void append(LogEvent event) { instrumentationName = "ROOT"; } LogRecordBuilder builder = - GlobalLoggerProvider.get().loggerBuilder(instrumentationName).build().logRecordBuilder(); + GlobalOpenTelemetry.get() + .getLogsBridge() + .loggerBuilder(instrumentationName) + .build() + .logRecordBuilder(); ReadOnlyStringMap contextData = event.getContextData(); mapper.mapLogEvent( builder, diff --git a/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/internal/LogEventMapper.java b/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/internal/LogEventMapper.java index 0cacf3aa5954..3b1aa702b104 100644 --- a/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/internal/LogEventMapper.java +++ b/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/internal/LogEventMapper.java @@ -186,7 +186,7 @@ public static AttributeKey getMapMessageAttributeKey(String key) { private static void setThrowable(AttributesBuilder attributes, Throwable throwable) { // TODO (trask) extract method for recording exception into - // io.opentelemetry:opentelemetry-api-logs + // io.opentelemetry:opentelemetry-api attributes.put(SemanticAttributes.EXCEPTION_TYPE, throwable.getClass().getName()); attributes.put(SemanticAttributes.EXCEPTION_MESSAGE, throwable.getMessage()); StringWriter writer = new StringWriter(); diff --git a/instrumentation/log4j/log4j-appender-2.17/library/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppenderConfigTest.java b/instrumentation/log4j/log4j-appender-2.17/library/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppenderConfigTest.java index 2176439232f6..243fa02efec9 100644 --- a/instrumentation/log4j/log4j-appender-2.17/library/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppenderConfigTest.java +++ b/instrumentation/log4j/log4j-appender-2.17/library/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/OpenTelemetryAppenderConfigTest.java @@ -6,16 +6,17 @@ package io.opentelemetry.instrumentation.log4j.appender.v2_17; import static io.opentelemetry.api.common.AttributeKey.stringKey; -import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat; +import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.api.logs.Severity; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.SpanContext; import io.opentelemetry.context.Scope; +import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.common.InstrumentationScopeInfo; import io.opentelemetry.sdk.logs.SdkLoggerProvider; import io.opentelemetry.sdk.logs.data.LogRecordData; @@ -60,8 +61,8 @@ static void setupAll() { .addLogRecordProcessor(SimpleLogRecordProcessor.create(logRecordExporter)) .build(); - GlobalLoggerProvider.resetForTest(); - GlobalLoggerProvider.set(loggerProvider); + GlobalOpenTelemetry.resetForTest(); + GlobalOpenTelemetry.set(OpenTelemetrySdk.builder().setLoggerProvider(loggerProvider).build()); } @BeforeEach diff --git a/instrumentation/logback/logback-appender-1.0/javaagent/build.gradle.kts b/instrumentation/logback/logback-appender-1.0/javaagent/build.gradle.kts index 10106082a188..c69eba861c94 100644 --- a/instrumentation/logback/logback-appender-1.0/javaagent/build.gradle.kts +++ b/instrumentation/logback/logback-appender-1.0/javaagent/build.gradle.kts @@ -42,12 +42,10 @@ dependencies { } } - compileOnly("io.opentelemetry:opentelemetry-api-logs") compileOnly(project(":javaagent-bootstrap")) implementation(project(":instrumentation:logback:logback-appender-1.0:library")) - testImplementation("io.opentelemetry:opentelemetry-sdk-logs-testing") testImplementation("org.awaitility:awaitility") } diff --git a/instrumentation/logback/logback-appender-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/logback/appender/v1_0/LogbackInstrumentation.java b/instrumentation/logback/logback-appender-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/logback/appender/v1_0/LogbackInstrumentation.java index 57bf5df94b9f..cbd366729750 100644 --- a/instrumentation/logback/logback-appender-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/logback/appender/v1_0/LogbackInstrumentation.java +++ b/instrumentation/logback/logback-appender-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/logback/appender/v1_0/LogbackInstrumentation.java @@ -13,7 +13,7 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import ch.qos.logback.classic.spi.ILoggingEvent; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.logs.LoggerProvider; import io.opentelemetry.javaagent.bootstrap.CallDepth; import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation; @@ -51,7 +51,7 @@ public static void methodEnter( // logging framework delegates to another callDepth = CallDepth.forClass(LoggerProvider.class); if (callDepth.getAndIncrement() == 0) { - mapper().emit(GlobalLoggerProvider.get(), event); + mapper().emit(GlobalOpenTelemetry.get().getLogsBridge(), event); } } diff --git a/instrumentation/logback/logback-appender-1.0/javaagent/src/test/java/io/opentelemetry/instrumentation/logback/appender/v1_0/LogbackTest.java b/instrumentation/logback/logback-appender-1.0/javaagent/src/test/java/io/opentelemetry/instrumentation/logback/appender/v1_0/LogbackTest.java index fe077bd43fc6..c327677fcd16 100644 --- a/instrumentation/logback/logback-appender-1.0/javaagent/src/test/java/io/opentelemetry/instrumentation/logback/appender/v1_0/LogbackTest.java +++ b/instrumentation/logback/logback-appender-1.0/javaagent/src/test/java/io/opentelemetry/instrumentation/logback/appender/v1_0/LogbackTest.java @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.logback.appender.v1_0; -import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat; +import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; diff --git a/instrumentation/logback/logback-appender-1.0/library/README.md b/instrumentation/logback/logback-appender-1.0/library/README.md index 6107ff0aea7e..171d02b63efb 100644 --- a/instrumentation/logback/logback-appender-1.0/library/README.md +++ b/instrumentation/logback/logback-appender-1.0/library/README.md @@ -14,6 +14,7 @@ release](https://search.maven.org/search?q=g:io.opentelemetry.instrumentation%20 For Maven, add to your `pom.xml` dependencies: ```xml + io.opentelemetry.instrumentation @@ -57,17 +58,5 @@ The following demonstrates how you might configure the appender in your `logback ``` -Next, configure `GlobalLoggerProvider` with an `SdkLoggerProvider` in your application. - -``` -SdkLoggerProvider sdkLoggerProvider = - SdkLoggerProvider.builder() - .setResource(Resource.create(...)) - .addLogProcessor(...) - .build(); -GlobalLoggerProvider.set(sdkLoggerProvider); -``` - In this example Logback log events will be sent to both the console appender and -the `OpenTelemetryAppender`, which will drop the logs until `GlobalLoggerProvider.set(..)` is -called. Once initialized, logs will be emitted to a `Logger` obtained from the `SdkLoggerProvider`. +the `OpenTelemetryAppender`. diff --git a/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts b/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts index 0601acbd6cf8..dc625d36ad02 100644 --- a/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts +++ b/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts @@ -5,7 +5,6 @@ plugins { dependencies { compileOnly(project(":muzzle")) - implementation("io.opentelemetry:opentelemetry-api-logs") // pin the version strictly to avoid overriding by dependencyManagement versions compileOnly("ch.qos.logback:logback-classic") { @@ -36,8 +35,6 @@ dependencies { } } - testImplementation("io.opentelemetry:opentelemetry-sdk-logs") - testImplementation("io.opentelemetry:opentelemetry-sdk-logs-testing") testImplementation("io.opentelemetry:opentelemetry-sdk-testing") } @@ -63,9 +60,6 @@ testing { val slf4j2ApiTest by registering(JvmTestSuite::class) { dependencies { implementation(project(":instrumentation:logback:logback-appender-1.0:library")) - implementation("io.opentelemetry:opentelemetry-api-logs") - implementation("io.opentelemetry:opentelemetry-sdk-logs") - implementation("io.opentelemetry:opentelemetry-sdk-logs-testing") implementation("io.opentelemetry:opentelemetry-sdk-testing") if (latestDepTest) { diff --git a/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/OpenTelemetryAppender.java b/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/OpenTelemetryAppender.java index 3ba8376ebafe..b161d54d6009 100644 --- a/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/OpenTelemetryAppender.java +++ b/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/OpenTelemetryAppender.java @@ -9,7 +9,7 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.UnsynchronizedAppenderBase; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.logback.appender.v1_0.internal.LoggingEventMapper; import java.util.Arrays; import java.util.List; @@ -42,7 +42,7 @@ public void start() { @Override protected void append(ILoggingEvent event) { - mapper.emit(GlobalLoggerProvider.get(), event); + mapper.emit(GlobalOpenTelemetry.get().getLogsBridge(), event); } /** diff --git a/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/internal/LoggingEventMapper.java b/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/internal/LoggingEventMapper.java index 147eabd19340..2393ae8e444c 100644 --- a/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/internal/LoggingEventMapper.java +++ b/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/internal/LoggingEventMapper.java @@ -178,7 +178,7 @@ public static AttributeKey getMdcAttributeKey(String key) { private static void setThrowable(AttributesBuilder attributes, Throwable throwable) { // TODO (trask) extract method for recording exception into - // io.opentelemetry:opentelemetry-api-logs + // io.opentelemetry:opentelemetry-api attributes.put(SemanticAttributes.EXCEPTION_TYPE, throwable.getClass().getName()); attributes.put(SemanticAttributes.EXCEPTION_MESSAGE, throwable.getMessage()); StringWriter writer = new StringWriter(); diff --git a/instrumentation/logback/logback-appender-1.0/library/src/slf4j2ApiTest/java/io/opentelemetry/instrumentation/logback/appender/v1_0/Slf4j2Test.java b/instrumentation/logback/logback-appender-1.0/library/src/slf4j2ApiTest/java/io/opentelemetry/instrumentation/logback/appender/v1_0/Slf4j2Test.java index 6a10618a6e24..80734e80fc02 100644 --- a/instrumentation/logback/logback-appender-1.0/library/src/slf4j2ApiTest/java/io/opentelemetry/instrumentation/logback/appender/v1_0/Slf4j2Test.java +++ b/instrumentation/logback/logback-appender-1.0/library/src/slf4j2ApiTest/java/io/opentelemetry/instrumentation/logback/appender/v1_0/Slf4j2Test.java @@ -7,8 +7,9 @@ import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.common.InstrumentationScopeInfo; import io.opentelemetry.sdk.logs.SdkLoggerProvider; import io.opentelemetry.sdk.logs.data.LogRecordData; @@ -43,8 +44,8 @@ static void setupAll() { .addLogRecordProcessor(SimpleLogRecordProcessor.create(logRecordExporter)) .build(); - GlobalLoggerProvider.resetForTest(); - GlobalLoggerProvider.set(loggerProvider); + GlobalOpenTelemetry.resetForTest(); + GlobalOpenTelemetry.set(OpenTelemetrySdk.builder().setLoggerProvider(loggerProvider).build()); } @BeforeEach diff --git a/instrumentation/logback/logback-appender-1.0/library/src/test/java/io/opentelemetry/instrumentation/logback/appender/v1_0/OpenTelemetryAppenderConfigTest.java b/instrumentation/logback/logback-appender-1.0/library/src/test/java/io/opentelemetry/instrumentation/logback/appender/v1_0/OpenTelemetryAppenderConfigTest.java index cc36d6127f19..2fc5271141a8 100644 --- a/instrumentation/logback/logback-appender-1.0/library/src/test/java/io/opentelemetry/instrumentation/logback/appender/v1_0/OpenTelemetryAppenderConfigTest.java +++ b/instrumentation/logback/logback-appender-1.0/library/src/test/java/io/opentelemetry/instrumentation/logback/appender/v1_0/OpenTelemetryAppenderConfigTest.java @@ -7,12 +7,13 @@ import static org.assertj.core.api.Assertions.assertThat; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.api.logs.Severity; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.SpanContext; import io.opentelemetry.context.Scope; +import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.common.InstrumentationScopeInfo; import io.opentelemetry.sdk.logs.SdkLoggerProvider; import io.opentelemetry.sdk.logs.data.LogRecordData; @@ -54,8 +55,8 @@ static void setupAll() { .addLogRecordProcessor(SimpleLogRecordProcessor.create(logRecordExporter)) .build(); - GlobalLoggerProvider.resetForTest(); - GlobalLoggerProvider.set(loggerProvider); + GlobalOpenTelemetry.resetForTest(); + GlobalOpenTelemetry.set(OpenTelemetrySdk.builder().setLoggerProvider(loggerProvider).build()); } @BeforeEach diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/ApplicationOpenTelemetry.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/ApplicationOpenTelemetry.java index f1b6ef95b47f..184b0ef819ea 100644 --- a/instrumentation/opentelemetry-api/opentelemetry-api-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/ApplicationOpenTelemetry.java +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/ApplicationOpenTelemetry.java @@ -10,6 +10,7 @@ import application.io.opentelemetry.context.propagation.ContextPropagators; import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.context.propagation.ApplicationContextPropagators; import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.trace.ApplicationTracerProvider; +import javax.annotation.Nullable; // Our convention for accessing agent package @SuppressWarnings("UnnecessarilyFullyQualified") @@ -18,15 +19,9 @@ public class ApplicationOpenTelemetry implements OpenTelemetry { public static final OpenTelemetry INSTANCE; static { - OpenTelemetry instance = null; - try { - // this class is defined in opentelemetry-api-1.10 - Class clazz = - Class.forName( - "io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_10.ApplicationOpenTelemetry110"); - instance = (OpenTelemetry) clazz.getField("INSTANCE").get(null); - } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException exception) { - // fall through + OpenTelemetry instance = getOpenTelemetry127(); + if (instance == null) { + instance = getOpenTelemetry110(); } if (instance == null) { instance = new ApplicationOpenTelemetry(); @@ -56,4 +51,30 @@ public TracerProvider getTracerProvider() { public ContextPropagators getPropagators() { return applicationContextPropagators; } + + @Nullable + private static OpenTelemetry getOpenTelemetry127() { + try { + // this class is defined in opentelemetry-api-1.27 + Class clazz = + Class.forName( + "io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.ApplicationOpenTelemetry127"); + return (OpenTelemetry) clazz.getField("INSTANCE").get(null); + } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException exception) { + return null; + } + } + + @Nullable + private static OpenTelemetry getOpenTelemetry110() { + try { + // this class is defined in opentelemetry-api-1.10 + Class clazz = + Class.forName( + "io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_10.ApplicationOpenTelemetry110"); + return (OpenTelemetry) clazz.getField("INSTANCE").get(null); + } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException exception) { + return null; + } + } } diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/build.gradle.kts b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/build.gradle.kts new file mode 100644 index 000000000000..fd89755d62b1 --- /dev/null +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("otel.javaagent-instrumentation") +} + +dependencies { + compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "v1_27")) + implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:javaagent")) + implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.4:javaagent")) + implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.10:javaagent")) + implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.15:javaagent")) +} diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/ApplicationOpenTelemetry127.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/ApplicationOpenTelemetry127.java new file mode 100644 index 000000000000..2b66f448dd78 --- /dev/null +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/ApplicationOpenTelemetry127.java @@ -0,0 +1,63 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27; + +import application.io.opentelemetry.api.OpenTelemetry; +import application.io.opentelemetry.api.logs.LoggerProvider; +import application.io.opentelemetry.api.metrics.MeterProvider; +import application.io.opentelemetry.api.trace.TracerProvider; +import application.io.opentelemetry.context.propagation.ContextPropagators; +import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.context.propagation.ApplicationContextPropagators; +import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_10.metrics.ApplicationMeterProvider; +import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_15.metrics.ApplicationMeterFactory115; +import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs.ApplicationLoggerProvider; +import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_4.trace.ApplicationTracerProvider14; + +public final class ApplicationOpenTelemetry127 implements OpenTelemetry { + + // Accessed with reflection + @SuppressWarnings("unused") + public static final OpenTelemetry INSTANCE = new ApplicationOpenTelemetry127(); + + private final TracerProvider applicationTracerProvider; + private final ContextPropagators applicationContextPropagators; + private final MeterProvider applicationMeterProvider; + private final LoggerProvider applicationLoggerProvider; + + @SuppressWarnings("UnnecessarilyFullyQualified") + private ApplicationOpenTelemetry127() { + io.opentelemetry.api.OpenTelemetry agentOpenTelemetry = + io.opentelemetry.api.GlobalOpenTelemetry.get(); + applicationTracerProvider = + new ApplicationTracerProvider14(agentOpenTelemetry.getTracerProvider()); + applicationContextPropagators = + new ApplicationContextPropagators(agentOpenTelemetry.getPropagators()); + applicationMeterProvider = + new ApplicationMeterProvider( + new ApplicationMeterFactory115(), agentOpenTelemetry.getMeterProvider()); + applicationLoggerProvider = new ApplicationLoggerProvider(agentOpenTelemetry.getLogsBridge()); + } + + @Override + public TracerProvider getTracerProvider() { + return applicationTracerProvider; + } + + @Override + public MeterProvider getMeterProvider() { + return applicationMeterProvider; + } + + @Override + public LoggerProvider getLogsBridge() { + return applicationLoggerProvider; + } + + @Override + public ContextPropagators getPropagators() { + return applicationContextPropagators; + } +} diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/OpenTelemetryApiLogsInstrumentationModule.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/OpenTelemetryApiInstrumentationModule.java similarity index 61% rename from instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/OpenTelemetryApiLogsInstrumentationModule.java rename to instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/OpenTelemetryApiInstrumentationModule.java index d7553b977ea2..1949f24cd1ef 100644 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/OpenTelemetryApiLogsInstrumentationModule.java +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/OpenTelemetryApiInstrumentationModule.java @@ -3,22 +3,23 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs; +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27; + +import static java.util.Collections.singletonList; import com.google.auto.service.AutoService; import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule; import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation; -import java.util.Collections; import java.util.List; @AutoService(InstrumentationModule.class) -public class OpenTelemetryApiLogsInstrumentationModule extends InstrumentationModule { - public OpenTelemetryApiLogsInstrumentationModule() { - super("opentelemetry-api-logs"); +public class OpenTelemetryApiInstrumentationModule extends InstrumentationModule { + public OpenTelemetryApiInstrumentationModule() { + super("opentelemetry-api", "opentelemetry-api-1.27"); } @Override public List typeInstrumentations() { - return Collections.singletonList(new OpenTelemetryLogsInstrumentation()); + return singletonList(new OpenTelemetryInstrumentation()); } } diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/OpenTelemetryInstrumentation.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/OpenTelemetryInstrumentation.java new file mode 100644 index 000000000000..aca23aada696 --- /dev/null +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/OpenTelemetryInstrumentation.java @@ -0,0 +1,39 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27; + +import static net.bytebuddy.matcher.ElementMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.none; + +import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation; +import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer; +import net.bytebuddy.asm.Advice; +import net.bytebuddy.description.type.TypeDescription; +import net.bytebuddy.matcher.ElementMatcher; + +public class OpenTelemetryInstrumentation implements TypeInstrumentation { + + @Override + public ElementMatcher typeMatcher() { + return named("application.io.opentelemetry.api.GlobalOpenTelemetry"); + } + + @Override + public void transform(TypeTransformer transformer) { + transformer.applyAdviceToMethod( + none(), OpenTelemetryInstrumentation.class.getName() + "$InitAdvice"); + } + + @SuppressWarnings({"ReturnValueIgnored", "unused"}) + public static class InitAdvice { + @Advice.OnMethodEnter + public static void init() { + // the sole purpose of this advice is to ensure that ApplicationOpenTelemetry127 is recognized + // as helper class and injected into class loader + ApplicationOpenTelemetry127.class.getName(); + } + } +} diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLogRecordBuilder.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLogRecordBuilder.java similarity index 99% rename from instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLogRecordBuilder.java rename to instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLogRecordBuilder.java index 8e41f6950399..1060663c7d9f 100644 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLogRecordBuilder.java +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLogRecordBuilder.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs.bridge; +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs; import application.io.opentelemetry.api.common.AttributeKey; import application.io.opentelemetry.api.logs.LogRecordBuilder; diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLogger.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLogger.java similarity index 97% rename from instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLogger.java rename to instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLogger.java index ee38e14dff47..7bfe4898ff0f 100644 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLogger.java +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLogger.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs.bridge; +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs; import application.io.opentelemetry.api.logs.LogRecordBuilder; import application.io.opentelemetry.api.logs.Logger; diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLoggerBuilder.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLoggerBuilder.java similarity index 98% rename from instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLoggerBuilder.java rename to instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLoggerBuilder.java index 53b83ebce982..995697f2aa4a 100644 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLoggerBuilder.java +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLoggerBuilder.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs.bridge; +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs; import application.io.opentelemetry.api.logs.Logger; import application.io.opentelemetry.api.logs.LoggerBuilder; diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLoggerProvider.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLoggerProvider.java similarity index 75% rename from instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLoggerProvider.java rename to instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLoggerProvider.java index d5a822c3b7f1..192f53efbc95 100644 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/ApplicationLoggerProvider.java +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/ApplicationLoggerProvider.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs.bridge; +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs; import application.io.opentelemetry.api.logs.LoggerBuilder; import application.io.opentelemetry.api.logs.LoggerProvider; @@ -12,12 +12,10 @@ @SuppressWarnings("UnnecessarilyFullyQualified") public class ApplicationLoggerProvider implements LoggerProvider { - public static final LoggerProvider INSTANCE = new ApplicationLoggerProvider(); - private final io.opentelemetry.api.logs.LoggerProvider agentLoggerProvider; - public ApplicationLoggerProvider() { - this.agentLoggerProvider = io.opentelemetry.api.logs.GlobalLoggerProvider.get(); + public ApplicationLoggerProvider(io.opentelemetry.api.logs.LoggerProvider agentLoggerProvider) { + this.agentLoggerProvider = agentLoggerProvider; } @Override diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/LogBridging.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/LogBridging.java similarity index 98% rename from instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/LogBridging.java rename to instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/LogBridging.java index a6459dddd9d9..2e627b249fe3 100644 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/bridge/LogBridging.java +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/logs/LogBridging.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs.bridge; +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs; import application.io.opentelemetry.api.logs.Severity; import java.util.EnumMap; diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/LoggerTest.java b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/LoggerTest.java similarity index 96% rename from instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/LoggerTest.java rename to instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/LoggerTest.java index 76b70af3582f..3149502caec1 100644 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/LoggerTest.java +++ b/instrumentation/opentelemetry-api/opentelemetry-api-1.27/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_27/LoggerTest.java @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs; +package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27; import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Awaitility.await; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.api.logs.Logger; import io.opentelemetry.api.logs.Severity; import io.opentelemetry.api.trace.Span; @@ -39,7 +39,8 @@ class LoggerTest { void setupLogger(TestInfo test) { instrumentationName = "test-" + test.getDisplayName(); logger = - GlobalLoggerProvider.get() + GlobalOpenTelemetry.get() + .getLogsBridge() .loggerBuilder(instrumentationName) .setInstrumentationVersion("1.2.3") .setSchemaUrl("http://schema.org") diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/build.gradle.kts b/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/build.gradle.kts deleted file mode 100644 index 3ce92db5b146..000000000000 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/build.gradle.kts +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id("otel.javaagent-instrumentation") -} - -dependencies { - // this instrumentation needs to be able to reference both the OpenTelemetry API - // that is shaded in the bootstrap class loader (for sending telemetry to the agent), - // and the OpenTelemetry API that the user brings (in order to capture that telemetry) - // - // since (all) instrumentation already uses OpenTelemetry API for sending telemetry to the agent, - // this instrumentation uses a "temporarily shaded" OpenTelemetry API to represent the - // OpenTelemetry API that the user brings - // - // then later, after the OpenTelemetry API in the bootstrap class loader is shaded, - // the "temporarily shaded" OpenTelemetry API is unshaded, so that it will apply to the - // OpenTelemetry API that the user brings - // - // so in the code "application.io.opentelemetry.*" refers to the (unshaded) OpenTelemetry API that - // the application brings (as those references will be translated during the build to remove the - // "application." prefix) - // - // and in the code "io.opentelemetry.*" refers to the (shaded) OpenTelemetry API that is used by - // the agent (as those references will later be shaded) - compileOnly("io.opentelemetry:opentelemetry-api-logs") - compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "shadow")) - implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:javaagent")) - - testImplementation("io.opentelemetry:opentelemetry-sdk-logs") -} diff --git a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/OpenTelemetryLogsInstrumentation.java b/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/OpenTelemetryLogsInstrumentation.java deleted file mode 100644 index baac74a958ff..000000000000 --- a/instrumentation/opentelemetry-api/opentelemetry-api-logs-1.23/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/logs/OpenTelemetryLogsInstrumentation.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs; - -import static net.bytebuddy.matcher.ElementMatchers.isMethod; -import static net.bytebuddy.matcher.ElementMatchers.isStatic; -import static net.bytebuddy.matcher.ElementMatchers.named; -import static net.bytebuddy.matcher.ElementMatchers.takesArguments; - -import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation; -import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer; -import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.logs.bridge.ApplicationLoggerProvider; -import net.bytebuddy.asm.Advice; -import net.bytebuddy.description.type.TypeDescription; -import net.bytebuddy.matcher.ElementMatcher; - -// Our convention for accessing agent package -@SuppressWarnings("UnnecessarilyFullyQualified") -public class OpenTelemetryLogsInstrumentation implements TypeInstrumentation { - - @Override - public ElementMatcher typeMatcher() { - return named("application.io.opentelemetry.api.logs.GlobalLoggerProvider"); - } - - @Override - public void transform(TypeTransformer transformer) { - transformer.applyAdviceToMethod( - isMethod().and(isStatic()).and(named("get")).and(takesArguments(0)), - OpenTelemetryLogsInstrumentation.class.getName() + "$GetGlobalLogsAdvice"); - } - - @SuppressWarnings("unused") - public static class GetGlobalLogsAdvice { - - @Advice.OnMethodEnter(skipOn = Advice.OnDefaultValue.class) - public static Object onEnter() { - return null; - } - - @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void methodExit( - @Advice.Return(readOnly = false) - application.io.opentelemetry.api.logs.LoggerProvider loggerProvider) { - loggerProvider = ApplicationLoggerProvider.INSTANCE; - } - } -} diff --git a/instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarBatchMessagingAttributesGetter.java b/instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarBatchMessagingAttributesGetter.java index 03de52567623..addbd0647374 100644 --- a/instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarBatchMessagingAttributesGetter.java +++ b/instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarBatchMessagingAttributesGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.javaagent.instrumentation.pulsar.v2_8.telemetry; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -22,11 +21,6 @@ public String getSystem(PulsarBatchRequest request) { return "pulsar"; } - @Override - public String getDestinationKind(PulsarBatchRequest request) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Nullable @Override public String getDestination(PulsarBatchRequest request) { diff --git a/instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarMessagingAttributesGetter.java b/instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarMessagingAttributesGetter.java index cb6ed4bce187..92596589f49d 100644 --- a/instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarMessagingAttributesGetter.java +++ b/instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarMessagingAttributesGetter.java @@ -9,7 +9,6 @@ import static java.util.Collections.singletonList; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.List; import javax.annotation.Nullable; import org.apache.pulsar.client.api.Message; @@ -22,11 +21,6 @@ public String getSystem(PulsarRequest request) { return "pulsar"; } - @Override - public String getDestinationKind(PulsarRequest request) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Nullable @Override public String getDestination(PulsarRequest request) { diff --git a/instrumentation/pulsar/pulsar-2.8/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/PulsarClientTest.groovy b/instrumentation/pulsar/pulsar-2.8/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/PulsarClientTest.groovy index 7dd80905372f..d81238353cff 100644 --- a/instrumentation/pulsar/pulsar-2.8/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/PulsarClientTest.groovy +++ b/instrumentation/pulsar/pulsar-2.8/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/PulsarClientTest.groovy @@ -586,7 +586,6 @@ class PulsarClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.MESSAGING_SYSTEM" "pulsar" "$SemanticAttributes.NET_PEER_NAME" brokerHost "$SemanticAttributes.NET_PEER_PORT" brokerPort - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destination if (msgId == String) { "$SemanticAttributes.MESSAGING_MESSAGE_ID" String @@ -622,7 +621,6 @@ class PulsarClientTest extends AgentInstrumentationSpecification { } attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "pulsar" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.NET_PEER_NAME" brokerHost "$SemanticAttributes.NET_PEER_PORT" brokerPort "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destination @@ -655,7 +653,6 @@ class PulsarClientTest extends AgentInstrumentationSpecification { childOf parentSpan attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "pulsar" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destination if (msgId == String) { "$SemanticAttributes.MESSAGING_MESSAGE_ID" String diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitChannelAttributesGetter.java b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitChannelAttributesGetter.java index 3549511f5161..661838d71bec 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitChannelAttributesGetter.java +++ b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitChannelAttributesGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.javaagent.instrumentation.rabbitmq; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; @@ -19,11 +18,6 @@ public String getSystem(ChannelAndMethod channelAndMethod) { return "rabbitmq"; } - @Override - public String getDestinationKind(ChannelAndMethod channelAndMethod) { - return SemanticAttributes.MessagingDestinationKindValues.QUEUE; - } - @Nullable @Override public String getDestination(ChannelAndMethod channelAndMethod) { diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitDeliveryAttributesGetter.java b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitDeliveryAttributesGetter.java index 870ab29913b9..41486c6691b6 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitDeliveryAttributesGetter.java +++ b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitDeliveryAttributesGetter.java @@ -9,7 +9,6 @@ import static java.util.Collections.singletonList; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.List; import java.util.Map; import javax.annotation.Nullable; @@ -22,11 +21,6 @@ public String getSystem(DeliveryRequest request) { return "rabbitmq"; } - @Override - public String getDestinationKind(DeliveryRequest request) { - return SemanticAttributes.MessagingDestinationKindValues.QUEUE; - } - @Nullable @Override public String getDestination(DeliveryRequest request) { diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitReceiveAttributesGetter.java b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitReceiveAttributesGetter.java index 315e0e4144b2..758b37365ce1 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitReceiveAttributesGetter.java +++ b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitReceiveAttributesGetter.java @@ -7,7 +7,6 @@ import com.rabbitmq.client.GetResponse; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; @@ -21,11 +20,6 @@ public String getSystem(ReceiveRequest request) { return "rabbitmq"; } - @Override - public String getDestinationKind(ReceiveRequest request) { - return SemanticAttributes.MessagingDestinationKindValues.QUEUE; - } - @Nullable @Override public String getDestination(ReceiveRequest request) { diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/RabbitMqTest.groovy b/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/RabbitMqTest.groovy index 970472c6da61..9245f875a976 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/RabbitMqTest.groovy +++ b/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/RabbitMqTest.groovy @@ -426,7 +426,6 @@ class RabbitMqTest extends AgentInstrumentationSpecification implements WithRabb "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" exchange - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" "$SemanticAttributes.MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY" { it == null || it == routingKey || it.startsWith("amq.gen-") } if (operation != null && operation != "send") { diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/ReactorRabbitMqTest.groovy b/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/ReactorRabbitMqTest.groovy index 875a28ef65e3..6b4abf84ea99 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/ReactorRabbitMqTest.groovy +++ b/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/ReactorRabbitMqTest.groovy @@ -42,7 +42,6 @@ class ReactorRabbitMqTest extends AgentInstrumentationSpecification implements W "$SemanticAttributes.NET_SOCK_PEER_PORT" Long "$SemanticAttributes.NET_SOCK_FAMILY" { it == SemanticAttributes.NetSockFamilyValues.INET6 || it == null } "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" "rabbitmq.command" "exchange.declare" } } diff --git a/instrumentation/reactor/reactor-kafka-1.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/reactor/kafka/v1_0/AbstractReactorKafkaTest.java b/instrumentation/reactor/reactor-kafka-1.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/reactor/kafka/v1_0/AbstractReactorKafkaTest.java index 05b0f22dbff4..068a1f5858a8 100644 --- a/instrumentation/reactor/reactor-kafka-1.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/reactor/kafka/v1_0/AbstractReactorKafkaTest.java +++ b/instrumentation/reactor/reactor-kafka-1.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/reactor/kafka/v1_0/AbstractReactorKafkaTest.java @@ -180,7 +180,6 @@ protected static List sendAttributes(ProducerRecord stringAssert.startsWith("producer")), @@ -203,7 +202,6 @@ protected static List receiveAttributes(String topic) { asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, topic), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, @@ -225,7 +223,6 @@ protected static List processAttributes( asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, record.topic()), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqConsumerAttributeGetter.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqConsumerAttributeGetter.java index 6f5ef1fa7ebc..b1a346998c31 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqConsumerAttributeGetter.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqConsumerAttributeGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.instrumentation.rocketmqclient.v4_8; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; @@ -20,11 +19,6 @@ public String getSystem(MessageExt request) { return "rocketmq"; } - @Override - public String getDestinationKind(MessageExt request) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Override public String getDestination(MessageExt request) { return request.getTopic(); diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqProducerAttributeGetter.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqProducerAttributeGetter.java index d13c9e480b3f..0bd95d85d5c4 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqProducerAttributeGetter.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqProducerAttributeGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.instrumentation.rocketmqclient.v4_8; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; @@ -23,11 +22,6 @@ public String getSystem(SendMessageContext sendMessageContext) { return "rocketmq"; } - @Override - public String getDestinationKind(SendMessageContext sendMessageContext) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Nullable @Override public String getDestination(SendMessageContext sendMessageContext) { diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/testing/src/main/groovy/io/opentelemetry/instrumentation/rocketmqclient/v4_8/AbstractRocketMqClientTest.groovy b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/testing/src/main/groovy/io/opentelemetry/instrumentation/rocketmqclient/v4_8/AbstractRocketMqClientTest.groovy index 2ca9a2ec8e1f..b34fd6551dc1 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/testing/src/main/groovy/io/opentelemetry/instrumentation/rocketmqclient/v4_8/AbstractRocketMqClientTest.groovy +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/testing/src/main/groovy/io/opentelemetry/instrumentation/rocketmqclient/v4_8/AbstractRocketMqClientTest.groovy @@ -106,7 +106,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_MESSAGE_ID" String "$SemanticAttributes.MESSAGING_ROCKETMQ_MESSAGE_TAG" "TagA" "messaging.rocketmq.broker_address" String @@ -120,7 +119,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_MESSAGE_ID" String @@ -162,7 +160,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_MESSAGE_ID" String "$SemanticAttributes.MESSAGING_ROCKETMQ_MESSAGE_TAG" "TagA" "messaging.rocketmq.broker_address" String @@ -176,7 +173,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_MESSAGE_ID" String @@ -240,7 +236,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_MESSAGE_ID" String "messaging.rocketmq.broker_address" String "messaging.rocketmq.send_result" "SEND_OK" @@ -263,7 +258,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_MESSAGE_ID" String @@ -281,7 +275,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_MESSAGE_ID" String @@ -327,7 +320,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_MESSAGE_ID" String "$SemanticAttributes.MESSAGING_ROCKETMQ_MESSAGE_TAG" "TagA" "messaging.rocketmq.broker_address" String @@ -342,7 +334,6 @@ abstract class AbstractRocketMqClientTest extends InstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rocketmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" sharedTopic - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "topic" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_MESSAGE_ID" String diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqConsumerProcessAttributeGetter.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqConsumerProcessAttributeGetter.java index b4285b46ccba..df7a7bf97aa9 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqConsumerProcessAttributeGetter.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqConsumerProcessAttributeGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.javaagent.instrumentation.rocketmqclient.v5_0; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; @@ -23,12 +22,6 @@ public String getSystem(MessageView messageView) { return "rocketmq"; } - @Nullable - @Override - public String getDestinationKind(MessageView messageView) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Nullable @Override public String getDestination(MessageView messageView) { diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqConsumerReceiveAttributeGetter.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqConsumerReceiveAttributeGetter.java index 2cc150609d95..87e4b4101faf 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqConsumerReceiveAttributeGetter.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqConsumerReceiveAttributeGetter.java @@ -7,7 +7,6 @@ import apache.rocketmq.v2.ReceiveMessageRequest; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.List; import javax.annotation.Nullable; import org.apache.rocketmq.client.apis.message.MessageView; @@ -22,12 +21,6 @@ public String getSystem(ReceiveMessageRequest request) { return "rocketmq"; } - @Nullable - @Override - public String getDestinationKind(ReceiveMessageRequest request) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Nullable @Override public String getDestination(ReceiveMessageRequest request) { diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqProducerAttributeGetter.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqProducerAttributeGetter.java index ba4a5fac65a9..0931a53c09b9 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqProducerAttributeGetter.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqProducerAttributeGetter.java @@ -6,7 +6,6 @@ package io.opentelemetry.javaagent.instrumentation.rocketmqclient.v5_0; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; @@ -23,12 +22,6 @@ public String getSystem(PublishingMessageImpl message) { return "rocketmq"; } - @Nullable - @Override - public String getDestinationKind(PublishingMessageImpl message) { - return SemanticAttributes.MessagingDestinationKindValues.TOPIC; - } - @Nullable @Override public String getDestination(PublishingMessageImpl message) { diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v5_0/AbstractRocketMqClientSuppressReceiveSpanTest.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v5_0/AbstractRocketMqClientSuppressReceiveSpanTest.java index e29780bb2992..6fe8e4fdea4c 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v5_0/AbstractRocketMqClientSuppressReceiveSpanTest.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v5_0/AbstractRocketMqClientSuppressReceiveSpanTest.java @@ -6,7 +6,6 @@ package io.opentelemetry.instrumentation.rocketmqclient.v5_0; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_DESTINATION_KIND; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_DESTINATION_NAME; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_MESSAGE_ID; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; @@ -22,7 +21,6 @@ import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; import io.opentelemetry.instrumentation.testing.util.ThrowingSupplier; import io.opentelemetry.sdk.trace.data.StatusData; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.Arrays; @@ -123,9 +121,6 @@ void testSendAndConsumeMessage() throws Throwable { equalTo( MESSAGING_MESSAGE_ID, sendReceipt.getMessageId().toString()), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic)), span -> span.hasKind(SpanKind.CONSUMER) @@ -143,9 +138,6 @@ void testSendAndConsumeMessage() throws Throwable { equalTo( MESSAGING_MESSAGE_ID, sendReceipt.getMessageId().toString()), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic), equalTo(MESSAGING_OPERATION, "process")), span -> diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v5_0/AbstractRocketMqClientTest.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v5_0/AbstractRocketMqClientTest.java index 3c95fc409154..9d0dfcab91ff 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v5_0/AbstractRocketMqClientTest.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/testing/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v5_0/AbstractRocketMqClientTest.java @@ -7,7 +7,6 @@ import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.orderByRootSpanKind; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_DESTINATION_KIND; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_DESTINATION_NAME; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_MESSAGE_ID; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; @@ -32,7 +31,6 @@ import io.opentelemetry.sdk.trace.data.LinkData; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.data.StatusData; -import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Duration; @@ -420,9 +418,6 @@ private static SpanDataAssert assertProducerSpan( equalTo(MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, (long) body.length), equalTo(MESSAGING_SYSTEM, "rocketmq"), equalTo(MESSAGING_MESSAGE_ID, sendReceipt.getMessageId().toString()), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic))); attributeAssertions.addAll(Arrays.asList(extraAttributes)); @@ -451,9 +446,6 @@ private static SpanDataAssert assertProducerSpanWithFifoMessage( equalTo(MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, (long) body.length), equalTo(MESSAGING_SYSTEM, "rocketmq"), equalTo(MESSAGING_MESSAGE_ID, sendReceipt.getMessageId().toString()), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic))); attributeAssertions.addAll(Arrays.asList(extraAttributes)); @@ -482,9 +474,6 @@ private static SpanDataAssert assertProducerSpanWithDelayMessage( equalTo(MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, (long) body.length), equalTo(MESSAGING_SYSTEM, "rocketmq"), equalTo(MESSAGING_MESSAGE_ID, sendReceipt.getMessageId().toString()), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic))); attributeAssertions.addAll(Arrays.asList(extraAttributes)); @@ -502,9 +491,6 @@ private static SpanDataAssert assertReceiveSpan( .hasAttributesSatisfyingExactly( equalTo(MESSAGING_ROCKETMQ_CLIENT_GROUP, consumerGroup), equalTo(MESSAGING_SYSTEM, "rocketmq"), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic), equalTo(MESSAGING_OPERATION, "receive")); } @@ -528,9 +514,6 @@ private static SpanDataAssert assertProcessSpan( equalTo(MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, (long) body.length), equalTo(MESSAGING_SYSTEM, "rocketmq"), equalTo(MESSAGING_MESSAGE_ID, sendReceipt.getMessageId().toString()), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic), equalTo(MESSAGING_OPERATION, "process"))); attributeAssertions.addAll(Arrays.asList(extraAttributes)); @@ -564,9 +547,6 @@ private static SpanDataAssert assertProcessSpanWithFifoMessage( equalTo(MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, (long) body.length), equalTo(MESSAGING_SYSTEM, "rocketmq"), equalTo(MESSAGING_MESSAGE_ID, sendReceipt.getMessageId().toString()), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic), equalTo(MESSAGING_OPERATION, "process"))); attributeAssertions.addAll(Arrays.asList(extraAttributes)); @@ -600,9 +580,6 @@ private static SpanDataAssert assertProcessSpanWithDelayMessage( equalTo(MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, (long) body.length), equalTo(MESSAGING_SYSTEM, "rocketmq"), equalTo(MESSAGING_MESSAGE_ID, sendReceipt.getMessageId().toString()), - equalTo( - MESSAGING_DESTINATION_KIND, - SemanticAttributes.MessagingDestinationKindValues.TOPIC), equalTo(MESSAGING_DESTINATION_NAME, topic), equalTo(MESSAGING_OPERATION, "process"))); attributeAssertions.addAll(Arrays.asList(extraAttributes)); diff --git a/instrumentation/runtime-metrics/runtime-metrics-java8/library/build.gradle.kts b/instrumentation/runtime-metrics/runtime-metrics-java8/library/build.gradle.kts index 2691d6220fa0..4957c47b0e47 100644 --- a/instrumentation/runtime-metrics/runtime-metrics-java8/library/build.gradle.kts +++ b/instrumentation/runtime-metrics/runtime-metrics-java8/library/build.gradle.kts @@ -6,6 +6,5 @@ dependencies { implementation(project(":instrumentation-api")) implementation("io.opentelemetry:opentelemetry-extension-incubator") - testImplementation("io.opentelemetry:opentelemetry-sdk-metrics") testImplementation(project(":testing-common")) } diff --git a/instrumentation/rxjava/rxjava-3-common/testing/src/main/java/io/opentelemetry/instrumentation/rxjava/v3/common/AbstractRxJava3Test.java b/instrumentation/rxjava/rxjava-3-common/testing/src/main/java/io/opentelemetry/instrumentation/rxjava/v3/common/AbstractRxJava3Test.java index d5471f952477..aea341536897 100644 --- a/instrumentation/rxjava/rxjava-3-common/testing/src/main/java/io/opentelemetry/instrumentation/rxjava/v3/common/AbstractRxJava3Test.java +++ b/instrumentation/rxjava/rxjava-3-common/testing/src/main/java/io/opentelemetry/instrumentation/rxjava/v3/common/AbstractRxJava3Test.java @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.rxjava.v3.common; -import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat; +import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.attributeEntry; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts b/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts index 664f7fc36e1c..8cd1255fd92c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts +++ b/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts @@ -37,7 +37,6 @@ dependencies { compileOnly("io.opentelemetry:opentelemetry-extension-trace-propagators") compileOnly("io.opentelemetry.contrib:opentelemetry-aws-xray-propagator") compileOnly("io.opentelemetry:opentelemetry-exporter-logging") - compileOnly("io.opentelemetry:opentelemetry-exporter-otlp-logs") compileOnly("io.opentelemetry:opentelemetry-exporter-jaeger") compileOnly("io.opentelemetry:opentelemetry-exporter-otlp") compileOnly("io.opentelemetry:opentelemetry-exporter-zipkin") @@ -63,7 +62,6 @@ dependencies { testImplementation("io.opentelemetry:opentelemetry-extension-trace-propagators") testImplementation("io.opentelemetry.contrib:opentelemetry-aws-xray-propagator") testImplementation("io.opentelemetry:opentelemetry-exporter-logging") - testImplementation("io.opentelemetry:opentelemetry-exporter-otlp-logs") testImplementation("io.opentelemetry:opentelemetry-exporter-jaeger") testImplementation("io.opentelemetry:opentelemetry-exporter-otlp") testImplementation("io.opentelemetry:opentelemetry-exporter-zipkin") diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfiguration.java index 04700b4dfbe7..68e1e5be6121 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfiguration.java @@ -5,8 +5,8 @@ package io.opentelemetry.instrumentation.spring.autoconfigure; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.api.trace.TracerProvider; import io.opentelemetry.context.propagation.ContextPropagators; import io.opentelemetry.instrumentation.spring.autoconfigure.resources.SpringResourceConfigProperties; @@ -83,16 +83,14 @@ public SdkLoggerProvider sdkLoggerProvider( SdkLoggerProviderBuilder loggerProviderBuilder = SdkLoggerProvider.builder(); loggerProviderBuilder.setResource(otelResource); - loggerExportersProvider.getIfAvailable(Collections::emptyList).stream() + loggerExportersProvider + .getIfAvailable(Collections::emptyList) .forEach( loggerExporter -> loggerProviderBuilder.addLogRecordProcessor( BatchLogRecordProcessor.builder(loggerExporter).build())); - SdkLoggerProvider loggerProvider = loggerProviderBuilder.build(); - GlobalLoggerProvider.set(loggerProvider); - - return loggerProvider; + return loggerProviderBuilder.build(); } @Bean @@ -143,6 +141,9 @@ public OpenTelemetry openTelemetry( ContextPropagators propagators = propagatorsProvider.getIfAvailable(ContextPropagators::noop); + // global is needed for logging appenders + GlobalOpenTelemetry.set(OpenTelemetrySdk.builder().setLoggerProvider(loggerProvider).build()); + return OpenTelemetrySdk.builder() .setTracerProvider(tracerProvider) .setMeterProvider(meterProvider) diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfigurationTest.java index e8a4b1546276..35809251e5c8 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfigurationTest.java @@ -8,9 +8,9 @@ import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.SERVICE_NAME; import static org.assertj.core.api.Assertions.assertThat; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.instrumentation.spring.autoconfigure.resources.OtelResourceAutoConfiguration; import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.logs.SdkLoggerProvider; @@ -39,7 +39,7 @@ public OpenTelemetry customOpenTelemetry() { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfigurationTest.java index 6bd10650947b..0f61763ac496 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -26,7 +26,7 @@ public class TraceAspectAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfigurationTest.java index 78f5bfc231e7..b46645121c17 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.exporter.jaeger.JaegerGrpcSpanExporter; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -27,7 +27,7 @@ class JaegerSpanExporterAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingMetricExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingMetricExporterAutoConfigurationTest.java index 548d341ba15f..62e30cdd899c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingMetricExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingMetricExporterAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.exporter.logging.LoggingMetricExporter; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -26,7 +26,7 @@ class LoggingMetricExporterAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterAutoConfigurationTest.java index b2aab55f94db..3f0f9c2a20fa 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.exporter.logging.LoggingSpanExporter; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -28,7 +28,7 @@ class LoggingSpanExporterAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpLogExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpLogExporterAutoConfigurationTest.java index 354c3fc686be..8fde124356ab 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpLogExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpLogExporterAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporter; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -25,7 +25,7 @@ class OtlpLogExporterAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpMetricExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpMetricExporterAutoConfigurationTest.java index 219572efcd0b..9b8ac94017c4 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpMetricExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpMetricExporterAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -25,7 +25,7 @@ class OtlpMetricExporterAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpSpanExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpSpanExporterAutoConfigurationTest.java index d7e6d1829be2..108afea8856d 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpSpanExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpSpanExporterAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -27,7 +27,7 @@ class OtlpSpanExporterAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterAutoConfigurationTest.java index 3729ad53f04e..f5120be939b1 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -27,7 +27,7 @@ class ZipkinSpanExporterAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfigurationTest.java index d6ca636f7db3..3a98e6a3f607 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -26,7 +26,7 @@ class RestTemplateAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfigurationTest.java index aaf49f8f33f1..aaa7fc2468a5 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -26,7 +26,7 @@ class WebClientAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/kafka/KafkaIntegrationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/kafka/KafkaIntegrationTest.java index 3decd7a88f9a..a086bed7b397 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/kafka/KafkaIntegrationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/kafka/KafkaIntegrationTest.java @@ -109,7 +109,6 @@ private static void runShouldInstrumentProducerAndConsumer( .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, "testTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -127,7 +126,6 @@ private static void runShouldInstrumentProducerAndConsumer( .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, "testTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/metrics/MicrometerShimAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/metrics/MicrometerShimAutoConfigurationTest.java index 18d40da93bc4..4e62b622ee6b 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/metrics/MicrometerShimAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/metrics/MicrometerShimAutoConfigurationTest.java @@ -8,7 +8,7 @@ import static org.assertj.core.api.Assertions.assertThat; import io.micrometer.core.instrument.MeterRegistry; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.micrometer.v1_5.OpenTelemetryMeterRegistry; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -27,7 +27,7 @@ class MicrometerShimAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/PropagationAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/PropagationAutoConfigurationTest.java index 00dd4c71f80f..b5bc165f0ced 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/PropagationAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/PropagationAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.context.propagation.TextMapPropagator; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -26,7 +26,7 @@ class PropagationAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/PropagationPropertiesTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/PropagationPropertiesTest.java index f835cb68be5b..7d0dbbe2306c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/PropagationPropertiesTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/propagators/PropagationPropertiesTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import java.util.Arrays; import org.junit.jupiter.api.BeforeEach; @@ -26,7 +26,7 @@ public class PropagationPropertiesTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/OtelResourceAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/OtelResourceAutoConfigurationTest.java index 0ab180d6faec..e0ac7e58320f 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/OtelResourceAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/OtelResourceAutoConfigurationTest.java @@ -7,7 +7,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -24,7 +24,7 @@ public class OtelResourceAutoConfigurationTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/OtelResourcePropertiesTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/OtelResourcePropertiesTest.java index ec36d97b7a73..89881bafa64c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/OtelResourcePropertiesTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/OtelResourcePropertiesTest.java @@ -8,7 +8,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -23,7 +23,7 @@ public class OtelResourcePropertiesTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/SpringResourceConfigPropertiesTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/SpringResourceConfigPropertiesTest.java index 96f4209c599a..969a81d5a369 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/SpringResourceConfigPropertiesTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/resources/SpringResourceConfigPropertiesTest.java @@ -8,7 +8,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -21,7 +21,7 @@ class SpringResourceConfigPropertiesTest { @BeforeEach void resetGlobalLoggerProvider() { - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationSpring6Test.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationSpring6Test.java index 26f8f5ea5aba..22ab4809381d 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationSpring6Test.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationSpring6Test.java @@ -8,7 +8,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import jakarta.servlet.Filter; import org.junit.jupiter.api.BeforeEach; @@ -29,7 +29,7 @@ class WebMvcFilterAutoConfigurationSpring6Test { @BeforeEach void setUp() { assumeTrue(Boolean.getBoolean("testLatestDeps")); - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationTest.java index 20420df04f19..4e44a5cbcf54 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationTest.java @@ -8,7 +8,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; -import io.opentelemetry.api.logs.GlobalLoggerProvider; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; import javax.servlet.Filter; import org.junit.jupiter.api.BeforeEach; @@ -28,7 +28,7 @@ class WebMvcFilterAutoConfigurationTest { @BeforeEach void setUp() { assumeFalse(Boolean.getBoolean("testLatestDeps")); - GlobalLoggerProvider.resetForTest(); + GlobalOpenTelemetry.resetForTest(); } @Test diff --git a/instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationAndRabbitTest.groovy b/instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationAndRabbitTest.groovy index c3873074ec63..4df661a8b759 100644 --- a/instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationAndRabbitTest.groovy +++ b/instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationAndRabbitTest.groovy @@ -47,7 +47,6 @@ class SpringIntegrationAndRabbitTest extends AgentInstrumentationSpecification i "$SemanticAttributes.NET_SOCK_PEER_PORT" Long "$SemanticAttributes.NET_SOCK_FAMILY" { it == SemanticAttributes.NetSockFamilyValues.INET6 || it == null } "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" } } span(3) { @@ -61,7 +60,6 @@ class SpringIntegrationAndRabbitTest extends AgentInstrumentationSpecification i "$SemanticAttributes.NET_SOCK_FAMILY" { it == SemanticAttributes.NetSockFamilyValues.INET6 || it == null } "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "testTopic" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY" String } @@ -76,7 +74,6 @@ class SpringIntegrationAndRabbitTest extends AgentInstrumentationSpecification i attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "testTopic" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY" String @@ -91,7 +88,6 @@ class SpringIntegrationAndRabbitTest extends AgentInstrumentationSpecification i attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "testTopic" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_ID" String "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long @@ -114,7 +110,6 @@ class SpringIntegrationAndRabbitTest extends AgentInstrumentationSpecification i "$SemanticAttributes.NET_SOCK_PEER_PORT" Long "$SemanticAttributes.NET_SOCK_FAMILY" { it == SemanticAttributes.NetSockFamilyValues.INET6 || it == null } "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" } } } diff --git a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringMessagingAttributesGetter.java b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringMessagingAttributesGetter.java index d3223c126d93..1632b31f121e 100644 --- a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringMessagingAttributesGetter.java +++ b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringMessagingAttributesGetter.java @@ -21,12 +21,6 @@ public String getSystem(MessageWithChannel messageWithChannel) { return null; } - @Override - @Nullable - public String getDestinationKind(MessageWithChannel messageWithChannel) { - return null; - } - @Override @Nullable public String getDestination(MessageWithChannel messageWithChannel) { diff --git a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/test/groovy/SpringListenerTest.groovy b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/test/groovy/SpringListenerTest.groovy index eb19bac04b4f..e5db7900c1cc 100644 --- a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/test/groovy/SpringListenerTest.groovy +++ b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/test/groovy/SpringListenerTest.groovy @@ -31,11 +31,11 @@ class SpringListenerTest extends AgentInstrumentationSpecification { traces.sort(orderByRootSpanKind(CONSUMER, PRODUCER)) trace(0, 1) { - consumerSpan(it, 0, "queue", "SpringListenerJms2", "", null, "receive") + consumerSpan(it, 0, "SpringListenerJms2", "", null, "receive") } trace(1, 2) { - producerSpan(it, 0, "queue", "SpringListenerJms2") - consumerSpan(it, 1, "queue", "SpringListenerJms2", "", span(0), "process") + producerSpan(it, 0, "SpringListenerJms2") + consumerSpan(it, 1, "SpringListenerJms2", "", span(0), "process") } } @@ -46,7 +46,7 @@ class SpringListenerTest extends AgentInstrumentationSpecification { config << [AnnotatedListenerConfig, ManualListenerConfig] } - static producerSpan(TraceAssert trace, int index, String destinationType, String destinationName, boolean testHeaders = false) { + static producerSpan(TraceAssert trace, int index, String destinationName, boolean testHeaders = false) { trace.span(index) { name destinationName + " send" kind PRODUCER @@ -54,7 +54,6 @@ class SpringListenerTest extends AgentInstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "jms" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType if (destinationName == "(temporary)") { "$SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY" true } @@ -70,7 +69,7 @@ class SpringListenerTest extends AgentInstrumentationSpecification { // passing messageId = null will verify message.id is not captured, // passing messageId = "" will verify message.id is captured (but won't verify anything about the value), // any other value for messageId will verify that message.id is captured and has that same value - static consumerSpan(TraceAssert trace, int index, String destinationType, String destinationName, String messageId, Object parentOrLinkedSpan, String operation, boolean testHeaders = false) { + static consumerSpan(TraceAssert trace, int index, String destinationName, String messageId, Object parentOrLinkedSpan, String operation, boolean testHeaders = false) { trace.span(index) { name destinationName + " " + operation kind CONSUMER @@ -82,7 +81,6 @@ class SpringListenerTest extends AgentInstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "jms" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType "$SemanticAttributes.MESSAGING_OPERATION" operation if (messageId != null) { //In some tests we don't know exact messageId, so we pass "" and verify just the existence of the attribute diff --git a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/test/groovy/SpringTemplateTest.groovy b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/test/groovy/SpringTemplateTest.groovy index 0233c552eb25..ddf49278d9f7 100644 --- a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/test/groovy/SpringTemplateTest.groovy +++ b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/test/groovy/SpringTemplateTest.groovy @@ -5,8 +5,6 @@ import com.google.common.io.Files import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification -import javax.jms.JMSException -import javax.jms.Message import org.hornetq.api.core.TransportConfiguration import org.hornetq.api.core.client.HornetQClient import org.hornetq.api.jms.HornetQJMSClient @@ -23,6 +21,8 @@ import org.springframework.jms.core.MessagePostProcessor import spock.lang.Shared import javax.jms.Connection +import javax.jms.JMSException +import javax.jms.Message import javax.jms.Session import javax.jms.TextMessage import java.util.concurrent.TimeUnit @@ -95,16 +95,16 @@ class SpringTemplateTest extends AgentInstrumentationSpecification { receivedMessage.text == messageText assertTraces(2) { trace(0, 1) { - producerSpan(it, 0, destinationType, destinationName) + producerSpan(it, 0, destinationName) } trace(1, 1) { - consumerSpan(it, 0, destinationType, destinationName, receivedMessage.getJMSMessageID(), null, "receive") + consumerSpan(it, 0, destinationName, receivedMessage.getJMSMessageID(), null, "receive") } } where: - destination | destinationType | destinationName - session.createQueue("SpringTemplateJms2") | "queue" | "SpringTemplateJms2" + destination | destinationName + session.createQueue("SpringTemplateJms2") | "SpringTemplateJms2" } def "send and receive message generates spans"() { @@ -134,22 +134,22 @@ class SpringTemplateTest extends AgentInstrumentationSpecification { "(temporary) send")) trace(0, 1) { - consumerSpan(it, 0, destinationType, destinationName, msgId.get(), null, "receive") + consumerSpan(it, 0, destinationName, msgId.get(), null, "receive") } trace(1, 1) { - producerSpan(it, 0, destinationType, destinationName) + producerSpan(it, 0, destinationName) } trace(2, 1) { - consumerSpan(it, 0, "queue", "(temporary)", receivedMessage.getJMSMessageID(), null, "receive") + consumerSpan(it, 0, "(temporary)", receivedMessage.getJMSMessageID(), null, "receive") } trace(3, 1) { - producerSpan(it, 0, "queue", "(temporary)") + producerSpan(it, 0, "(temporary)") } } where: - destination | destinationType | destinationName - session.createQueue("SpringTemplateJms2") | "queue" | "SpringTemplateJms2" + destination | destinationName + session.createQueue("SpringTemplateJms2") | "SpringTemplateJms2" } def "capture message header as span attribute"() { @@ -168,15 +168,15 @@ class SpringTemplateTest extends AgentInstrumentationSpecification { receivedMessage.text == messageText assertTraces(2) { trace(0, 1) { - producerSpan(it, 0, destinationType, destinationName, true) + producerSpan(it, 0, destinationName, true) } trace(1, 1) { - consumerSpan(it, 0, destinationType, destinationName, receivedMessage.getJMSMessageID(), null, "receive", true) + consumerSpan(it, 0, destinationName, receivedMessage.getJMSMessageID(), null, "receive", true) } } where: - destination | destinationType | destinationName - session.createQueue("SpringTemplateJms2") | "queue" | "SpringTemplateJms2" + destination | destinationName + session.createQueue("SpringTemplateJms2") | "SpringTemplateJms2" } } diff --git a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/testReceiveSpansDisabled/groovy/SpringListenerSuppressReceiveSpansTest.groovy b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/testReceiveSpansDisabled/groovy/SpringListenerSuppressReceiveSpansTest.groovy index 8516b872633f..d628dd079cf4 100644 --- a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/testReceiveSpansDisabled/groovy/SpringListenerSuppressReceiveSpansTest.groovy +++ b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/src/testReceiveSpansDisabled/groovy/SpringListenerSuppressReceiveSpansTest.groovy @@ -22,8 +22,8 @@ class SpringListenerSuppressReceiveSpansTest extends AgentInstrumentationSpecifi expect: assertTraces(1) { trace(0, 2) { - SpringListenerTest.producerSpan(it, 0, "queue", "SpringListenerJms2") - SpringListenerTest.consumerSpan(it, 1, "queue", "SpringListenerJms2", "", span(0), "process") + SpringListenerTest.producerSpan(it, 0, "SpringListenerJms2") + SpringListenerTest.consumerSpan(it, 1, "SpringListenerJms2", "", span(0), "process") } } diff --git a/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/jms/v6_0/SpringJmsListenerTest.java b/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/jms/v6_0/SpringJmsListenerTest.java index 12f48ab13d32..cdb4d8c05128 100644 --- a/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/jms/v6_0/SpringJmsListenerTest.java +++ b/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/jms/v6_0/SpringJmsListenerTest.java @@ -115,7 +115,6 @@ void testSpringJmsListener(Class configClass) equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "spring-jms-listener"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "queue"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_ID, AbstractStringAssert::isNotBlank)), @@ -128,7 +127,6 @@ void testSpringJmsListener(Class configClass) equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "spring-jms-listener"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "queue"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_ID, @@ -145,7 +143,6 @@ void testSpringJmsListener(Class configClass) equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "spring-jms-listener"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "queue"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_ID, @@ -198,7 +195,6 @@ void shouldCaptureHeaders(Class configClass) equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "spring-jms-listener"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "queue"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_ID, AbstractStringAssert::isNotBlank), @@ -217,7 +213,6 @@ void shouldCaptureHeaders(Class configClass) equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "spring-jms-listener"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "queue"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_ID, @@ -240,7 +235,6 @@ void shouldCaptureHeaders(Class configClass) equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "spring-jms-listener"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "queue"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_ID, diff --git a/instrumentation/spring/spring-kafka-2.7/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/kafka/v2_7/SpringKafkaTest.java b/instrumentation/spring/spring-kafka-2.7/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/kafka/v2_7/SpringKafkaTest.java index 71c79e7c4b74..f07f5b172350 100644 --- a/instrumentation/spring/spring-kafka-2.7/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/kafka/v2_7/SpringKafkaTest.java +++ b/instrumentation/spring/spring-kafka-2.7/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/kafka/v2_7/SpringKafkaTest.java @@ -68,7 +68,6 @@ void shouldCreateSpansForSingleRecordProcess() { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION, AbstractLongAssert::isNotNegative), @@ -92,7 +91,6 @@ void shouldCreateSpansForSingleRecordProcess() { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), equalTo( SemanticAttributes.MESSAGING_KAFKA_CONSUMER_GROUP, @@ -113,7 +111,6 @@ void shouldCreateSpansForSingleRecordProcess() { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, @@ -167,7 +164,6 @@ void shouldHandleFailureInKafkaListener() { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION, AbstractLongAssert::isNotNegative), @@ -191,7 +187,6 @@ void shouldHandleFailureInKafkaListener() { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), equalTo( SemanticAttributes.MESSAGING_KAFKA_CONSUMER_GROUP, @@ -214,7 +209,6 @@ void shouldHandleFailureInKafkaListener() { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, @@ -264,7 +258,6 @@ void shouldCreateSpansForBatchReceiveAndProcess() throws InterruptedException { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION, AbstractLongAssert::isNotNegative), @@ -282,7 +275,6 @@ void shouldCreateSpansForBatchReceiveAndProcess() throws InterruptedException { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION, AbstractLongAssert::isNotNegative), @@ -307,7 +299,6 @@ void shouldCreateSpansForBatchReceiveAndProcess() throws InterruptedException { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), equalTo( SemanticAttributes.MESSAGING_KAFKA_CONSUMER_GROUP, @@ -330,7 +321,6 @@ void shouldCreateSpansForBatchReceiveAndProcess() throws InterruptedException { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), equalTo( SemanticAttributes.MESSAGING_KAFKA_CONSUMER_GROUP, @@ -371,7 +361,6 @@ void shouldHandleFailureInKafkaBatchListener() { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION, AbstractLongAssert::isNotNegative), @@ -395,7 +384,6 @@ void shouldHandleFailureInKafkaBatchListener() { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "receive"), equalTo( SemanticAttributes.MESSAGING_KAFKA_CONSUMER_GROUP, @@ -418,7 +406,6 @@ void shouldHandleFailureInKafkaBatchListener() { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), equalTo( SemanticAttributes.MESSAGING_KAFKA_CONSUMER_GROUP, diff --git a/instrumentation/spring/spring-kafka-2.7/testing/src/main/java/io/opentelemetry/testing/AbstractSpringKafkaNoReceiveTelemetryTest.java b/instrumentation/spring/spring-kafka-2.7/testing/src/main/java/io/opentelemetry/testing/AbstractSpringKafkaNoReceiveTelemetryTest.java index b47638dbe021..07beb409d242 100644 --- a/instrumentation/spring/spring-kafka-2.7/testing/src/main/java/io/opentelemetry/testing/AbstractSpringKafkaNoReceiveTelemetryTest.java +++ b/instrumentation/spring/spring-kafka-2.7/testing/src/main/java/io/opentelemetry/testing/AbstractSpringKafkaNoReceiveTelemetryTest.java @@ -48,7 +48,6 @@ void shouldCreateSpansForSingleRecordProcess() { equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -68,7 +67,6 @@ void shouldCreateSpansForSingleRecordProcess() { equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, @@ -120,7 +118,6 @@ void shouldHandleFailureInKafkaListener() { equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -142,7 +139,6 @@ void shouldHandleFailureInKafkaListener() { equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testSingleTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, @@ -191,7 +187,6 @@ void shouldCreateSpansForBatchReceiveAndProcess() throws InterruptedException { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -210,7 +205,6 @@ void shouldCreateSpansForBatchReceiveAndProcess() throws InterruptedException { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -240,7 +234,6 @@ void shouldCreateSpansForBatchReceiveAndProcess() throws InterruptedException { equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), equalTo( SemanticAttributes.MESSAGING_KAFKA_CONSUMER_GROUP, @@ -284,7 +277,6 @@ void shouldHandleFailureInKafkaBatchListener() { equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -312,7 +304,6 @@ void shouldHandleFailureInKafkaBatchListener() { equalTo( SemanticAttributes.MESSAGING_DESTINATION_NAME, "testBatchTopic"), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), equalTo( SemanticAttributes.MESSAGING_KAFKA_CONSUMER_GROUP, diff --git a/instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/v1_0/SpringRabbitMessageAttributesGetter.java b/instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/v1_0/SpringRabbitMessageAttributesGetter.java index ca19d71979b0..725e83858741 100644 --- a/instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/v1_0/SpringRabbitMessageAttributesGetter.java +++ b/instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/v1_0/SpringRabbitMessageAttributesGetter.java @@ -19,11 +19,6 @@ public String getSystem(Message message) { return "rabbitmq"; } - @Override - public String getDestinationKind(Message message) { - return "queue"; - } - @Override @Nullable public String getDestination(Message message) { diff --git a/instrumentation/spring/spring-rabbit-1.0/javaagent/src/test/groovy/ContextPropagationTest.groovy b/instrumentation/spring/spring-rabbit-1.0/javaagent/src/test/groovy/ContextPropagationTest.groovy index 5724ea40cef1..1cd7eaf4a046 100644 --- a/instrumentation/spring/spring-rabbit-1.0/javaagent/src/test/groovy/ContextPropagationTest.groovy +++ b/instrumentation/spring/spring-rabbit-1.0/javaagent/src/test/groovy/ContextPropagationTest.groovy @@ -113,7 +113,6 @@ class ContextPropagationTest extends AgentInstrumentationSpecification { "$SemanticAttributes.NET_SOCK_PEER_PORT" Long "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY" String if (testHeaders) { @@ -131,7 +130,6 @@ class ContextPropagationTest extends AgentInstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long "$SemanticAttributes.MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY" String @@ -148,7 +146,6 @@ class ContextPropagationTest extends AgentInstrumentationSpecification { attributes { "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "testQueue" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" "$SemanticAttributes.MESSAGING_OPERATION" "process" "$SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES" Long if (testHeaders) { @@ -170,7 +167,6 @@ class ContextPropagationTest extends AgentInstrumentationSpecification { "$SemanticAttributes.NET_SOCK_PEER_ADDR" { it == "127.0.0.1" || it == null } "$SemanticAttributes.NET_SOCK_PEER_PORT" Long "$SemanticAttributes.MESSAGING_SYSTEM" "rabbitmq" - "$SemanticAttributes.MESSAGING_DESTINATION_KIND" "queue" } } } diff --git a/instrumentation/spring/starters/spring-boot-starter/build.gradle.kts b/instrumentation/spring/starters/spring-boot-starter/build.gradle.kts index 5c00e886d886..cd1b989913f0 100644 --- a/instrumentation/spring/starters/spring-boot-starter/build.gradle.kts +++ b/instrumentation/spring/starters/spring-boot-starter/build.gradle.kts @@ -16,7 +16,6 @@ dependencies { api("io.opentelemetry:opentelemetry-api") api("io.opentelemetry:opentelemetry-exporter-logging") api("io.opentelemetry:opentelemetry-exporter-otlp") - api("io.opentelemetry:opentelemetry-exporter-otlp-logs") api("io.opentelemetry:opentelemetry-sdk") api(project(":instrumentation-annotations")) } diff --git a/instrumentation/vertx/vertx-kafka-client-3.6/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/kafka/v3_6/AbstractVertxKafkaTest.java b/instrumentation/vertx/vertx-kafka-client-3.6/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/kafka/v3_6/AbstractVertxKafkaTest.java index b5ca57e92f4a..67344abf49bb 100644 --- a/instrumentation/vertx/vertx-kafka-client-3.6/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/kafka/v3_6/AbstractVertxKafkaTest.java +++ b/instrumentation/vertx/vertx-kafka-client-3.6/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/kafka/v3_6/AbstractVertxKafkaTest.java @@ -201,7 +201,6 @@ protected static List sendAttributes( Arrays.asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, record.topic()), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, stringAssert -> stringAssert.startsWith("producer")), @@ -232,7 +231,6 @@ private static List batchConsumerAttributes(String topic, St Arrays.asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, topic), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, operation), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, @@ -255,7 +253,6 @@ protected static List processAttributes( Arrays.asList( equalTo(SemanticAttributes.MESSAGING_SYSTEM, "kafka"), equalTo(SemanticAttributes.MESSAGING_DESTINATION_NAME, record.topic()), - equalTo(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"), equalTo(SemanticAttributes.MESSAGING_OPERATION, "process"), satisfies( SemanticAttributes.MESSAGING_KAFKA_CLIENT_ID, diff --git a/javaagent-tooling/build.gradle.kts b/javaagent-tooling/build.gradle.kts index d07f43382cd6..cbce3b82d7db 100644 --- a/javaagent-tooling/build.gradle.kts +++ b/javaagent-tooling/build.gradle.kts @@ -17,11 +17,9 @@ dependencies { implementation(project(":muzzle")) implementation("io.opentelemetry:opentelemetry-api") - implementation("io.opentelemetry:opentelemetry-api-logs") + testImplementation("io.opentelemetry:opentelemetry-api-events") implementation("io.opentelemetry:opentelemetry-sdk") implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") - implementation("io.opentelemetry:opentelemetry-sdk-metrics") - implementation("io.opentelemetry:opentelemetry-sdk-logs") implementation("io.opentelemetry:opentelemetry-extension-kotlin") implementation("io.opentelemetry:opentelemetry-extension-trace-propagators") // the incubator's ViewConfigCustomizer is used to support loading yaml-based metric views @@ -31,7 +29,6 @@ dependencies { implementation("io.opentelemetry:opentelemetry-exporter-jaeger") implementation("io.opentelemetry:opentelemetry-exporter-logging") implementation("io.opentelemetry:opentelemetry-exporter-otlp") - implementation("io.opentelemetry:opentelemetry-exporter-otlp-logs") implementation("io.opentelemetry:opentelemetry-exporter-logging-otlp") implementation("io.opentelemetry:opentelemetry-exporter-prometheus") diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/OpenTelemetryInstallerTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/OpenTelemetryInstallerTest.groovy index abd588a679b2..dc3533d55e92 100755 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/OpenTelemetryInstallerTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/OpenTelemetryInstallerTest.groovy @@ -8,20 +8,17 @@ package io.opentelemetry.javaagent.tooling import io.opentelemetry.api.GlobalOpenTelemetry import io.opentelemetry.api.OpenTelemetry import io.opentelemetry.api.events.GlobalEventEmitterProvider -import io.opentelemetry.api.logs.GlobalLoggerProvider import spock.lang.Specification class OpenTelemetryInstallerTest extends Specification { void setup() { GlobalOpenTelemetry.resetForTest() - GlobalLoggerProvider.resetForTest() GlobalEventEmitterProvider.resetForTest() } void cleanup() { GlobalOpenTelemetry.resetForTest() - GlobalLoggerProvider.resetForTest() GlobalEventEmitterProvider.resetForTest() } diff --git a/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config/ConfigurationPropertiesSupplierTest.java b/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config/ConfigurationPropertiesSupplierTest.java index 8ae6af0cc5e9..5bc5af79faec 100644 --- a/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config/ConfigurationPropertiesSupplierTest.java +++ b/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config/ConfigurationPropertiesSupplierTest.java @@ -11,7 +11,6 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.events.GlobalEventEmitterProvider; -import io.opentelemetry.api.logs.GlobalLoggerProvider; import io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller; import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk; import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer; @@ -33,7 +32,6 @@ class ConfigurationPropertiesSupplierTest { @AfterAll static void cleanUp() { GlobalOpenTelemetry.resetForTest(); - GlobalLoggerProvider.resetForTest(); GlobalEventEmitterProvider.resetForTest(); } diff --git a/javaagent/build.gradle.kts b/javaagent/build.gradle.kts index 55ebb55a2e26..2c46e0f4d0ab 100644 --- a/javaagent/build.gradle.kts +++ b/javaagent/build.gradle.kts @@ -35,7 +35,6 @@ listOf(baseJavaagentLibs, javaagentLibs).forEach { it.run { exclude("io.opentelemetry", "opentelemetry-api") exclude("io.opentelemetry", "opentelemetry-api-events") - exclude("io.opentelemetry", "opentelemetry-api-logs") exclude("io.opentelemetry", "opentelemetry-semconv") // metrics advice API exclude("io.opentelemetry", "opentelemetry-extension-incubator") @@ -48,9 +47,8 @@ val licenseReportDependencies by configurations.creating { dependencies { bootstrapLibs(project(":instrumentation-api")) - // opentelemetry-api is an api dependency of :instrumentation-api, but opentelemetry-api-(events|logs) is not + // opentelemetry-api is an api dependency of :instrumentation-api, but opentelemetry-api-events is not bootstrapLibs("io.opentelemetry:opentelemetry-api-events") - bootstrapLibs("io.opentelemetry:opentelemetry-api-logs") bootstrapLibs(project(":instrumentation-api-semconv")) bootstrapLibs(project(":instrumentation-annotations-support")) bootstrapLibs(project(":javaagent-bootstrap")) diff --git a/licenses/licenses.md b/licenses/licenses.md index 8cb6048ba969..686aa8ecb44a 100644 --- a/licenses/licenses.md +++ b/licenses/licenses.md @@ -1,7 +1,7 @@ # javaagent ## Dependency License Report -_2023-06-03 19:26:17 EEST_ +_2023-06-09 15:53:28 PDT_ ## Apache License, Version 2.0 **1** **Group:** `com.blogspot.mydailyjava` **Name:** `weak-lock-free` **Version:** `0.18` @@ -37,212 +37,204 @@ _2023-06-03 19:26:17 EEST_ > - **POM Project URL**: [https://github.com/square/okio/](https://github.com/square/okio/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**7** **Group:** `io.opentelemetry` **Name:** `opentelemetry-api` **Version:** `1.26.0` +**7** **Group:** `io.opentelemetry` **Name:** `opentelemetry-api` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) -**8** **Group:** `io.opentelemetry` **Name:** `opentelemetry-api-events` **Version:** `1.26.0-alpha` +**8** **Group:** `io.opentelemetry` **Name:** `opentelemetry-api-events` **Version:** `1.27.0-alpha` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) -**9** **Group:** `io.opentelemetry` **Name:** `opentelemetry-api-logs` **Version:** `1.26.0-alpha` +**9** **Group:** `io.opentelemetry` **Name:** `opentelemetry-context` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) -**10** **Group:** `io.opentelemetry` **Name:** `opentelemetry-context` **Version:** `1.26.0` -> - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) -> - **POM License**: Apache License, Version 2.0 - [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) - -**11** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-common` **Version:** `1.26.0` -> - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) -> - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -**12** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-jaeger` **Version:** `1.26.0` +**10** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-common` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**13** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-logging` **Version:** `1.26.0` +**11** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-jaeger` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**14** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-logging-otlp` **Version:** `1.26.0` +**12** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-logging` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**15** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-otlp` **Version:** `1.26.0` +**13** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-logging-otlp` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**16** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-otlp-common` **Version:** `1.26.0` +**14** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-otlp` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**17** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-otlp-logs` **Version:** `1.26.0-alpha` +**15** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-otlp-common` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**18** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-prometheus` **Version:** `1.26.0-alpha` +**16** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-prometheus` **Version:** `1.27.0-alpha` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**19** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-zipkin` **Version:** `1.26.0` +**17** **Group:** `io.opentelemetry` **Name:** `opentelemetry-exporter-zipkin` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**20** **Group:** `io.opentelemetry` **Name:** `opentelemetry-extension-incubator` **Version:** `1.26.0-alpha` +**18** **Group:** `io.opentelemetry` **Name:** `opentelemetry-extension-incubator` **Version:** `1.27.0-alpha` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) -**21** **Group:** `io.opentelemetry` **Name:** `opentelemetry-extension-kotlin` **Version:** `1.26.0` +**19** **Group:** `io.opentelemetry` **Name:** `opentelemetry-extension-kotlin` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**22** **Group:** `io.opentelemetry` **Name:** `opentelemetry-extension-trace-propagators` **Version:** `1.26.0` +**20** **Group:** `io.opentelemetry` **Name:** `opentelemetry-extension-trace-propagators` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**23** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk` **Version:** `1.26.0` +**21** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**24** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-common` **Version:** `1.26.0` +**22** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-common` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**25** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-extension-autoconfigure` **Version:** `1.26.0-alpha` +**23** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-extension-autoconfigure` **Version:** `1.27.0-alpha` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**26** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-extension-autoconfigure-spi` **Version:** `1.26.0` +**24** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-extension-autoconfigure-spi` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**27** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-extension-incubator` **Version:** `1.26.0-alpha` +**25** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-extension-incubator` **Version:** `1.27.0-alpha` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**28** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-extension-jaeger-remote-sampler` **Version:** `1.26.0` +**26** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-extension-jaeger-remote-sampler` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**29** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-logs` **Version:** `1.26.0-alpha` +**27** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-logs` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**30** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-metrics` **Version:** `1.26.0` +**28** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-metrics` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**31** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-trace` **Version:** `1.26.0` +**29** **Group:** `io.opentelemetry` **Name:** `opentelemetry-sdk-trace` **Version:** `1.27.0` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**32** **Group:** `io.opentelemetry` **Name:** `opentelemetry-semconv` **Version:** `1.26.0-alpha` +**30** **Group:** `io.opentelemetry` **Name:** `opentelemetry-semconv` **Version:** `1.27.0-alpha` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) > - **POM License**: Apache License, Version 2.0 - [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) -**33** **Group:** `io.opentelemetry.contrib` **Name:** `opentelemetry-aws-xray-propagator` **Version:** `1.26.0-alpha` +**31** **Group:** `io.opentelemetry.contrib` **Name:** `opentelemetry-aws-xray-propagator` **Version:** `1.26.0-alpha` > - **POM Project URL**: [https://github.com/open-telemetry/opentelemetry-java-contrib](https://github.com/open-telemetry/opentelemetry-java-contrib) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**34** **Group:** `io.zipkin.reporter2` **Name:** `zipkin-reporter` **Version:** `2.16.3` +**32** **Group:** `io.zipkin.reporter2` **Name:** `zipkin-reporter` **Version:** `2.16.3` > - **Manifest Project URL**: [https://zipkin.io/](https://zipkin.io/) > - **Manifest License**: Apache License, Version 2.0 (Not Packaged) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) > - **Embedded license files**: [zipkin-reporter-2.16.3.jar/META-INF/LICENSE](zipkin-reporter-2.16.3.jar/META-INF/LICENSE) -**35** **Group:** `io.zipkin.reporter2` **Name:** `zipkin-sender-okhttp3` **Version:** `2.16.3` +**33** **Group:** `io.zipkin.reporter2` **Name:** `zipkin-sender-okhttp3` **Version:** `2.16.3` > - **Manifest Project URL**: [https://zipkin.io/](https://zipkin.io/) > - **Manifest License**: Apache License, Version 2.0 (Not Packaged) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) > - **Embedded license files**: [zipkin-sender-okhttp3-2.16.3.jar/META-INF/LICENSE](zipkin-sender-okhttp3-2.16.3.jar/META-INF/LICENSE) -**36** **Group:** `io.zipkin.zipkin2` **Name:** `zipkin` **Version:** `2.23.2` +**34** **Group:** `io.zipkin.zipkin2` **Name:** `zipkin` **Version:** `2.23.2` > - **Manifest Project URL**: [http://zipkin.io/](http://zipkin.io/) > - **Manifest License**: Apache License, Version 2.0 (Not Packaged) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) > - **Embedded license files**: [zipkin-2.23.2.jar/META-INF/LICENSE](zipkin-2.23.2.jar/META-INF/LICENSE) -**37** **Group:** `net.bytebuddy` **Name:** `byte-buddy-dep` **Version:** `1.14.5` +**35** **Group:** `net.bytebuddy` **Name:** `byte-buddy-dep` **Version:** `1.14.5` > - **POM License**: Apache License, Version 2.0 - [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) > - **Embedded license files**: [byte-buddy-dep-1.14.5.jar/META-INF/LICENSE](byte-buddy-dep-1.14.5.jar/META-INF/LICENSE) - [byte-buddy-dep-1.14.5.jar/META-INF/NOTICE](byte-buddy-dep-1.14.5.jar/META-INF/NOTICE) -**38** **Group:** `org.jetbrains` **Name:** `annotations` **Version:** `13.0` +**36** **Group:** `org.jetbrains` **Name:** `annotations` **Version:** `13.0` > - **POM Project URL**: [http://www.jetbrains.org](http://www.jetbrains.org) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**39** **Group:** `org.jetbrains.kotlin` **Name:** `kotlin-stdlib` **Version:** `1.8.21` +**37** **Group:** `org.jetbrains.kotlin` **Name:** `kotlin-stdlib` **Version:** `1.8.22` > - **POM Project URL**: [https://kotlinlang.org/](https://kotlinlang.org/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**40** **Group:** `org.jetbrains.kotlin` **Name:** `kotlin-stdlib-common` **Version:** `1.8.21` +**38** **Group:** `org.jetbrains.kotlin` **Name:** `kotlin-stdlib-common` **Version:** `1.8.22` > - **POM Project URL**: [https://kotlinlang.org/](https://kotlinlang.org/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**41** **Group:** `org.jetbrains.kotlin` **Name:** `kotlin-stdlib-jdk7` **Version:** `1.8.21` +**39** **Group:** `org.jetbrains.kotlin` **Name:** `kotlin-stdlib-jdk7` **Version:** `1.8.22` > - **POM Project URL**: [https://kotlinlang.org/](https://kotlinlang.org/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**42** **Group:** `org.jetbrains.kotlin` **Name:** `kotlin-stdlib-jdk8` **Version:** `1.8.21` +**40** **Group:** `org.jetbrains.kotlin` **Name:** `kotlin-stdlib-jdk8` **Version:** `1.8.22` > - **POM Project URL**: [https://kotlinlang.org/](https://kotlinlang.org/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) -**43** **Group:** `org.ow2.asm` **Name:** `asm` **Version:** `9.5` +**41** **Group:** `org.ow2.asm` **Name:** `asm` **Version:** `9.5` > - **Manifest Project URL**: [http://asm.ow2.org](http://asm.ow2.org) > - **Manifest License**: The 3-Clause BSD License (Not Packaged) > - **POM Project URL**: [http://asm.ow2.io/](http://asm.ow2.io/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) > - **POM License**: The 3-Clause BSD License - [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -**44** **Group:** `org.ow2.asm` **Name:** `asm-commons` **Version:** `9.5` +**42** **Group:** `org.ow2.asm` **Name:** `asm-commons` **Version:** `9.5` > - **Manifest Project URL**: [http://asm.ow2.org](http://asm.ow2.org) > - **Manifest License**: The 3-Clause BSD License (Not Packaged) > - **POM Project URL**: [http://asm.ow2.io/](http://asm.ow2.io/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) > - **POM License**: The 3-Clause BSD License - [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -**45** **Group:** `org.ow2.asm` **Name:** `asm-tree` **Version:** `9.5` +**43** **Group:** `org.ow2.asm` **Name:** `asm-tree` **Version:** `9.5` > - **Manifest Project URL**: [http://asm.ow2.org](http://asm.ow2.org) > - **Manifest License**: The 3-Clause BSD License (Not Packaged) > - **POM Project URL**: [http://asm.ow2.io/](http://asm.ow2.io/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) > - **POM License**: The 3-Clause BSD License - [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -**46** **Group:** `org.snakeyaml` **Name:** `snakeyaml-engine` **Version:** `2.6` +**44** **Group:** `org.snakeyaml` **Name:** `snakeyaml-engine` **Version:** `2.6` > - **Manifest License**: Apache License, Version 2.0 (Not Packaged) > - **POM Project URL**: [https://bitbucket.org/snakeyaml/snakeyaml-engine](https://bitbucket.org/snakeyaml/snakeyaml-engine) > - **POM License**: Apache License, Version 2.0 - [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) ## MIT License -**47** **Group:** `org.slf4j` **Name:** `slf4j-api` **Version:** `2.0.7` +**45** **Group:** `org.slf4j` **Name:** `slf4j-api` **Version:** `2.0.7` > - **Project URL**: [http://www.slf4j.org](http://www.slf4j.org) > - **POM License**: MIT License - [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT) > - **Embedded license files**: [slf4j-api-2.0.7.jar/META-INF/LICENSE.txt](slf4j-api-2.0.7.jar/META-INF/LICENSE.txt) -**48** **Group:** `org.slf4j` **Name:** `slf4j-simple` **Version:** `2.0.7` +**46** **Group:** `org.slf4j` **Name:** `slf4j-simple` **Version:** `2.0.7` > - **Project URL**: [http://www.slf4j.org](http://www.slf4j.org) > - **POM License**: MIT License - [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT) > - **Embedded license files**: [slf4j-simple-2.0.7.jar/META-INF/LICENSE.txt](slf4j-simple-2.0.7.jar/META-INF/LICENSE.txt) ## The 3-Clause BSD License -**49** **Group:** `org.ow2.asm` **Name:** `asm` **Version:** `9.5` +**47** **Group:** `org.ow2.asm` **Name:** `asm` **Version:** `9.5` > - **Manifest Project URL**: [http://asm.ow2.org](http://asm.ow2.org) > - **Manifest License**: The 3-Clause BSD License (Not Packaged) > - **POM Project URL**: [http://asm.ow2.io/](http://asm.ow2.io/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) > - **POM License**: The 3-Clause BSD License - [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -**50** **Group:** `org.ow2.asm` **Name:** `asm-commons` **Version:** `9.5` +**48** **Group:** `org.ow2.asm` **Name:** `asm-commons` **Version:** `9.5` > - **Manifest Project URL**: [http://asm.ow2.org](http://asm.ow2.org) > - **Manifest License**: The 3-Clause BSD License (Not Packaged) > - **POM Project URL**: [http://asm.ow2.io/](http://asm.ow2.io/) > - **POM License**: Apache License, Version 2.0 - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) > - **POM License**: The 3-Clause BSD License - [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -**51** **Group:** `org.ow2.asm` **Name:** `asm-tree` **Version:** `9.5` +**49** **Group:** `org.ow2.asm` **Name:** `asm-tree` **Version:** `9.5` > - **Manifest Project URL**: [http://asm.ow2.org](http://asm.ow2.org) > - **Manifest License**: The 3-Clause BSD License (Not Packaged) > - **POM Project URL**: [http://asm.ow2.io/](http://asm.ow2.io/) @@ -251,4 +243,4 @@ _2023-06-03 19:26:17 EEST_ ## Unknown -**52** **Group:** `com.squareup.okio` **Name:** `okio` **Version:** `3.2.0` +**50** **Group:** `com.squareup.okio` **Name:** `okio` **Version:** `3.2.0` diff --git a/opentelemetry-api-shaded-for-instrumenting/build.gradle.kts b/opentelemetry-api-shaded-for-instrumenting/build.gradle.kts index 02f0a84e1ebd..6fb5e5f32bb6 100644 --- a/opentelemetry-api-shaded-for-instrumenting/build.gradle.kts +++ b/opentelemetry-api-shaded-for-instrumenting/build.gradle.kts @@ -25,6 +25,12 @@ val v1_15Deps by configurations.creating { // exclude the bom added by dependencyManagement exclude("io.opentelemetry", "opentelemetry-bom") } +val v1_27Deps by configurations.creating { + isCanBeResolved = true + isCanBeConsumed = false + // exclude the bom added by dependencyManagement + exclude("io.opentelemetry", "opentelemetry-bom") +} // configuration for publishing the shadowed artifact val v1_10 by configurations.creating { @@ -35,10 +41,13 @@ val v1_15 by configurations.creating { isCanBeConsumed = true isCanBeResolved = false } +val v1_27 by configurations.creating { + isCanBeConsumed = true + isCanBeResolved = false +} dependencies { latestDeps("io.opentelemetry:opentelemetry-api") - latestDeps("io.opentelemetry:opentelemetry-api-logs") listOf("opentelemetry-api", "opentelemetry-context").forEach { v1_10Deps("io.opentelemetry:$it") { @@ -51,6 +60,11 @@ dependencies { strictly("1.15.0") } } + v1_27Deps("io.opentelemetry:$it") { + version { + strictly("1.27.0") + } + } } } @@ -74,9 +88,14 @@ tasks { configurations = listOf(v1_15Deps) archiveClassifier.set("v1_15") } + val v1_27Shadow by registering(ShadowJar::class) { + configurations = listOf(v1_27Deps) + archiveClassifier.set("v1_27") + } artifacts { add(v1_10.name, v1_10Shadow) add(v1_15.name, v1_15Shadow) + add(v1_27.name, v1_27Shadow) } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 505e8173accc..a5d4a27b2b9e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -383,7 +383,7 @@ hideFromDependabot(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:jav hideFromDependabot(":instrumentation:opentelemetry-api:opentelemetry-api-1.4:javaagent") hideFromDependabot(":instrumentation:opentelemetry-api:opentelemetry-api-1.10:javaagent") hideFromDependabot(":instrumentation:opentelemetry-api:opentelemetry-api-1.15:javaagent") -hideFromDependabot(":instrumentation:opentelemetry-api:opentelemetry-api-logs-1.23:javaagent") +hideFromDependabot(":instrumentation:opentelemetry-api:opentelemetry-api-1.27:javaagent") hideFromDependabot(":instrumentation:opentelemetry-extension-annotations-1.0:javaagent") hideFromDependabot(":instrumentation:opentelemetry-extension-kotlin-1.0:javaagent") hideFromDependabot(":instrumentation:opentelemetry-instrumentation-annotations-1.16:javaagent") diff --git a/testing-common/build.gradle.kts b/testing-common/build.gradle.kts index 81482f5f5292..803e8f50d492 100644 --- a/testing-common/build.gradle.kts +++ b/testing-common/build.gradle.kts @@ -37,9 +37,6 @@ dependencies { api("io.opentelemetry:opentelemetry-semconv") api("io.opentelemetry:opentelemetry-sdk") api("io.opentelemetry:opentelemetry-sdk-testing") - api("io.opentelemetry:opentelemetry-sdk-logs-testing") - api("io.opentelemetry:opentelemetry-sdk-metrics") - api("io.opentelemetry:opentelemetry-sdk-logs") api(project(":instrumentation-api")) api("org.assertj:assertj-core")