Other Checks
Besides uptime checks, StatusCake monitors how fast pages load, whether certificates are healthy, and whether your scheduled jobs are running.
Pagespeed checks
A statuscake_pagespeed_check loads a page and records how long it took, how big
it was and how many requests it made.
resource "statuscake_pagespeed_check" "landing_page" {
name = "Landing page"
check_interval = 3600
region = "UK"
alert_config {
alert_slower = 3000
alert_bigger = 2048
}
contact_groups = [statuscake_contact_group.operations_team.id]
monitored_resource {
address = "https://www.example.com"
}
}
regionis where the page is tested from:AU,CA,DE,FR,IN,JP,NL,SG,UK,USorUSW.alert_configis required. Each setting is a threshold:alert_sloweris a load time in milliseconds,alert_biggerandalert_smallerare page sizes in kilobytes. An emptyalert_config {}block turns all alerts off, which is useful when you only want the measurements.
SSL checks
A statuscake_ssl_check watches a certificate and alerts before it expires or
when something is wrong with it.
resource "statuscake_ssl_check" "example" {
check_interval = 86400
alert_config {
alert_at = [7, 14, 30]
on_broken = true
on_expiry = true
on_mixed = true
on_reminder = true
}
contact_groups = [statuscake_contact_group.operations_team.id]
monitored_resource {
address = "https://www.example.com"
}
}
alert_atis the number of days before expiry at which to alert. It takes exactly three values.on_expiry,on_broken,on_mixedandon_reminderchoose which events alert: the certificate expiring, being broken, a page loading insecure (mixed) content, and reminders as expiry approaches.monitored_resourcetakes anaddress, and optionally ahostnameto present during the TLS handshake.
Heartbeat checks
A statuscake_heartbeat_check works the other way round. Rather than StatusCake
testing your service, your job tells StatusCake that it ran. If a ping does not
arrive within period seconds, the check is down. It suits work that has no
address to test, such as a nightly backup or a queue consumer.
resource "statuscake_heartbeat_check" "backup" {
name = "Nightly backup"
period = 90000
contact_groups = [statuscake_contact_group.operations_team.id]
tags = ["production"]
}
output "backup_ping_url" {
value = statuscake_heartbeat_check.backup.check_url
}
The check's check_url is the address your job requests to report in. Give the
job a period a little longer than its schedule, so that one slow run does not
raise an alert.
Anyone with the ping URL can report your job as healthy. Treat check_url as a
secret, and mark any output that holds it sensitive = true.
Next Steps
Decide who hears about problems, and when to stay quiet. See Alerting.