Keep tabs on long-running jobs and scheduled tasks. Get alerted when they stop sending heartbeats.
Heartbeat monitoring sends periodic "I'm alive" signals to SEER. If your job stops sending heartbeats, SEER detects the silence and alerts you that something went wrong.
Job is healthy and running normally. No alerts sent.
Job stopped unexpectedly. SEER sends alert via Slack/email.
Jobs that run for hours or days (data migrations, ML training, batch processing)
# Send heartbeat every 10 minutes
while processing:
process_batch()
seer.heartbeat("ml-training", {"epoch": i})Jobs that should run on a schedule (daily backups, hourly sync jobs)
# In your cron job (runs daily at 2am)
def daily_backup():
seer.heartbeat("daily-backup")
run_backup()💡 Set expected interval to 24 hours. Get alerted if backup doesn't run.
Background workers or daemons that should always be running
# Worker process sends heartbeat every 5 min
while True:
seer.heartbeat("queue-worker")
time.sleep(300)from seerpy import Seer
import time
seer = Seer(apiKey='YOUR_API_KEY')
def long_running_job():
for i in range(100):
# Do work
process_batch(i)
# Send heartbeat every 10 iterations
if i % 10 == 0:
seer.heartbeat(
job_name="batch-processor",
metadata={
"batch": i,
"progress": f"{i}%",
"status": "processing"
}
)
time.sleep(60) # Simulate work
long_running_job()Tip: Include progress information in metadata to track job state in the dashboard.
After your job starts sending heartbeats, configure when SEER should alert you:
Dashboard → Your Job → Settings Tab → Heartbeat Monitoring
Toggle "Enable Heartbeat Monitoring" to ON
How often should heartbeats arrive? (e.g., 5 minutes for continuous jobs, 24 hours for daily cron jobs)
Go to Notifications tab and connect Slack or email to receive alerts
Alert Timing: SEER sends an alert when no heartbeat is received for 2x the expected interval (e.g., if interval is 5 minutes, alert after 10 minutes of silence)
seer.monitor()Sending heartbeats too frequently wastes API calls and doesn't add value.
❌ Don't Do This
# Heartbeat every second
# = 3,600 API calls/hour!
while True:
seer.heartbeat("job")
time.sleep(1)✅ Do This Instead
# Heartbeat every 5 minutes
# = 12 API calls/hour
while True:
seer.heartbeat("job")
time.sleep(300)Add context to heartbeats so you can see job state in the dashboard:
seer.heartbeat("etl-job", metadata={
"stage": "transform",
"records_processed": 1500,
"progress": "75%",
"current_batch": 15
})