How can I log all requests between the backend and the SuperTokens core?
j
How can I log all requests between the backend and the SuperTokens core?
r
hey @jam_nside the core already does this logging.
j
Ah, I guess the logs are on the saas dashboard.
r
ah you use SaaS.
the logs aren't exposed then
uhmm. Im not sure if there is an easy way to get them
You could open an feature request for this. Essentially we could add hooks to the place where we query the core from the SDK, and in that hook, you could add logging, thereby achieveing what you want.
j
The goal is to comply with the future rate limits, and to not flood you with traffic that can be avoided 🙂
r
ah right. Fair enough. We will add this hook soon to our SDKs (in a few weeks). Could you please open an issue about this? It will help keep track of things
j
r
thanks!
Maybe a better way would be for us to just show the rpm on our saas dashboard? That way you don't really have to manually log and keep track of the frequency
j
One global rpm? While that is fine if we made no mistake and the rpm rate makes sense from a user number perspective, it's not enough to debug and find the cause of a weird high frequency. IMO you need to know per when you ping ST and which endpoint. In my case my auth.guard was not properly looking at the cached identity in the session token, and calling ST for every request to get the identity. I think I fixed the logic but I fear that it still checks the verify email ST endpoint. No way to know for sure though, that's something we users don't call explicitly and works behind the scenes of recipes.
r
I see. Makes sense.
We shall add this to our impl roadmap. Hopefully shouldn't take time
> One global rpm? I mean per dev / prod env
m
Hey @jam_nside This feature has now been added!
j
Woohoo! Thanks! Any doc/changelog?
r
if you are using out node SDK, the code snippet is shown here; https://github.com/supertokens/supertokens-core/issues/865#issuecomment-1808059149 Docs for other SDKs will be coming soon
j
Thank you 🙂 !