根据https://github.com/mperham/sidekiq/wiki/Monitoring上的 sidekiq 监控文档,如果我们需要监控队列积压,我们将以下内容添加到config/routes.rb
require 'sidekiq/api'
match "queue-status" => proc { [200, {"Content-Type" => "text/plain"}, [Sidekiq::Queue.new.size < 100 ? "OK" : "UHOH" ]] }, via: :get
监控延迟
match "queue-latency" => proc { [200, {"Content-Type" => "text/plain"}, [Sidekiq::Queue.new.latency < 30 ? "OK" : "UHOH" ]] }, via: :get
Q1。我的应用程序中有多个队列,称为 order_submission、mailers、critical 和 default。如果我想监控特定队列的积压或延迟,请说“order_submission”,我该怎么做?
Q2。该文件还说,We have a Pingdom check every minute which fires off an email if the response == 'UHOH'
对于以下
match "queue-status" => proc { [200, {"Content-Type" => "text/plain"}, [Sidekiq::Queue.new.size < 100 ? "OK" : "UHOH" ]] }, via: :get
我知道 Pingdom 服务用于点击 url 以测试性能和可用性,但我不清楚这意味着什么意味着已经存在每分钟运行并发送电子邮件的 pingdom 检查。想对此进行澄清。
谢谢