Cloud Logging 高级日志过滤器:查找 HTTP 请求 >= 持续时间

Cloud Logging Advanced Log Filters: Find HTTP Requests >= Duration

Google 的 Advanced Cloud Logging Filters 似乎非常强大,但使用起来同样复杂。如何设计一个日志查询来查找所有持续时间超过 3 秒的 HTTP 请求,其中还包含文本 foo bar?

我已经通读了 documentation, but it leaves a bit to be desired (it seems directed towards language authors, not users of the system). I know there is a field for Duration,但是有人有关于如何使用它的示例吗?

更新 4/2022:自从写这篇文章以来,文档变得更好了,take a look

你是说延迟?这样的事情应该有效

protoPayload.latency > 3s

要按默认 App Engine 实例的持续时间和文本 ("foo bar") 过滤日志,您可以 运行 在高级过滤器下执行以下操作:

metadata.serviceName="appengine.googleapis.com"
metadata.labels."appengine.googleapis.com/module_id"="default"
log="appengine.googleapis.com/request_log"
protoPayload.latency > 3s
"foo bar"