Capturing transactions requires that you first set up performance monitoring if you haven't already.
Sentry JDBC integration provides the
SentryJdbcEventListener for P6Spy database activity interceptor, which creates a span for each JDBC statement executed over a proxied instance of
<dependency> <groupId>io.sentry</groupId> <artifactId>sentry-jdbc</artifactId> <version>7.0.0</version> </dependency>
For other dependency managers, check out the central Maven repository.
DataSource to use
com.p6spy.engine.spy.P6SpyDriver as a JDBC driver. For Spring Boot applications:
p6spy prefix to the database connection URL. For Spring Boot applications:
In addition to spans, P6Spy logs JDBC statements to a log file by default. Because this file can grow rapidly, we recommend disabling creating a log file by setting a system property
com.p6spy.engine.spy.P6SpyFactory or creating a
spy.properties file in
src/main/resources with the content: