gpt4 book ai didi

firebase - firebase 的云函数 - 完成状态 : 'timeout' - info not error

转载 作者:行者123 更新时间:2023-12-01 04:31:32 25 4
gpt4 key购买 nike

如果云功能超时,我希望将其作为日志中的错误,以便跟踪功能的运行状况,并在必要时采取措施提高速度。

是否可以将该日志显示为错误?

另外,有没有办法捕捉这种超时?我有一个函数,如果抛出异常,则将某些内容保存到实时数据库中。是否也可以捕获此错误?

Firebase 响应:

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.

最佳答案

我想出了一个解决方法来实现这一点。

我使用 Google Cloud Functions 工具来监控 Firebase Cloud Functions 的超时。

每当 "finished with status: 'timeout'" 时,我都会设置自定义警报由我的任何功能记录:

我去了https://console.cloud.google.com/logs/viewer并创建了自定义高级搜索:

resource.type="cloud_function"
"finished with status: 'timeout'"

然后,我使用“创建指标”功能来跟踪该日志的实例。

然后下 https://console.cloud.google.com/logs/metrics ,我找到了我的用户定义指标并为其创建了自定义警报。

关于firebase - firebase 的云函数 - 完成状态 : 'timeout' - info not error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53771666/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com