references/queries.md · 24000
ed_at
FROM system.task_runs AS r
JOIN system.tasks AS t ON r.task_id = t.id
WHERE t.origin_product NOT IN ('signals_scout', 'scout_suggestions')
AND t.deleted = 0
-- Failure clusters: keep both lines as written.
-- Backlog clusters (query 5b): swap the status list for
-- ('not_started', 'queued', 'in_progress') AND replace the recent-run bound with
-- r.created_at < now() - interval 1 day, then flip the ORDER BY to r.created_at ASC,
-- and add AND r.environment = 'cloud' to match 5b's scope.
-- Dropping the age predicate entirely would return the newest active runs, and dropping
-- the environment one would surface a local run 5b never counted — either lets the report
-- cite a run that was never part of the backlog it claims to evidence.
AND r.status = 'failed'
AND r.created_at > now() - interval 14 day
-- Narrow to the cluster you are filing, e.g.:
-- AND cityHash64(t.repository) = 0000000000000000000 -- repo_fingerprint from query 2
-- AND cityHash64(substring(r.error_message, 1, 60)) = 0000000000000000000 -- err_fingerprint from query 3
ORDER BY r.created_at DESC
LIMIT 5