docs: Add JDBC dependency conflict warning for Spring AI integration#3122
Open
muxiaoming wants to merge 2 commits into
Open
docs: Add JDBC dependency conflict warning for Spring AI integration#3122muxiaoming wants to merge 2 commits into
muxiaoming wants to merge 2 commits into
Conversation
Add a warning section explaining the OpenTelemetry version conflict that occurs when using JDBC datasource with Spring AI. Includes: - Problem description and error message - Root cause analysis - Solution with XML configuration - Links to related PR and bug report Closes langfuse#3116
|
@muxiaoming is attempting to deploy a commit to the langfuse Team on Vercel. A member of the Team first needs to authorize it. |
Address code review feedback: - Remove hardcoded version 2.17.0-alpha, let BOM manage it - Add Gradle equivalent for the workaround - Make version numbers in explanation more generic - Add note that exact versions may vary
Author
✅ Issues FixedI've addressed all 3 code review issues from Greptile: 1. Removed hardcoded version
2. Added Gradle equivalent
3. Made version numbers generic
The fix now works correctly with the BOM defined earlier in the guide. No version conflicts! Commit: |
Author
✅ Code Review Issues FixedI've addressed all 3 code review issues from Greptile in the latest commit ( 1. Removed hardcoded version
2. Added Gradle equivalent
3. Made version numbers generic
Please re-trigger Greptile review on the latest commit. The fix now works correctly with the BOM defined earlier in the guide. No version conflicts! Commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a warning note about OpenTelemetry dependency conflict when using JDBC datasource with Spring AI integration.
Problem
The current documentation doesn't mention that adding JDBC dependencies will cause a version conflict between
micrometer-tracing-bridge-otelandopentelemetry-jdbc, leading to application startup failure.Changes
Why This Matters
Many Spring AI applications require database access for:
Without this documentation update, users will encounter cryptic errors and waste time debugging dependency issues.
Related PRs & Issues
Test Plan
Greptile Summary
This PR adds a new "⚠️ Important: JDBC Dependency Conflict" warning section to the Spring AI integration guide, documenting a known
opentelemetry-instrumentation-api-incubatorversion conflict that causes application startup failure when JDBC dependencies are added alongside the OpenTelemetry stack.opentelemetry-instrumentation-api-incubator:2.17.0-alpha, but the guide's own<dependencyManagement>block already importsopentelemetry-instrumentation-bom:2.28.1, which manages a newer2.28.x-alphaversion of that artifact — applying the fix as written would downgrade the artifact and likely reproduce the conflict under a different form.1.4.4,2.9.0-alpha) are tied to Spring Boot 3.4.x and will silently become misleading as users upgrade.Confidence Score: 3/5
The documented workaround contradicts the BOM version already prescribed in the same guide and should be corrected before merging.
The core fix in the XML snippet pins
opentelemetry-instrumentation-api-incubatorto2.17.0-alpha, but the same guide'sdependencyManagementimportsopentelemetry-instrumentation-bom:2.28.1, which already manages that artifact at a2.28.x-alphaversion. A user following the guide end-to-end would apply this snippet and silently downgrade the incubator artifact below what the BOM expects, likely causing a different runtime failure. The intent of the section is good and the underlying conflict is real, but the prescribed version needs to be reconciled with the BOM already in use.content/integrations/frameworks/spring-ai.mdx — specifically the explicit version pin in the workaround snippet and its relationship to the BOM declared earlier in the same file.
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[User adds spring-boot-starter-jdbc] --> B[Maven dependency resolution] B --> C{Version conflict?} C -- micrometer-tracing pulls in opentelemetry-instrumentation-api-incubator:2.9.0-alpha --> D[opentelemetry-jdbc:2.17.0-alpha needs 2.17.0-alpha] D --> E[Maven picks older 2.9.0-alpha nearest-wins strategy] E --> F[setCaptureQueryParameters method missing - Application fails to start] C -- No JDBC dep --> G[Application starts normally] F --> H{Apply fix from docs} H --> I[Exclude opentelemetry-instrumentation-api-incubator from micrometer-tracing-bridge-otel] I --> J[Explicitly declare version 2.17.0-alpha] J --> K{BOM already imports opentelemetry-instrumentation-bom:2.28.1?} K -- Yes --> L[2.17.0-alpha overrides BOM - Downgrade conflict] K -- No --> M[Correct version used - Application starts]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[User adds spring-boot-starter-jdbc] --> B[Maven dependency resolution] B --> C{Version conflict?} C -- micrometer-tracing pulls in opentelemetry-instrumentation-api-incubator:2.9.0-alpha --> D[opentelemetry-jdbc:2.17.0-alpha needs 2.17.0-alpha] D --> E[Maven picks older 2.9.0-alpha nearest-wins strategy] E --> F[setCaptureQueryParameters method missing - Application fails to start] C -- No JDBC dep --> G[Application starts normally] F --> H{Apply fix from docs} H --> I[Exclude opentelemetry-instrumentation-api-incubator from micrometer-tracing-bridge-otel] I --> J[Explicitly declare version 2.17.0-alpha] J --> K{BOM already imports opentelemetry-instrumentation-bom:2.28.1?} K -- Yes --> L[2.17.0-alpha overrides BOM - Downgrade conflict] K -- No --> M[Correct version used - Application starts]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "docs: Add JDBC dependency conflict warni..." | Re-trigger Greptile