]> git.openstreetmap.org Git - chef.git/blob - cookbooks/db/templates/default/sql_rails.yml.erb
palulukon: Allow access to AWS IP metadata NTP service
[chef.git] / cookbooks / db / templates / default / sql_rails.yml.erb
1 collector_name: sql_rails
2
3 metrics:
4   - metric_name: rails_queue_length
5     type: gauge
6     help: Rails job queue length
7     key_labels:
8       - queue
9       - status
10     values: [length]
11     query: |
12       SELECT
13         queue,
14         CASE
15         WHEN failed_at IS NOT NULL THEN 'failed'
16         WHEN locked_at IS NOT NULL THEN 'running'
17         WHEN attempts > 0 THEN 'retry'
18         ELSE 'pending'
19         END AS status,
20         COUNT(*) AS length
21       FROM
22         delayed_jobs
23       GROUP BY
24         queue,
25         status