我创建了一个lambda函数,以跟踪PostgreSQL中的慢速查询到Slack Channel

发布于 2025-02-11 18:49:27 字数 572 浏览 1 评论 0原文

我创建了一个lambda函数,以跟踪PostgreSQL中的慢速查询到Slack Channel。我也显示了缓慢的查询日志。但是问题是我们有一些日志,只有持续时间,没有如下示例的查询细节。另外,我们也可以在PostgreSQL-RDS实例中找到相同的日志。

@timestamp - 2022-06-29 10:40:18.000
Query - 2022-06-29 10:40:18 UTC:10.102.22.204(55164):staging@staging:[25473]:LOG: duration: 20.212 ms
@duration - 20.212


@timestamp - 2022-06-29 10:23:24.000
Query - 2022-06-29 10:23:24 UTC:10.102.22.204(55162):staging@staging:[12442]:LOG: duration: 1224.268 ms
@duration - 122 

请提供一个解决方案以滤除日志的解决方案,而无需查询详细信息,或者如何使这些日志显示查询详细信息

I have created a lambda function to track slow queries in PostgreSQL to the slack channel. I have slow query logs displayed as well. But the problem is we have some logs with only duration and no query details like the example below. Also, we could find the same logs in the postgreSQL-RDS instance as well.

@timestamp - 2022-06-29 10:40:18.000
Query - 2022-06-29 10:40:18 UTC:10.102.22.204(55164):staging@staging:[25473]:LOG: duration: 20.212 ms
@duration - 20.212


@timestamp - 2022-06-29 10:23:24.000
Query - 2022-06-29 10:23:24 UTC:10.102.22.204(55162):staging@staging:[12442]:LOG: duration: 1224.268 ms
@duration - 122 

Please provide a solution either to filter out the logs without query details or how to make those logs to display the query details

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文