Skip to main content

HTTP / HTTPS Checks

HTTP monitors are the most flexible monitor type. They support everything from a simple status code check to multi-header authenticated requests with response body assertions.

Basic configuration

FieldRequiredDefaultDescription
urlThe full URL to check
methodNoGETHTTP method: GET, POST, PUT, PATCH, DELETE, HEAD
intervalNo60Check frequency in seconds
regionsNoAutoProbe regions to use
timeoutNo10000Request timeout in milliseconds

Status code assertions

By default, any 2xx response is considered passing. You can customize this:

# Pass only on 200
assert_status: 200

# Pass on 200 OR 201
assert_status: [200, 201]

# Pass on any 2xx (default)
assert_status: "2xx"

# Useful for monitoring redirects
assert_status: 301

Response time thresholds

# Alert if response takes longer than 3 seconds
response_time_warning: 3000 # ms → triggers warning level alert
response_time_critical: 8000 # ms → triggers critical alert

Request headers

headers:
Authorization: "Bearer {{secrets.API_TOKEN}}"
X-Internal-Key: "{{secrets.INTERNAL_KEY}}"
Accept: "application/json"
User-Agent: "AlertifyPro/2.0"
Use Secrets

Never hardcode tokens in headers. Store them in Settings → Secrets and reference them as {{secrets.SECRET_NAME}}.

Request body (POST/PATCH/PUT)

method: POST
url: https://api.yourapp.com/health
headers:
Content-Type: "application/json"
body: |
{
"check": true,
"source": "alertifypro"
}

Response body assertions

# Body must contain this string
assert_body_contains: '"status":"ok"'

# Body must match a regex
assert_body_regex: '"uptime":\s*\d+'

# Body must NOT contain this string
assert_body_not_contains: "error"

# JSONPath assertion
assert_jsonpath:
- path: "$.status"
value: "ok"
- path: "$.version"
operator: "startsWith"
value: "2."

SSL certificate checks

SSL monitoring is built into every HTTPS check:

ssl:
verify: true # Verify certificate validity (default: true)
warn_days: 30 # Warn when cert expires in <30 days
critical_days: 7 # Critical alert when cert expires in <7 days

Follow redirects

follow_redirects: true   # Default: true
max_redirects: 10 # Maximum redirect hops

Basic authentication

auth:
type: basic
username: "{{secrets.BASIC_USER}}"
password: "{{secrets.BASIC_PASS}}"

Bearer token authentication

auth:
type: bearer
token: "{{secrets.API_TOKEN}}"

Full example

name: Production API Health Check
type: http
url: https://api.yourapp.com/v2/health
method: GET
interval: 60
regions:
- us-east-1
- eu-west-1
- ap-southeast-1
timeout: 10000
headers:
Authorization: "Bearer {{secrets.API_TOKEN}}"
Accept: "application/json"
assert_status: 200
assert_jsonpath:
- path: "$.status"
value: "ok"
response_time_warning: 2000
response_time_critical: 5000
ssl:
warn_days: 30
critical_days: 7
alerts:
consecutive_failures: 2
notify:
- email: [email protected]
- slack: "#alerts"

API equivalent

curl -X POST https://api.alertifypro.com/v1/monitors \
-H "Authorization: Bearer WK_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Health Check",
"type": "http",
"url": "https://api.yourapp.com/v2/health",
"interval": 60,
"regions": ["us-east-1", "eu-west-1"],
"assertions": [
{ "type": "status_code", "value": 200 },
{ "type": "response_time", "operator": "lt", "value": 5000 }
]
}'

Troubleshooting

SymptomLikely causeFix
TIMEOUTService too slow or port blockedIncrease timeout, check firewall rules
SSL_ERRORInvalid or self-signed certSet ssl.verify: false or fix the cert
CONNECTION_REFUSEDPort not openCheck service is running and port is accessible
DNS_FAILURECannot resolve hostnameCheck DNS configuration
Intermittent failuresRegional network issueIncrease consecutive_failures threshold to 2+