From 187a4764aa1a6a6cd95dccdd535d4c902faac579 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Thu, 28 Nov 2024 06:20:55 +0100 Subject: [PATCH 1/4] bump OTel to 2.10.0 --- buildSrc/src/main/java/Config.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt index dd62348342..5ec54e22d6 100644 --- a/buildSrc/src/main/java/Config.kt +++ b/buildSrc/src/main/java/Config.kt @@ -156,11 +156,11 @@ object Config { val sentryNativeNdk = "io.sentry:sentry-native-ndk:0.7.14" object OpenTelemetry { - val otelVersion = "1.41.0" + val otelVersion = "1.44.1" val otelAlphaVersion = "$otelVersion-alpha" - val otelInstrumentationVersion = "2.7.0" + val otelInstrumentationVersion = "2.10.0" val otelInstrumentationAlphaVersion = "$otelInstrumentationVersion-alpha" - val otelSemanticConvetionsVersion = "1.25.0-alpha" // check https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/dependencyManagement/build.gradle.kts#L49 for release version above to find a compatible version + val otelSemanticConvetionsVersion = "1.28.0-alpha" // check https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/dependencyManagement/build.gradle.kts#L49 for release version above to find a compatible version val otelSdk = "io.opentelemetry:opentelemetry-sdk:$otelVersion" val otelSemconv = "io.opentelemetry.semconv:opentelemetry-semconv:$otelSemanticConvetionsVersion" From 9a5dfc0ed525a681c1dd2b8d6de7c80f2b05a8ee Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Thu, 28 Nov 2024 12:52:23 +0100 Subject: [PATCH 2/4] support DB_QUERY_TEXT --- .../opentelemetry/SpanDescriptionExtractor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/SpanDescriptionExtractor.java b/sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/SpanDescriptionExtractor.java index 56acea238b..2047bd37f8 100644 --- a/sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/SpanDescriptionExtractor.java +++ b/sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/SpanDescriptionExtractor.java @@ -96,7 +96,14 @@ private OtelSpanInfo descriptionForHttpMethod( private OtelSpanInfo descriptionForDbSystem(final @NotNull SpanData otelSpan) { final @NotNull Attributes attributes = otelSpan.getAttributes(); @Nullable String dbStatement = attributes.get(DbIncubatingAttributes.DB_STATEMENT); - @NotNull String description = dbStatement != null ? dbStatement : otelSpan.getName(); - return new OtelSpanInfo("db", description, TransactionNameSource.TASK); + if (dbStatement != null) { + return new OtelSpanInfo("db", dbStatement, TransactionNameSource.TASK); + } + @Nullable String dbQueryText = attributes.get(DbIncubatingAttributes.DB_QUERY_TEXT); + if (dbQueryText != null) { + return new OtelSpanInfo("db", dbQueryText, TransactionNameSource.TASK); + } + + return new OtelSpanInfo("db", otelSpan.getName(), TransactionNameSource.TASK); } } From c1b125755315d7ea2bbfa05e42a4aae6dceebaac Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Thu, 28 Nov 2024 12:53:04 +0100 Subject: [PATCH 3/4] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0c11a9cb3..2dab3467c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Extract OpenTelemetry `URL_PATH` span attribute into description ([#3933](https://github.com/getsentry/sentry-java/pull/3933)) +### Dependencies + +- Bump OpenTelemetry to 1.44.1, OpenTelemetry Java Agent to 2.10.0 and Semantic Conventions to 1.28.0 ([#3935](https://github.com/getsentry/sentry-java/pull/3935)) + ## 8.0.0-beta.3 ### Features From ad9b417d5436b587da689014aa40fba2aa8e0c00 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Thu, 28 Nov 2024 13:59:12 +0100 Subject: [PATCH 4/4] change bom version for otel --- buildSrc/src/main/java/Config.kt | 1 + .../build.gradle.kts | 2 +- .../build.gradle.kts | 6 ------ .../build.gradle.kts | 6 ++++++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt index 5ec54e22d6..e6ebe9f193 100644 --- a/buildSrc/src/main/java/Config.kt +++ b/buildSrc/src/main/java/Config.kt @@ -170,6 +170,7 @@ object Config { val otelJavaAgentTooling = "io.opentelemetry.javaagent:opentelemetry-javaagent-tooling:$otelInstrumentationAlphaVersion" val otelExtensionAutoconfigureSpi = "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:$otelVersion" val otelExtensionAutoconfigure = "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:$otelVersion" + val otelInstrumentationBom = "io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:$otelInstrumentationVersion" } } diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts index e0f82ad781..dfa17eb952 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts @@ -71,7 +71,7 @@ dependencies { dependencyManagement { imports { - mavenBom("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.7.0") + mavenBom(Config.Libs.OpenTelemetry.otelInstrumentationBom) } } diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts index 2dd6f2574b..fe5dec4415 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts @@ -68,12 +68,6 @@ dependencies { testImplementation(Config.Libs.apolloKotlin) } -dependencyManagement { - imports { - mavenBom("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.7.0") - } -} - configure { test { java.srcDir("src/test/java") diff --git a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts index 2eab2bb10e..a7a879f0dd 100644 --- a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts @@ -70,6 +70,12 @@ dependencies { testImplementation("org.apache.httpcomponents:httpclient") } +dependencyManagement { + imports { + mavenBom(Config.Libs.OpenTelemetry.otelInstrumentationBom) + } +} + configure { test { java.srcDir("src/test/java")