Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-69: Spring Boot 3.4.0 and otel cleanup #211

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

davidangb
Copy link
Contributor

@davidangb davidangb commented Dec 11, 2024

  • Upgrade to Spring Boot 3.4.0
  • Align OpenTelemetry dependencies to the Spring Boot version and to each other
  • Remove usages of @SpyBean, which is now deprecated
  • bonus: update sam-client to latest

This PR supersedes #210

References:
https://docs.spring.io/spring-boot/appendix/dependency-versions/coordinates.html
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.4-Release-Notes#deprecation-of-mockbean-and-spybean

@davidangb davidangb changed the title align otel dependencies CORE-69: Spring Boot 3.4.0 and otel cleanup Dec 11, 2024
@@ -51,6 +52,7 @@ dependencies {

// Spring
implementation group: 'org.springframework.retry', name: 'spring-retry'
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jdbc'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spring-boot-autoconfigure moved up from line 108, where it was hidden in with otel dependencies

build.gradle Outdated
// We need >= 1.32.0 so that our HttpServerMetrics can use Meter.setExplicitBucketBoundariesAdvice:
ext['opentelemetry.version'] = '1.42.1'
ext['opentelemetry.version'] = '1.43.0'
ext['opentelemetry.instrumentation.version'] = '2.9.0' // 2.9.0 targets opentelemetry 1.43.0
Copy link
Contributor Author

@davidangb davidangb Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually a downgrade. We had been on 2.10.0 before this PR. I thought this was more appropriate, since 2.10.0 wants opentelemetry 1.44.1. See https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases.

If we decide to keep all the otel dependency versions aligned with Spring Boot, we should probably tell dependabot to ignore those updates.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need these lines anymore? I think they were there to specify a more advanced version than spring required, is that still true?

implementation 'io.opentelemetry:opentelemetry-sdk-extension-autoconfigure'
implementation 'io.opentelemetry:opentelemetry-exporter-otlp'
implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'io.opentelemetry:opentelemetry-exporter-prometheus'
Copy link
Contributor Author

@davidangb davidangb Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reorganized this whole section. The diff is hard to read, so I'll try to summarize:

  1. Moved the version number for opentelemetry-instrumentation-bom-alpha into an ext variable at line 26, so it is easily visible next to the main opentelemetry version.

  2. removed a few dependencies which were redundant; these are pulled in transitively when needed:

implementation platform('io.opentelemetry:opentelemetry-bom-alpha:1.44.1-alpha')
implementation platform('io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.10.0')
implementation 'io.opentelemetry:opentelemetry-sdk'
implementation 'io.opentelemetry:opentelemetry-sdk-metrics'
  1. replaced 'io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0' with 'io.opentelemetry.semconv:opentelemetry-semconv'. The latter is smaller; we didn't really need the former.

  2. grouped into two categories: those version-managed by Spring and those version-managed by us via opentelemetry-instrumentation-bom-alpha

  3. within those groupings, alphabetized the libraries

@@ -77,7 +79,7 @@ dependencies {
runtimeOnly group: 'org.postgresql', name: 'postgresql'

// Terra libraries
implementation group: 'org.broadinstitute.dsde.workbench', name: 'sam-client_2.13', version: '0.1-0c4b377'
implementation group: 'org.broadinstitute.dsde.workbench', name: 'sam-client_2.13', version: 'v0.0.329'
Copy link
Contributor Author

@davidangb davidangb Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't required by the Spring Boot upgrade, but while in this file I noticed that we were using an old, non-semantic-version of sam-client.

sam-client:0.1-0c4b377 - Feb 14 2024
sam-client:v0.0.329 - Dec 10 2024

@davidangb davidangb requested review from dvoet, a team and calypsomatic and removed request for a team December 11, 2024 20:13
@davidangb
Copy link
Contributor Author

@dvoet I'd especially love your opinion on the otel library-version changes here

Copy link
Contributor

@dvoet dvoet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good but one question

build.gradle Outdated
// We need >= 1.32.0 so that our HttpServerMetrics can use Meter.setExplicitBucketBoundariesAdvice:
ext['opentelemetry.version'] = '1.42.1'
ext['opentelemetry.version'] = '1.43.0'
ext['opentelemetry.instrumentation.version'] = '2.9.0' // 2.9.0 targets opentelemetry 1.43.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need these lines anymore? I think they were there to specify a more advanced version than spring required, is that still true?

@davidangb
Copy link
Contributor Author

do we need these lines anymore? I think they were there to specify a more advanced version than spring required, is that still true?

@dvoet I suspect we don't need them, but I was worried I missed some code somewhere that referenced that property. I will (try to) remove them.

@davidangb davidangb merged commit 12ac301 into develop Dec 11, 2024
3 checks passed
@davidangb davidangb deleted the da_CORE-69_springBoot340 branch December 11, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants