diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt index 5b4e907e29..b4a2a6407e 100644 --- a/buildSrc/src/main/java/Config.kt +++ b/buildSrc/src/main/java/Config.kt @@ -95,6 +95,7 @@ object Config { val springBoot3StarterJdbc = "org.springframework.boot:spring-boot-starter-jdbc:$springBoot3Version" val springBoot3StarterActuator = "org.springframework.boot:spring-boot-starter-actuator:$springBoot3Version" val springBoot3StarterOpenTelemetry = "io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter:${OpenTelemetry.otelInstrumentationVersion}" + val springBoot3StarterOpenTelemetryNoversion = "io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter" val springWeb = "org.springframework:spring-webmvc" val springWebflux = "org.springframework:spring-webflux" diff --git a/sentry-bom/build.gradle.kts b/sentry-bom/build.gradle.kts index 9f0a0ff117..d52f664613 100644 --- a/sentry-bom/build.gradle.kts +++ b/sentry-bom/build.gradle.kts @@ -3,6 +3,8 @@ plugins { `maven-publish` } +javaPlatform.allowDependencies() + dependencies { constraints { project.rootProject.subprojects @@ -26,6 +28,7 @@ dependencies { } } } + api(platform(Config.Libs.OpenTelemetry.otelInstrumentationBom)) } publishing { diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/README.md b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/README.md index 58b94ba899..89a8e603a3 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/README.md +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/README.md @@ -1,6 +1,6 @@ # Sentry Sample Spring Boot 3.0+ -Sample application showing how to use Sentry with [Spring boot](http://spring.io/projects/spring-boot) from version `3.0` onwards. +Sample application showing how to use Sentry with [Spring boot](http://spring.io/projects/spring-boot) from version `3.0` onwards integrated with the [OpenTelemetry Spring Boot Starter](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/). ## How to run? 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 dfa17eb952..02ce7a20af 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 @@ -52,9 +52,10 @@ dependencies { implementation(projects.sentryLogback) implementation(projects.sentryGraphql22) implementation(projects.sentryQuartz) - implementation(Config.Libs.springBoot3StarterOpenTelemetry) + implementation(Config.Libs.springBoot3StarterOpenTelemetryNoversion) implementation(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap) implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentcustomization) + implementation(platform(projects.sentryBom)) // database query tracing implementation(projects.sentryJdbc) @@ -69,12 +70,6 @@ dependencies { testImplementation(Config.Libs.apolloKotlin) } -dependencyManagement { - imports { - mavenBom(Config.Libs.OpenTelemetry.otelInstrumentationBom) - } -} - configure { test { java.srcDir("src/test/java") diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/src/main/resources/application.properties b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/src/main/resources/application.properties index 1c21d32049..402538a83a 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/src/main/resources/application.properties +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/src/main/resources/application.properties @@ -31,4 +31,8 @@ spring.graphql.graphiql.enabled=true spring.graphql.websocket.path=/graphql spring.quartz.job-store-type=memory +# OTEL configuration otel.propagators=tracecontext,baggage,sentry +otel.logs.exporter=none +otel.metrics.exporter=none +otel.traces.exporter=none diff --git a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/README.md b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/README.md index bd8d0af480..e8068dab25 100644 --- a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/README.md +++ b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/README.md @@ -1,6 +1,6 @@ # Sentry Sample Spring Boot -Sample application showing how to use Sentry with [Spring boot](http://spring.io/projects/spring-boot). +Sample application showing how to use Sentry with [Spring boot](http://spring.io/projects/spring-boot) integrated with the [OpenTelemetry Spring Boot Starter](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/). ## How to run? 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 a7a879f0dd..78b3714e89 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 @@ -52,9 +52,10 @@ dependencies { implementation(projects.sentryLogback) implementation(projects.sentryGraphql) implementation(projects.sentryQuartz) - implementation(Config.Libs.springBoot3StarterOpenTelemetry) + implementation(Config.Libs.springBoot3StarterOpenTelemetryNoversion) implementation(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap) implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentcustomization) + implementation(platform(projects.sentryBom)) // database query tracing implementation(projects.sentryJdbc) @@ -70,12 +71,6 @@ dependencies { testImplementation("org.apache.httpcomponents:httpclient") } -dependencyManagement { - imports { - mavenBom(Config.Libs.OpenTelemetry.otelInstrumentationBom) - } -} - configure { test { java.srcDir("src/test/java") diff --git a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/src/main/resources/application.properties b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/src/main/resources/application.properties index c7402eacc2..43d84aeb41 100644 --- a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/src/main/resources/application.properties +++ b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/src/main/resources/application.properties @@ -23,3 +23,9 @@ spring.datasource.username=sa spring.datasource.password= spring.graphql.graphiql.enabled=true spring.graphql.websocket.path=/graphql + +# OTEL configuration +otel.propagators=tracecontext,baggage,sentry +otel.logs.exporter=none +otel.metrics.exporter=none +otel.traces.exporter=none