Heartbeat Monitoring

Heartbeat monitoring lets you detect when a service goes silent. Send a heartbeat log on a schedule; if it stops arriving, Loguro flags the service as degraded or down — and can notify you and update an embedded status widget on your site.

How it works

Send a log with "level": "heartbeat" from your service at regular intervals (e.g. every 60 seconds):

curl -X POST https://ingest.logu.ro \
  -H "Authorization: Bearer $LOGURO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "level": "heartbeat",
    "message": "api-gateway alive",
    "context": { "service": "api-gateway", "region": "us-east-1" }
  }'

Loguro tracks the arrival time. If no heartbeat arrives within the configured timeout window, the service is considered unhealthy.

Status logic

The embed widget and alert system use this logic to compute status:

ConditionStatus
Heartbeat arrived within timeoutCheck error rate
No heartbeat within timeoutdegraded or down
Error rate ≥ 40% (last 30 min)incident
Error rate ≥ 10% and < 40%degraded
Error rate < 10%operational

If heartbeat monitoring is disabled for a widget, status is derived from error rate alone.

Setting the heartbeat interval

The heartbeat timeout is configured per embed widget (2–5 minutes). Set your service’s ping interval to less than the timeout — for a 2-minute timeout, send a heartbeat every 60–90 seconds.

Sending heartbeats from a cron job

# crontab — every minute
* * * * * curl -s -X POST https://ingest.logu.ro \
  -H "Authorization: Bearer $LOGURO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"level":"heartbeat","message":"worker alive"}'

Or from a health check endpoint in your app that pings Loguro after responding 200.

Alerts on heartbeat miss

Create an alert that fires when heartbeats stop arriving:

--alerts::create

In the alert form, set the severity watchlist to heartbeat and configure a cooldown. The alert fires when the signal is absent for longer than the timeout.

Embed widget

Combine heartbeat monitoring with an Embed Widget to show live status on your public status page or internal dashboard.

--embed::status:create:api-status

The widget polls for heartbeat and error rate, then displays operational, degraded, or incident.

Notes

  • The heartbeat level is available on all plans
  • Embed widget creation requires Solo plan or higher
  • Heartbeat logs are searchable like any other log: level:heartbeat --rate