Skip to content

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Jul 16, 2025

Hopefully resolves #13512
Supersedes #13950
Wrap instrumented data source with a custom wrapper that looks like an spring aop proxy. This lets aop proxy aware code unwrap the data source to the original data source. We are using a custom wrapper instead of jdk proxy support built into spring to get better interoperability with graalvm native. Since the custom wrapper does not use reflection extra configuration isn't needed for graalvm.

@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Jul 16, 2025
@laurit laurit marked this pull request as ready for review July 23, 2025 12:28
@laurit laurit requested a review from a team as a code owner July 23, 2025 12:28
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

class JdbcInstrumentationAutoConfigurationTest {
Copy link
Member

Choose a reason for hiding this comment

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

is this test failing without the fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

assertThat(AopUtils.isAopProxy(dataSource)).isTrue(); should fail

@trask trask merged commit b02219c into open-telemetry:main Aug 11, 2025
91 checks passed
@laurit laurit deleted the spring-jdbc-proxy branch August 27, 2025 15:34
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
4 participants