除了 flower 之外,还有哪些工具最适合监控 celery 任务?

What tools are best for monitoring celery tasks besides flower?

我们想监控 celery 任务,但不仅仅是 flower。我们希望能够在任务失败时发送邮件并记录平均任务运行时间,可视化成功率、失败率等

Prometheus 会是一个很好的工具吗?如果是这样,使用使用多个 celery 任务的 django 应用程序进行设置有多简单?

Prometheus 是一个很好的选择。您需要使用 celery-prometheus-exporter to export metrics on celery tasks. You would then need to scrape the data by adding a scrape config 到 prometheus。

一旦这些步骤开始工作,您就可以设置 alerts in Prometheus. When these are triggered they send alerts to the alert manager,它可以将它们转发到您想要的任何渠道 - slack、pagerduty、电子邮件等

设置所有这些非常复杂。