Best way to integrate into an ancient app?

Hi, i’ve been put in charge of an ancient app built in turbogears2, the app has MANY problems that i’m trying to slowly work through, one of which is its becoming increasingly slow, we suspect because of database queries. I was wondering what the best way to integrate sentry into it is, so it’s easier to see patterns of problems and issues we can perhaps correct.

My only thoughts were to integrate with sqlalchemy and maybe use the WSGI general intergration too? Is there something better than that?
thank you for any thougts.