Skip to content

LO-062 [Intermediate]: Celery Beat Monitoring Health Check Endpoint #399

Description

@Kuldeeep18

Description

Our platform relies on Celery Beat to trigger lead processing every minute. If Celery Beat hangs or crashes, outreach sequences stop running silently. We need a health-check endpoint that verifies if the cron runner is alive.

User & Contributor Value

  • Contributors: Caching state checks, background heartbeat updates, and creating systems monitoring APIs.
  • Users: Enables devops teams to monitor schedule health and auto-restart stuck worker containers.

Code Locations

  • backend/backend/urls.py
  • backend/campaigns/tasks.py

Implementation Guide

  1. Heartbeat Task: Write a simple periodic task celery_heartbeat() that runs every minute, updating a Redis/Cache key celery_beat_heartbeat with the current timestamp.
  2. API View: Add a route /api/v1/health/celery-beat/. It should check if the cache key exists and is less than 3 minutes old, returning HTTP 200 (healthy) or HTTP 503 (stuck).

Metadata

Metadata

Assignees

No one assigned

    Labels

    gssoc:approvedGSSoC 2026 approved base points (+50 pts)level:intermediateDifficulty: Intermediate (+35 pts)type:devopsType: DevOps (+15 pts)type:performanceType: Performance (+15 pts)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions