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

Spring Boot 3.3.x dependencies do not converge for Micrometer Tracing and OpenTelemetry #43200

Closed
mcompton13 opened this issue Nov 15, 2024 · 4 comments
Assignees
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: bug A general bug
Milestone

Comments

@mcompton13
Copy link

mcompton13 commented Nov 15, 2024

Found that org.springframework.boot:spring-boot-dependencies:3.3.5 specifies opentelemetry-bom version 1.37.0 and micrometer-tracing-bom version 1.3.5, but that version of micrometer-tracing depends on opentelemetry 1.38.0 dependencies.

This can be worked around by overloading the version of opentelemetry-bom to be version 1.38.0 in the Maven <dependencyManagement> section.

There is a work around, but this is the first time I've ever seen Spring Boot dependencies not converge "out of the box". Is this intentional? Is there a reason that Spring Boot Dependencies does not use opentelemetry-bom version 1.38.0 to align with the version of micrometer-tracing-bom? Can this be fixed in the next version of Spring Boot 3.3.x and 3.4.x? Is there something that can be done to prevent this misalignment of these tracing dependencies from happening in the future?

Here is a minimal pom.xml that reproduces the problem . Put this in a file called pom.xml and run mvn enforcer:enforce:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>

 <parent>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-dependencies</artifactId>
   <version>3.3.5</version>
 </parent>

 <artifactId>sb3.3-dependency-converg-reproducer</artifactId>

 <dependencies>
   <dependency>
     <groupId>io.micrometer</groupId>
     <artifactId>micrometer-tracing-bridge-otel</artifactId>
   </dependency>
   <dependency>
     <groupId>io.opentelemetry</groupId>
     <artifactId>opentelemetry-exporter-otlp</artifactId>
   </dependency>
 </dependencies>

 <build>
   <plugins>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-enforcer-plugin</artifactId>
       <version>3.5.0</version>
       <configuration>
         <rules>
           <dependencyConvergence/>
           <requireUpperBoundDeps/>
         </rules>
       </configuration>
       <executions>
         <execution>
           <goals>
             <goal>enforce</goal>
           </goals>
         </execution>
       </executions>
     </plugin>
   </plugins>
 </build>
</project

The issue in the above POM can be fixed by overriding the version of open-telemetry specified by Spring Boot Dependencies by adding the following:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.opentelemetry</groupId>
      <artifactId>opentelemetry-bom</artifactId>
      <!-- Override spring-boot-deps to use 1.38.0 instead of 1.37.0 -->
      <version>1.38.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 15, 2024
@mcompton13
Copy link
Author

mcompton13 commented Nov 15, 2024

Attaching a small Maven project that reproduces the issue.
reproducer-sb-issue-43200.tar.gz

Unzip it into a directory and run ./mvnw enforcer:enforce. You should see output similar to the following:

INFO] Scanning for projects...
[INFO] 
[INFO] ----< org.springframework.boot:sb3.3-dependency-converg-reproducer >----
[INFO] Building sb3.3-dependency-converg-reproducer 3.3.5
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- enforcer:3.5.0:enforce (default-cli) @ sb3.3-dependency-converg-reproducer ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.747 s
[INFO] Finished at: 2024-11-15T15:15:13-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (default-cli) on project sb3.3-dependency-converg-reproducer: 
[ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message:
[ERROR] Failed while enforcing releasability.
[ERROR] 
[ERROR] Dependency convergence error for io.opentelemetry:opentelemetry-api-incubator:jar:1.38.0-alpha paths to dependency are:
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:jar:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:jar:1.3.5:compile
[ERROR]     +-io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:jar:1.33.3-alpha:compile
[ERROR]       +-io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:jar:1.33.3:compile
[ERROR]         +-io.opentelemetry:opentelemetry-api-incubator:jar:1.38.0-alpha:runtime
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:jar:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:jar:1.3.5:compile
[ERROR]     +-io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:jar:1.33.3-alpha:compile
[ERROR]       +-io.opentelemetry:opentelemetry-api-incubator:jar:1.38.0-alpha:runtime
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:jar:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:jar:1.37.0:compile
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-metrics:jar:1.37.0:compile
[ERROR]       +-io.opentelemetry:opentelemetry-api-incubator:jar:1.37.0-alpha:runtime
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:jar:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:jar:1.37.0:compile
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-logs:jar:1.37.0:compile
[ERROR]       +-io.opentelemetry:opentelemetry-api-incubator:jar:1.37.0-alpha:runtime
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:jar:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:jar:1.37.0:compile
[ERROR]     +-io.opentelemetry:opentelemetry-exporter-otlp-common:jar:1.37.0:runtime
[ERROR]       +-io.opentelemetry:opentelemetry-api-incubator:jar:1.37.0-alpha:runtime
[ERROR] 
[ERROR] Rule 1: org.apache.maven.enforcer.rules.dependency.RequireUpperBoundDeps failed with message:
[ERROR] Failed while enforcing RequireUpperBoundDeps. The error(s) are [
[ERROR] Require upper bound dependencies error for io.opentelemetry:opentelemetry-sdk-trace:1.37.0 paths to dependency are:
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-trace:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-trace:1.38.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:1.37.0
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-trace:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-trace:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk:1.38.0
[ERROR]       +-io.opentelemetry:opentelemetry-sdk-trace:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-trace:1.37.0
[ERROR] , 
[ERROR] Require upper bound dependencies error for io.opentelemetry:opentelemetry-api:1.37.0 paths to dependency are:
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-api:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-api:1.38.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-common:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-common:1.38.0
[ERROR]       +-io.opentelemetry:opentelemetry-api:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-api:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-trace:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-trace:1.38.0
[ERROR]       +-io.opentelemetry:opentelemetry-api:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-api:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk:1.38.0
[ERROR]       +-io.opentelemetry:opentelemetry-api:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-api:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-extension-trace-propagators:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-extension-trace-propagators:1.38.0
[ERROR]       +-io.opentelemetry:opentelemetry-api:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-api:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:1.37.0
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-metrics:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-metrics:1.37.0
[ERROR]       +-io.opentelemetry:opentelemetry-api:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-api:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:1.37.0
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-logs:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-logs:1.37.0
[ERROR]       +-io.opentelemetry:opentelemetry-api:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-api:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:1.33.3-alpha
[ERROR]       +-io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:1.33.3
[ERROR]         +-io.opentelemetry:opentelemetry-api:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-api:1.38.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:1.33.3-alpha
[ERROR]       +-io.opentelemetry:opentelemetry-api-incubator:1.38.0-alpha [runtime]
[ERROR]         +-io.opentelemetry:opentelemetry-api:1.37.0 [runtime] (managed) <-- io.opentelemetry:opentelemetry-api:1.38.0 [runtime]
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:1.37.0
[ERROR]     +-io.opentelemetry:opentelemetry-exporter-otlp-common:1.37.0 [runtime] (managed) <-- io.opentelemetry:opentelemetry-exporter-otlp-common:1.37.0 [runtime]
[ERROR]       +-io.opentelemetry:opentelemetry-exporter-common:1.37.0 [runtime] (managed) <-- io.opentelemetry:opentelemetry-exporter-common:1.37.0 [runtime]
[ERROR]         +-io.opentelemetry:opentelemetry-api:1.37.0 [runtime] (managed) <-- io.opentelemetry:opentelemetry-api:1.37.0 [runtime]
[ERROR] , 
[ERROR] Require upper bound dependencies error for io.opentelemetry:opentelemetry-extension-trace-propagators:1.37.0 paths to dependency are:
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-extension-trace-propagators:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-extension-trace-propagators:1.38.0
[ERROR] , 
[ERROR] Require upper bound dependencies error for io.opentelemetry:opentelemetry-sdk-common:1.37.0 paths to dependency are:
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-common:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-common:1.38.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-trace:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-trace:1.38.0
[ERROR]       +-io.opentelemetry:opentelemetry-sdk-common:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-common:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk:1.38.0
[ERROR]       +-io.opentelemetry:opentelemetry-sdk-common:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-common:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:1.37.0
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-metrics:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-metrics:1.37.0
[ERROR]       +-io.opentelemetry:opentelemetry-sdk-common:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-common:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:1.37.0
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-logs:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-logs:1.37.0
[ERROR]       +-io.opentelemetry:opentelemetry-sdk-common:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk-common:1.37.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:1.37.0
[ERROR]     +-io.opentelemetry:opentelemetry-exporter-sender-okhttp:1.37.0 [runtime] (managed) <-- io.opentelemetry:opentelemetry-exporter-sender-okhttp:1.37.0 [runtime]
[ERROR]       +-io.opentelemetry:opentelemetry-sdk-common:1.37.0 [runtime] (managed) <-- io.opentelemetry:opentelemetry-sdk-common:1.37.0 [runtime]
[ERROR] , 
[ERROR] Require upper bound dependencies error for io.opentelemetry:opentelemetry-sdk:1.37.0 paths to dependency are:
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.micrometer:micrometer-tracing-bridge-otel:1.3.5
[ERROR]     +-io.opentelemetry:opentelemetry-sdk:1.37.0 (managed) <-- io.opentelemetry:opentelemetry-sdk:1.38.0
[ERROR] and
[ERROR] +-org.springframework.boot:sb3.3-dependency-converg-reproducer:3.3.5
[ERROR]   +-io.opentelemetry:opentelemetry-exporter-otlp:1.37.0
[ERROR]     +-io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.37.0 [runtime] (managed) <-- io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.37.0 [runtime]
[ERROR]       +-io.opentelemetry:opentelemetry-sdk:1.37.0 [runtime] (managed) <-- io.opentelemetry:opentelemetry-sdk:1.37.0 [runtime]
[ERROR] ]

@philwebb
Copy link
Member

micrometer-metrics/tracing#819 may be relevant

@wilkinsona
Copy link
Member

Micrometer Tracing upgraded to OpenTelemetry 1.38.0 in 1.3.0. I'm only guessing, but I suspect that we missed this as it happened post-RC.

Normally, we wouldn't upgrade to a new minor until a Boot minor. However, I consider this mismatch to be a bug as we're currently downgrading OpenTelemetry to an earlier version. I think we should upgrade to 1.38.0 in Boot 3.3.6.

@wilkinsona wilkinsona added for: team-attention An issue we'd like other members of the team to review type: bug A general bug and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Nov 19, 2024
@wilkinsona wilkinsona changed the title Spring Boot 3.3.5 dependencies do not converge for micrometer-tracing and opentelemetry Spring Boot 3.3.x dependencies do not converge for Micrometer Tracing and OpenTelemetry Nov 19, 2024
@wilkinsona wilkinsona added this to the 3.3.x milestone Nov 19, 2024
@wilkinsona wilkinsona self-assigned this Nov 19, 2024
@wilkinsona wilkinsona modified the milestones: 3.3.x, 3.3.6 Nov 19, 2024
@wilkinsona wilkinsona added the status: noteworthy A noteworthy issue to call out in the release notes label Nov 20, 2024
@mcompton13
Copy link
Author

Thank you for the prompt fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants