Skip to content

Prevent OpenTelemetryDataSource constructor issues during config refresh by adding proxy #14006

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rajeswari2904
Copy link

Fixes #13512:

  • Addresses issue where Spring Boot configuration refresh (e.g., via Nacos) fails due to constructor/type errors with instrumented DataSource beans.
  • Wraps the instrumented DataSource with a JDK dynamic proxy implementing only the DataSource interface.
  • Proxy ensures Spring interacts only with the DataSource interface, avoiding exposure of implementation details (like OpenTelemetryDataSource).
  • Prevents errors such as "ExistingValue must be an instance of com.zaxxer.hikari.HikariDataSource" during bean rebinding.
  • Maintains compatibility with Spring’s configuration properties rebinding and refresh mechanisms.
  • The proxy delegates all method calls to the underlying instrumented DataSource, preserving all functionality and telemetry.
  • Adds in-code comments explaining the rationale for proxying the DataSource.
  • Adds a test case to verify the DataSource proxying and configuration rebinding fix, ensuring that the solution is validated and regressions are prevented.

@rajeswari2904 rajeswari2904 requested a review from a team as a code owner June 9, 2025 16:52
Copy link

linux-foundation-easycla bot commented Jun 9, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Jun 9, 2025
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test native This label can be applied to PRs to trigger them to run native tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenTelemetryDataSource error when refresh configuration
1 participant