AWS日志见解将缺席值代替为0

发布于 2025-02-10 19:17:47 字数 612 浏览 2 评论 0原文

我想为我的无服务器应用程序跟踪 p99 p95

文档中存在的标准查询建议使用@billduration/@duration

因此,查询看起来像:

stats pct(@duration, 99)

这不符合我的情况,因为对于lambda功能,寒冷的开始时间也将与某些请求相关联。

我的查询应该看起来像:

stats pct(@duration + @initDuration, 99)

但是,在我理解的情况下,这仅考虑冷启动请求,而不是冷启动时间为0时的请求,因此@initduration five将不存在。因此,此查询给了我 p99 ,而不是整体系统。

有什么办法可以用0替换@initduration ,如果它是空白/不存在的?还是还有其他解决方法可以跟踪Lambdas的实际 p99 / p95

I want to track p99 and p95 for my serverless application.

Standard queries present in the documentation suggest the usage of @billedDuration/ @duration.

So the query would look like :

stats pct(@duration, 99)

This does not fit my scenario since for a lambda function, a cold start time would also be associated with some requests.

My query should look something like :

stats pct(@duration + @initDuration, 99)

However, in my understanding, this only considers the cold start requests and not the requests when cold start time was 0 and hence @initDuration field would be absent. So, this query is giving me p99 of just the cold start requests and not the overall system.

Is there a way I can replace @initDuration with 0 if it is blank/ not present? Or is there any other workaround to track actual p99/ p95 for lambdas ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贪了杯 2025-02-17 19:17:47

您可以将cocece函数用于默认@initduration至0,如果不存在。像这样:

stats pct(@duration + coalesce(@initDuration, 0), 99)

You can use the coalesce function to default @initDuration to 0 if not present. Like this:

stats pct(@duration + coalesce(@initDuration, 0), 99)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文