| name | apollo-incident-runbook |
| description | Apollo.io incident response procedures.
Use when handling Apollo outages, debugging production issues,
or responding to integration failures.
Trigger with phrases like "apollo incident", "apollo outage",
"apollo down", "apollo production issue", "apollo emergency".
|
| allowed-tools | Read, Write, Edit, Bash(kubectl:*), Bash(curl:*) |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
Apollo Incident Runbook
Overview
Structured incident response procedures for Apollo.io integration issues with diagnosis steps, mitigation actions, and recovery procedures.
Incident Classification
| Severity | Impact | Response Time | Examples |
|---|
| P1 - Critical | Complete outage | 15 min | API down, auth failed |
| P2 - Major | Degraded service | 1 hour | High error rate, slow responses |
| P3 - Minor | Limited impact | 4 hours | Cache issues, minor errors |
| P4 - Low | No user impact | Next day | Log warnings, cosmetic issues |
Quick Diagnosis Commands
curl -s https://status.apollo.io/api/v2/status.json | jq '.status'
curl -s "https://api.apollo.io/v1/auth/health?api_key=$APOLLO_API_KEY" | jq
curl -I "https://api.apollo.io/v1/people/search" \
-H "Content-Type: application/json" \
-d '{"api_key": "'$APOLLO_API_KEY'", "per_page": 1}' 2>/dev/null \
| grep -i "ratelimit"
curl -s http://localhost:3000/health/apollo | jq
kubectl logs -l app=apollo-service --tail=100 | grep -i error
curl -s http://localhost:3000/metrics | grep apollo_
Incident Response Procedures
P1: Complete API Failure
Symptoms:
- All Apollo requests returning 5xx errors
- Health check endpoint failing
- Alerts firing on error rate
Immediate Actions (0-15 min):
curl -s https://status.apollo.io/api/v2/status.json | jq
kubectl set env deployment/apollo-service APOLLO_FALLBACK_MODE=true
curl -s "https://api.apollo.io/v1/auth/health?api_key=$APOLLO_API_KEY"
Fallback Mode Implementation:
class CircuitBreaker {
private failures = 0;
private lastFailure: Date | null = null;
private isOpen = false;
async execute<T>(fn: () => Promise<T>, fallback: () => T): Promise<T> {
if (this.isOpen) {
if (this.shouldAttemptReset()) {
this.isOpen = false;
} else {
console.warn('Circuit breaker open, using fallback');
return fallback();
}
}
try {
const result = await fn();
this.failures = 0;
return result;
} catch (error) {
this.failures++;
this.lastFailure = new Date();
if (. >= ) {
. = ;
.();
}
();
}
}
(): {
(!.) ;
elapsed = .() - ..();
elapsed > ;
}
}
() {
cached = apolloCache.(criteria);
(cached. > ) cached;
.();
[];
}
Recovery Steps:
watch -n 30 'curl -s https://status.apollo.io/api/v2/status.json | jq'
kubectl set env deployment/apollo-service APOLLO_FALLBACK_MODE=false
curl -s "https://api.apollo.io/v1/auth/health?api_key=$APOLLO_API_KEY"
kubectl logs -l app=apollo-service | grep -c "queued"
kubectl scale deployment/apollo-service --replicas=1
kubectl scale deployment/apollo-service --replicas=3
P1: API Key Compromised
Symptoms:
- Unexpected 401 errors
- Unusual usage patterns
- Alert from Apollo about suspicious activity
Immediate Actions:
kubectl create secret generic apollo-secrets \
--from-literal=api-key=NEW_KEY \
--dry-run=client -o yaml | kubectl apply -f -
kubectl rollout restart deployment/apollo-service
kubectl logs -l app=apollo-service --since=24h | grep "apollo_request"
Post-Incident:
- Review access controls
- Enable IP allowlisting if available
- Implement key rotation schedule
P2: High Error Rate
Symptoms:
- Error rate > 5%
- Mix of successful and failed requests
- Alerts on
apollo_errors_total
Diagnosis:
curl -s http://localhost:3000/metrics | grep apollo_errors_total
kubectl logs -l app=apollo-service --tail=500 | grep -A2 "apollo_error"
curl -s http://localhost:3000/metrics | grep apollo_requests_total | sort
Common Causes & Fixes:
| Error Type | Likely Cause | Fix |
|---|
| validation_error | Bad request format | Check request payload |
| rate_limit | Too many requests | Enable backoff, reduce concurrency |
| auth_error | Key issue | Verify API key |
| timeout | Network/Apollo slow | Increase timeout, add retry |
Mitigation:
kubectl set env deployment/apollo-service APOLLO_RATE_LIMIT=50
kubectl set env deployment/apollo-service APOLLO_CACHE_TTL=3600
kubectl scale deployment/apollo-service --replicas=1
P2: Rate Limit Exceeded
Symptoms:
- 429 responses
apollo_rate_limit_hits_total increasing
- Requests queuing
Immediate Actions:
curl -I "https://api.apollo.io/v1/auth/health?api_key=$APOLLO_API_KEY" \
| grep -i ratelimit
kubectl set env deployment/apollo-service \
APOLLO_PAUSE_BACKGROUND_JOBS=true
kubectl set env deployment/apollo-service \
APOLLO_MAX_CONCURRENT=2
sleep 60
kubectl set env deployment/apollo-service \
APOLLO_MAX_CONCURRENT=5 \
APOLLO_PAUSE_BACKGROUND_JOBS=false
Prevention:
class RequestBudget {
private used = 0;
private resetTime: Date;
constructor(private limit: number = 90) {
this.resetTime = this.getNextMinute();
}
async acquire(): Promise<boolean> {
if (new Date() > this.resetTime) {
this.used = 0;
this.resetTime = this.getNextMinute();
}
if (this.used >= this.limit) {
const waitMs = this.resetTime.getTime() - Date.now();
console.warn(`Budget exhausted, waiting ${waitMs}ms`);
await new Promise( (r, waitMs));
.();
}
.++;
;
}
(): {
next = ();
next.(, );
next.(next.() + );
next;
}
}
P3: Slow Responses
Symptoms:
- P95 latency > 5 seconds
- Timeouts occurring
- User complaints about slow search
Diagnosis:
curl -s http://localhost:3000/metrics \
| grep apollo_request_duration
time curl -s "https://api.apollo.io/v1/auth/health?api_key=$APOLLO_API_KEY"
kubectl top pods -l app=apollo-service
Mitigation:
kubectl set env deployment/apollo-service APOLLO_TIMEOUT=60000
kubectl set env deployment/apollo-service APOLLO_HEDGE_REQUESTS=true
kubectl set env deployment/apollo-service APOLLO_DEFAULT_PER_PAGE=25
Post-Incident Template
## Incident Report: [Title]
**Date:** [Date]
**Duration:** [Start] - [End] ([X] minutes)
**Severity:** P[1-4]
**Affected Systems:** Apollo integration
### Summary
[1-2 sentence description]
### Timeline
- HH:MM - Issue detected
- HH:MM - Investigation started
- HH:MM - Root cause identified
- HH:MM - Mitigation applied
- HH:MM - Service restored
### Root Cause
[Description of what caused the incident]
### Impact
- [Number] of failed requests
- [Number] of affected users
- [Duration] of degraded service
### Resolution
[What was done to fix the issue]
### Action Items
- [ ] [Preventive measure 1]
- [ ] [Preventive measure 2]
- [ ] [Monitoring improvement]
### Lessons Learned
[What we learned from this incident]
Output
- Incident classification matrix
- Quick diagnosis commands
- Response procedures by severity
- Circuit breaker implementation
- Post-incident template
Error Handling
| Issue | Escalation |
|---|
| P1 > 30 min | Page on-call lead |
| P2 > 2 hours | Notify management |
| Recurring P3 | Create P2 tracking |
| Apollo outage | Open support ticket |
Resources
Next Steps
Proceed to apollo-data-handling for data management.