How to Monitor Your AWS API Gateway with Vigilmon (External Uptime Checks)
AWS API Gateway is the front door for millions of production APIs. Even though AWS manages the infrastructure, your API Gateway can fail due to Lambda integration errors, throttling configuration, broken deployment stages, or resource policy issues. This guide shows how to add external monitoring to AWS API Gateway with Vigilmon.
What Can Go Wrong with API Gateway
- Lambda function behind the gateway starts returning 5xx errors
- IAM permissions revoked, breaking Lambda invocation
- A deployment pushed a broken stage configuration
- API Gateway throttling incorrectly configured
- Resource policy blocking legitimate traffic
- Regional endpoint unavailable during an AWS incident
AWS CloudWatch catches some of these, but it's internal — you need external monitoring from outside AWS.
Strategy 1: Monitor Your API Health Endpoint Directly
The simplest approach: add a health check route to your API Gateway.
REST API (API Gateway v1):
In your OpenAPI spec or through the console, add:
- Method: GET
- Path:
/health - Integration: MOCK or Lambda proxy
Mock integration (no Lambda needed):
{
"integrationResponses": {
"200": {
"responseTemplates": {
"application/json": "{\"status\": \"ok\"}"
}
}
},
"type": "MOCK",
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
}
}
This returns {"status": "ok"} without invoking a Lambda. It verifies the API Gateway stage is reachable and correctly deployed.
HTTP API (API Gateway v2) with Lambda:
// Lambda handler for health check
export const handler = async (event) => {
return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ status: 'ok' }),
};
};
Step 2: Test Your API Gateway Endpoint
# REST API
curl https://abc123.execute-api.us-east-1.amazonaws.com/prod/health
# {"status":"ok"}
# HTTP API
curl https://abc123.execute-api.us-east-1.amazonaws.com/health
# {"status":"ok"}
Step 3: Use a Custom Domain (Recommended)
Monitor your custom domain rather than the AWS-assigned URL:
curl https://api.example.com/health
# {"status":"ok"}
This monitors the full path: DNS → Custom Domain → API Gateway → Lambda. If any layer breaks, Vigilmon catches it.
Step 4: Connect to Vigilmon
- Sign up at vigilmon.online
- Add Monitor → HTTP Monitor
- URL:
https://api.example.com/health - Expected status: 200
- Optional content check:
"status":"ok" - Check interval: 60 seconds
- Regions: pick US East + EU West (minimize false positives)
- Alert: email or Slack webhook
API Key Protected Endpoints
If your API requires an API key, use Vigilmon's custom header support:
- Add header:
x-api-key: your-api-gateway-key - Create a dedicated monitoring API key in API Gateway with minimal permissions
- Restrict it to the health endpoint only
Multi-Region API Gateway
For APIs deployed across multiple regions:
https://api.example.com/health (primary, us-east-1)
https://api-eu.example.com/health (secondary, eu-west-1)
https://api-ap.example.com/health (tertiary, ap-southeast-1)
Monitor each independently in Vigilmon.
What Vigilmon Checks vs. What CloudWatch Checks
| Failure | CloudWatch | Vigilmon |
|---|---|---|
| Lambda errors (5xx) | ✅ | ✅ (if your health Lambda errors) |
| API Gateway deployment broken | ✅ (4xx/5xx counts) | ✅ |
| Custom domain misconfigured | ❌ | ✅ |
| SSL certificate expiry | ❌ | ✅ |
| Regional DNS failure | ❌ | ✅ |
| Response time degradation | ✅ | ✅ |
Summary
- Add a
GET /healthroute to your API Gateway (mock integration or real Lambda) - Use your custom domain URL, not the raw execute-api URL
- Connect to Vigilmon for external, multi-region monitoring
- For API key-protected APIs, use Vigilmon's custom header feature
AWS manages the infrastructure, but you're responsible for knowing when your API stops working.
Top comments (0)