Celery queue depth metrics and alerts

Open
#142 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
22/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

The payload names no files. Start with the existing Celery setup, looking for the four queues (default, ratings, email, webhooks) and the Sentry cron monitor settings from #65, which this depends on. Add a read-only periodic task on the default queue that reports each queue length from Valkey. Done means all four lengths reach the chosen tool from staging and a held backlog on a stopped worker triggers the alert. Maintainers have not chosen Sentry or Grafana, and the issue says to leave it in the backlog, so confirm that first.

Written by the indexing model from the issue text.

Description

area:infra priority:p2 size:S type:feature

Problem: Queue depth and worker load show when Celery is falling behind before ratings, email, or webhooks become late. Nothing reports it yet. Sentry cron monitors (#65) catch jobs that stop or run long, and the Rating updates check (#140) catches late ratings, so this may never be needed.

When to do this: Only when one of these happens: a backlog was found late in an incident, the email or webhooks queues go unwatched by any other check, or the mobile apps launch and traffic grows. Until then, leave it in the backlog.

Scope:

  • A periodic task on the default queue that reads the length of each Celery queue (default, ratings, email, webhooks) from Valkey
  • Report the lengths as metrics: to Sentry, or to a free hosted Grafana if maintainers want charts. Opt-in from settings, like #65
  • An alert when a queue stays above a threshold for a set time
  • Safe to run twice; reads only, never changes the queues
  • Document it in the runbook from #66

Acceptance criteria:

  • Queue lengths for all four queues appear in the chosen tool from staging
  • Holding tasks on a stopped worker raises the alert
  • Metrics hold queue names and counts only: no task arguments

Out of scope:

  • Flower. If someone needs it later, it must sit behind auth on a private route, since it shows task arguments

Depends on: #65

Size: S

Dominant language
Python
Stars
0
Forks
1
Avg merge
1h 7m
Merged PRs (30d)
206

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openpickleball/backend

All issues in openpickleball/backend

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.