Custom API Health Checks
Powered by Serverless Python
Generic uptime pingers only check if port 80 responds. With LiteLambda, write real Python checks: authenticate, submit transactions, validate JSON responses, and alert before your users notice.
import time
import requests
def handler(event, context):
target_endpoint = "https://api.yourdomain.com/v1/health"
start_time = time.time()
try:
response = requests.get(target_endpoint, timeout=5)
duration_ms = round((time.time() - start_time) * 1000)
# 1. Assert status code
if response.status_code != 200:
raise Exception(f"Unexpected HTTP {response.status_code}: {response.text[:200]}")
# 2. Assert payload contents
data = response.json()
if data.get("database") != "connected":
raise Exception(f"Database degraded: {data}")
print(f"✅ Healthcheck Passed: {duration_ms}ms latency.")
return {"status": "healthy", "duration_ms": duration_ms}
except Exception as e:
# LiteLambda captures uncaught exceptions and dispatches failure alerts!
print(f"🚨 Outage Detected: {str(e)}")
raise e
Beyond Simple HTTP 200 Pings
Deep Synthetic Tests
Log in as a test user, generate a JWT token, fetch sensitive records, and verify cryptographic signatures. Test what really matters.
Instant Failure Escalation
LiteLambda's built-in alert engine immediately forwards failure traces to Discord, Slack, Telegram, and Email without third-party integrations.
Fraction of the Cost
Dedicated synthetic monitoring platforms cost $50–$100/mo. LiteLambda gives you unlimited flexibility starting at $4.99/mo (₹99/mo in India).
Start Monitoring Your APIs in Under 2 Minutes
Create an account, paste your Python script, and set your schedule. 15-day free trial, no credit card required.
Create Free Account →