Watch the quota on third-party APIs
Stripe, GitHub, Twilio return X-RateLimit-Remaining in response headers. If the backend does not track the floor, you get a sudden 429 and billing stops.
Recipe
# Probe a cheap idempotent endpoint, alert when remaining quota < 10%.
import os, requests
API_URL = os.environ['API_URL'] # e.g. https://api.github.com/rate_limit
TOKEN = os.environ['API_TOKEN']
ALERT_PERCENT = int(os.environ.get('ALERT_PERCENT', 10))
r = requests.get(API_URL, headers={'Authorization': f'Bearer {TOKEN}'}, timeout=5)
limit = int(r.headers.get('X-RateLimit-Limit', 0))
remaining = int(r.headers.get('X-RateLimit-Remaining', 0))
if limit and remaining * 100 // limit < ALERT_PERCENT:
requests.post(os.environ['SLACK_WEBHOOK'], json={
'text': f'API quota at {remaining}/{limit} on {API_URL}'
}, timeout=5)
Same thing in Enterno.io
A Pioneer+ HTTP monitor can persist a header snapshot. Hit your /rate_limit endpoint every 5 minutes and Enterno raises the alert exactly when the value crosses the floor.
Related recipes
An attacker is hammering a `limit_req_zone` — legit traffic now eats 429s too. The access log shows it but nobody is watching.
API gateway deploys a new schema — the mobile team learns that a type was removed via the crash reporter. Want a snapshot every 5 min with a diff alert.
Ensure your site returns 2xx every minute, alert to Slack/Telegram on failure.