JulesJ
Convex Community6mo ago
2 replies
Jules

Adding logging middleware to `ctx.db` to monitor read/write sizes in transactions

Hi, we are running into the too many bytes read in a single function execution error for some of our functions.

We would like to better understand what is causing this. However, since some of our queries and mutations are a composition of several smaller queries and mutations it can be difficult to get more finegrained insights.

Ideally we would like to create some middleware for our DatabaseReader and DatabaseWriter that logs the (approximate) size of the documents that are queried/modified/inserted.
Is it supported to implement something like that?
Was this page helpful?