Verify spans are available for SQL transactions (converted to project)
This issue has been converted to a project Verify spans are available for SQL transactions
In HTTP Requests within SQL Transactions we would like to detect when HTTP client requests are being made during a SQL transaction however to do this correctly, we need to verify that we have spans available from each backend SDK for database transactions. Some SDKs are known to not send this information (ex: Django) so we'd like to audit where it is/isn't available and get it added where it's not available.
These are generally BEGIN, COMMIT, and ROLLBACK however if we are doing any special casing in SDKs there are nuances depending on the SQL dialect (ex: MySQL supports START TRANSACTION in addition to BEGIN). The linked milestone above has more details in the FAQ section.
Creating these tickets as duplicates for each backend SDK team, original Slack thread in #discuss-sdks: https://sentry.slack.com/archives/CA2V2LBDL/p1745252678799129
We could probably simply extend SentryJdbcEventListener, implementing the following methods:
-
onBeforeCommit(ConnectionInformation connectionInformation) -
onAfterCommit(ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e) -
onBeforeRollback(ConnectionInformation connectionInformation) -
onAfterRollback(ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e)