If a cloud function times out, I would like to have that as an error in the logs, so I can track the health of the functions, and if necessary take steps to improve speeds.
Is it possible to make that log to show as an error?
Also, is there a way to catch such timeout? I have a function that if an exception is thrown, saves something to the realtime-database. Is it possible to catch this error as well?
Firebase Response:
Thank you for reaching out, and for providing your feedback to us. I'm Kyle from Firebase Support and I'll be happy to handle this case regarding Cloud Functions with Firebase.
I understood that Cloud Function timeouts should be regarded as "errors" instead of "info" logs. I also agree that having another trigger that responds to timeout events like functions.onTimeout() would be very cool to be included in the future version of Cloud Functions.
For this, please note that I've cascaded your feedback (and use-case) about treating function timeouts as an error log, and not as an info log. I've also filed an internal feature request ticket for your suggestion of having functions.onTimeout() trigger. This will be processed to be discussed internally within the team, but I can't provide any ETAs or specific timeline as to when this requested feature will be implemented. In the meantime, you may keep an eye on our release notes and Firebase blog for upcoming features and bug fixes that Firebase offers to our valued developers.