I am using DataDog with a Django site running on gunicorn with a Postgresql database. We have atomic DB transactions enabled by default. Postgres and Python traces are both configured per the DataDog documentation. In DataDog we can see the Postgres spans for the transaction COMMIT queries, but the transaction BEGIN queries are missing. I am trying to debug some performance issues with our site and would like to see if the BEGIN queries are somehow at fault, but it’s nearly impossible to confirm this when they aren’t showing up in DataDog.
How do I get the transaction BEGIN queries to show in DataDog?
This is a screenshot of a trace from the /health endpoint, which executes zero SQL queries but is still wrapped in a DB transaction. You can see that most of the response time is a black hole where I cannot see what is happening. This trace was only 9ms, but sometimes this delay can take up to 10 seconds which is totally baffling.