Skip to content

Commit

Permalink
POTEL 59 - Bump OpenTelemetry (#3935)
Browse files Browse the repository at this point in the history
* bump OTel to 2.10.0

* support DB_QUERY_TEXT

* changelog

* change bom version for otel
  • Loading branch information
adinauer authored Nov 29, 2024
1 parent 7c61b46 commit 7345b18
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies {

dependencyManagement {
imports {
mavenBom("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.7.0")
mavenBom(Config.Libs.OpenTelemetry.otelInstrumentationBom)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ dependencies {
testImplementation(Config.Libs.apolloKotlin)
}

dependencyManagement {
imports {
mavenBom("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.7.0")
}
}

configure<SourceSetContainer> {
test {
java.srcDir("src/test/java")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ dependencies {
testImplementation("org.apache.httpcomponents:httpclient")
}

dependencyManagement {
imports {
mavenBom(Config.Libs.OpenTelemetry.otelInstrumentationBom)
}
}

configure<SourceSetContainer> {
test {
java.srcDir("src/test/java")
Expand Down

0 comments on commit 7345b18

Please sign in to comment.