Skip to content

feat: periodic health checks — gateway heartbeat and system checks #14

@maxdraki

Description

@maxdraki

Problem

The Health tab currently only shows a single gateway entry, timestamped at the last gateway restart. The hook only calls sendHealth() on gateway:startup — there are no periodic checks, so the tab goes stale immediately.

Goal

Health tab should reflect live system status, updated every few minutes, with meaningful checks beyond just "did the gateway start".

Proposed checks

Check Source Frequency Healthy =
gateway hook periodic ping every 5 min gateway is running
whatsapp hook — last message:received age every 5 min received event in last 30 min
cron-sync sync script every 15 min last sync succeeded
disk sync script or hook every 15 min <90% used

Implementation options

A — Hook periodic heartbeat (preferred)

Add a setInterval in handler.ts that calls sendHealth("gateway", "ok", "Heartbeat") every 5 minutes. Also track last message:received timestamp and send a warning if >30 min silent.

B — Sync script health ping (quick win)

Add a POST /api/v1/ingest/health call at the end of sync.py after each successful sync run. Already runs every 15 min.

Related

  • examples/openclaw-hook/handler.ts — needs setInterval heartbeat
  • examples/openclaw-cron-sync/sync.py — can add health ping as quick win

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions