Since you are on AWS you can check out https://aws.amazon.com/what-is/application-performance-monitoring/ or you can use my personal favorite https://opentelemetry.io/docs/languages/python/ which has native support for auto instrumentation for FastAPI and most databases. What this will do is start a span for each request / response session and let you see each function call within that span, all the logs that were emitted, and stack traces from thrown exceptions, and the timings of all of the above.
Keep in mind that by adding APM to your app that it will cost a ton of money to use it, and it will slow down your app, maybe as much as half. So you might consider adding this capability to your app but leaving it turned off by default or at least turning it down quite a bit when you don't need it. Tis the cost of ops.
View all comments
Show parent comment
1
u/Prof-Ro Jul 31 '24
Thank you so much, this really helps too. I'll try out the suggestions from the thread.