-
Notifications
You must be signed in to change notification settings - Fork 315
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
OpenTelemetry version not defined in version management leads to NoSuchMethodException #3011
Comments
As an immediate workaround: the OpenTelemetry version can be explicitly defined in the application's pom.xml, and will take precedence over the version being provided by Spring Boot. Although opentelemetry is defined in java-shared-dependencies' third-party-dependencies for use by projects like spanner-jdbc, the libraries-bom does not include third-party-dependencies and opentelemetry is also not listed in spring-cloud-gcp-dependencies. The result is that Spring Boot's dependency management controls the opentelemetry version. Some options:
Note: @breun has expressed concern with the above two options. Alternatives are discussed below. |
Thanks for looking at this! I forgot to add the workaround, indeed. For me this is not immediately blocking because of it, but a report seemed like a good idea regardless :) |
Spring Cloud GCP overriding Spring Boot's dependency management sounds dangerous to me, because it could cause issues, confusion and other problems for Spring Boot users. Spring Boot documentation about observation might no longer apply as-is for instance. I'd say that ideally it should be possible to add Spring Cloud GCP to project with a compatible version of Spring Boot, without Spring Cloud GCP causing changes in versions of dependencies managed by Spring Boot. |
Maybe |
@breun : I've updated my comment above to point to your concerns. When Tomo and Blake get back from vacation, we'll discuss the options you've provided. |
This is resolved in #3146 |
Describe the bug
Opening a JDBC connection to a spanner database throws the exception:
It looks like
google-cloud-spanner-jdbc 2.19.3
uses thesetExplicitBucketBoundariesAdvice
which is only available since version1.32.0
ofopentelemetry-api
(see javadoc at https://javadoc.io/doc/io.opentelemetry/opentelemetry-api/latest/io/opentelemetry/api/metrics/LongHistogramBuilder.html), but Spring boot 3.2 providesopentelemetry-api
version1.31.0
(see https://github.com/spring-projects/spring-boot/blob/3.2.x/spring-boot-project/spring-boot-dependencies/build.gradle#L1103).I am not 100% sure if spanner-jdbc is intended to be part of the spring-cloud-gcp offering or if it is included in my dependency chain, but I am worried about version divergence in case I start managing spanner-jdbc myself (because we do use other spanner modules from the spring-cloud-gcp project).
Versions:
I observed the problem in spring-cloud-gcp 5.4.1 as well, but went to the latest available to make sure it wasn't fixed already.
Sample
See https://github.com/Carst-Tankink/spanner-jdbc-incompatible-example for a self-contained example, based on existing spanner-JDBC sample code and the spring-cloud-gcp starter.
I expect this application to start up and the
/timestamp
endpoint to properly connect to spanner and execute the query (provided a spanner database is created).The text was updated successfully, but these errors were encountered: