// Autonomous setup and management of external service monitoring using UptimeRobot (HTTP endpoint monitoring) and Healthchecks.io (heartbeat/Dead Man's Switch monitoring). Use when setting up monitoring for Cloud Run Jobs, VM services, or investigating monitoring configuration issues. Includes Pushover integration, validated API patterns, and dual-service architecture.
| name | service-monitoring-setup |
| description | Autonomous setup and management of external service monitoring using UptimeRobot (HTTP endpoint monitoring) and Healthchecks.io (heartbeat/Dead Man's Switch monitoring). Use when setting up monitoring for Cloud Run Jobs, VM services, or investigating monitoring configuration issues. Includes Pushover integration, validated API patterns, and dual-service architecture. |
This skill provides validated patterns for setting up external service monitoring using two complementary services:
Key Principle: Never monitor from the same infrastructure being monitored. Both services run externally on separate infrastructure to avoid single points of failure.
Cost: $0/month using free tiers of both services for complete monitoring coverage.
Use this skill when:
Is the workload ephemeral (runs and exits)?
├─ YES → Use Healthchecks.io (Dead Man's Switch)
│ ├─ Job pings on success
│ ├─ No ping within timeout → Alert
│ └─ Free tier: 20 checks, user-defined timeouts
│
└─ NO → Is it a persistent HTTP endpoint?
└─ YES → Use UptimeRobot (HTTP polling)
├─ Service pings endpoint every N minutes
├─ No response → Alert
└─ Free tier: 50 monitors, 5-minute intervals
Recommended Architecture: Use BOTH services for dual-pipeline monitoring
# /// script
# dependencies = ["requests"]
# ///
import os
from scripts.healthchecks_client import HealthchecksClient
# Get API key from Doppler
api_key = os.popen(
"doppler secrets get HEALTHCHECKS_API_KEY --project claude-config --config dev --plain"
).read().strip()
client = HealthchecksClient(api_key)
# Create check for Cloud Run Job
result = client.create_check(
name="Ethereum Collector Job",
timeout=7200, # 2 hours
grace=600, # 10 minutes grace period
tags="production ethereum",
channels="*" # All notification channels
)
ping_url = result["ping_url"]
print(f"Add to Cloud Run Job environment: HEALTHCHECK_PING_URL={ping_url}")
# In your Cloud Run Job script:
# import requests
# requests.get(os.getenv("HEALTHCHECK_PING_URL")) # On success
# requests.get(f"{os.getenv('HEALTHCHECK_PING_URL')}/fail") # On failure
# /// script
# dependencies = ["requests"]
# ///
import os
from scripts.uptimerobot_client import UptimeRobotClient
# Get API key from Doppler
api_key = os.popen(
"doppler secrets get UPTIMEROBOT_API_KEY --project claude-config --config dev --plain"
).read().strip()
client = UptimeRobotClient(api_key)
# Create HTTP monitor for VM service
result = client.create_monitor(
friendly_name="Production API Endpoint",
url="https://your-vm-ip:8000/health",
type=1, # HTTP(S)
interval=300, # 5 minutes (free tier)
alert_contacts=client.get_pushover_contact_id() # Type 9 Pushover contact
)
print(f"Monitor created: {result['monitor']['id']}")
UptimeRobot API v2 uses POST data authentication:
def _request(self, endpoint: str, data: Dict) -> Dict:
data["api_key"] = self.api_key
data["format"] = "json"
response = requests.post(f"{self.base_url}/{endpoint}", data=data)
response.raise_for_status()
result = response.json()
if result.get("stat") != "ok":
raise Exception(f"UptimeRobot API error: {result}")
return result
List Monitors:
monitors = client.get_monitors()
for monitor in monitors:
print(f"{monitor['friendly_name']}: {monitor['url']} - {monitor['status']}")
Create Monitor:
result = client.create_monitor(
friendly_name="API Health Check",
url="https://api.example.com/health",
type=1, # HTTP(S)
interval=300, # 5 minutes
alert_contacts=pushover_id
)
Delete Monitor:
client.delete_monitor(monitor_id="801762241")
Get Pushover Contact ID:
pushover_id = client.get_pushover_contact_id()
if not pushover_id:
print("⚠️ Pushover not configured - see Pushover Integration Setup")
1 = HTTP(S) - Checks endpoint response2 = Keyword - Checks for specific text in response3 = Ping - ICMP ping4 = Port - TCP port checkHealthchecks.io API v3 uses X-Api-Key header authentication:
headers = {
"X-Api-Key": api_key,
"Content-Type": "application/json"
}
response = requests.get(f"{base_url}/checks/", headers=headers)
List Checks:
checks = client.get_checks()
for check in checks:
print(f"{check['name']}: {check['status']} - {check['ping_url']}")
Create Check:
result = client.create_check(
name="Daily Backup Job",
timeout=86400, # 24 hours
grace=3600, # 1 hour grace
tags="backup production",
channels=pushover_id # Or "*" for all channels
)
ping_url = result["ping_url"]
Ping Check (Success):
# From your job/script
import requests
requests.get(ping_url)
Ping Check (Failure):
requests.get(f"{ping_url}/fail")
Delete Check:
client.delete_check(check_uuid="6a991157-552d-4c2c-b972-d43de0a96bff")
Perfect for ephemeral workloads (Cloud Run Jobs, cron jobs):
Job Lifecycle:
1. Job starts
2. Job executes work
3. Job pings Healthchecks.io on success
4. If no ping within timeout → Alert
Advantages:
- No always-on endpoint needed
- Works with ephemeral infrastructure
- Simple integration (one HTTP GET)
- Catches job crashes, hangs, or scheduling failures
Important: Pushover integration must be configured via web UI first. API can only list and assign existing integrations, not create them.
client.get_pushover_contact_id() (should return numeric ID)API Note: Pushover contacts appear as type=9 in UptimeRobot API responses.
client.get_pushover_channel_id() (should return UUID)API Note: Pushover channels use kind code "po" (abbreviated), not "pushover".
Common Issue: If get_pushover_contact_id() or get_pushover_channel_id() returns None, Pushover is not configured. Complete setup steps above via web UI.
429 Too Many Requests:
Retry-After header (observed: 47 seconds)X-RateLimit-Remaining header (counts down from 9 to 0)Rate Limit Example:
import time
from requests.exceptions import HTTPError
try:
result = client.get_monitors()
except HTTPError as e:
if e.response.status_code == 429:
retry_after = int(e.response.headers.get('Retry-After', 60))
print(f"Rate limited. Waiting {retry_after} seconds...")
time.sleep(retry_after)
result = client.get_monitors() # Retry
Heartbeat Monitoring Not Available:
Pushover Alerts Not Working:
client.get_pushover_contact_id() returns a valueNone, complete Pushover setup steps via web UI400 Bad Request on Check Creation:
name, timeout, and grace:result = client.create_check(
name="My Check",
timeout=3600, # seconds (required)
grace=600 # seconds (recommended)
)
# All other fields are optional
Ping Not Recording:
create_check response)API Field Mismatches:
ping_url, uuid, update_url# /// script
# dependencies = ["requests"]
# ///
import os
import requests
from scripts.healthchecks_client import HealthchecksClient
from scripts.uptimerobot_client import UptimeRobotClient
# Get API keys from Doppler
healthchecks_key = os.popen(
"doppler secrets get HEALTHCHECKS_API_KEY --project claude-config --config dev --plain"
).read().strip()
uptimerobot_key = os.popen(
"doppler secrets get UPTIMEROBOT_API_KEY --project claude-config --config dev --plain"
).read().strip()
# Initialize clients
hc_client = HealthchecksClient(healthchecks_key)
ur_client = UptimeRobotClient(uptimerobot_key)
# Get Pushover integration IDs
hc_pushover = hc_client.get_pushover_channel_id()
ur_pushover = ur_client.get_pushover_contact_id()
if not hc_pushover or not ur_pushover:
print("⚠️ WARNING: Pushover not configured for one or both services")
print("Alerts will only go to email until Pushover is set up via web UI")
# Setup Cloud Run Job monitoring (Dead Man's Switch)
job_check = hc_client.create_check(
name="Ethereum Data Collection Job",
timeout=7200, # 2 hours
grace=600, # 10 minutes
tags="production ethereum cloud-run",
channels=hc_pushover if hc_pushover else "*"
)
print(f"Cloud Run Job Ping URL: {job_check['ping_url']}")
print("Add to Cloud Run Job environment variables:")
print(f" HEALTHCHECK_PING_URL={job_check['ping_url']}")
# Setup VM HTTP endpoint monitoring
vm_monitor = ur_client.create_monitor(
friendly_name="VM API Endpoint",
url="https://your-vm-ip:8000/health",
type=1,
interval=300,
alert_contacts=ur_pushover if ur_pushover else None
)
print(f"VM Monitor ID: {vm_monitor['monitor']['id']}")
print("Monitoring active - will check every 5 minutes")
Both scripts include:
All patterns in this skill have been empirically validated:
/tmp/probe/uptimerobot/PROBE_REPORT.md - UptimeRobot API validation results/tmp/probe/healthchecks-io/PROBE_REPORT.md - Healthchecks.io API validation results| Feature | Healthchecks.io | UptimeRobot |
|---|---|---|
| Free tier checks | 20 | 50 HTTP monitors |
| Heartbeat monitoring | ✅ Free | ❌ Pro only ($7/mo) |
| HTTP monitoring | ❌ | ✅ Free |
| Pushover alerts | ✅ Free | ✅ Free |
| API | v3, modern | v2, established |
| Best for | Dead Man's Switch | HTTP endpoint polling |
Recommendation: Use BOTH for dual-pipeline architecture ($0/month total cost).