Automations
Automate incident response with triggers and actions. Auto-remediate common issues and reduce alert fatigue.
How Automations Work
Automations in Unsparing follow a simple pattern:
When [trigger] → Do [action]
When a monitor fails, Unsparing can automatically take action — no manual intervention needed.
Triggers
| Trigger | Description |
|---|---|
| Monitor fails | Any monitor check fails |
| Monitor recovers | A previously failed monitor recovers |
| SSL expiring | Certificate within N days of expiry |
| DNS changed | DNS record value changes |
| Cron missed | Cron job doesn't fire on schedule |
| Response slow | Response time exceeds threshold |
| Severity changes | Alert severity escalates |
Actions
| Action | Description |
|---|---|
| Send notification | Email, Slack, or webhook |
| Pause monitor | Stop checking temporarily |
| Resume monitor | Resume a paused monitor |
| Call webhook | POST to an external URL |
| Create investigation | Open an investigation timeline |
| Run script | Execute a custom script via webhook |
Setting Up an Automation
- Go to Automations → Rules and click Create Rule
- Select a trigger
- Configure the trigger conditions
- Select one or more actions
- Save
Example: Auto-Pause During Maintenance
Trigger: SSL expiring in 30 days Action: Send Slack notification + Create investigation
When SSL certificate on *.example.com expires in < 30 days:
1. Send Slack message to #infra-alerts
2. Create investigation "SSL renewal needed for example.com"Example: Auto-Remediate Down Service
Trigger: Uptime monitor fails Action: Call webhook (trigger restart script)
When uptime monitor "Production API" goes down:
1. Call webhook https://api.example.com/restart/api
2. Wait 60 seconds
3. If still down, send Slack to #oncallAutomation Templates
Unsparing includes pre-built templates:
SSL Renewal Reminder
- Trigger: SSL certificate expiring in 14 days
- Action: Send email + Slack notification + create investigation
DNS Change Alert
- Trigger: Any DNS record changes
- Action: Send Slack to #security + create investigation
Cron Job Failure Escalation
- Trigger: Cron job missed
- Action: Send email to on-call + escalate after 5 minutes
Auto-Recovery
- Trigger: Uptime monitor recovers
- Action: Send Slack to #monitoring + close investigation
Automation Logs
Every automation execution is logged with:
- Timestamp — When the automation ran
- Trigger — What event caused it
- Actions taken — What the automation did
- Result — Success or failure for each action
- Duration — How long the automation took
View logs at Automations → Logs.
API Endpoints
List Automations
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.unsparing.dev/api/v1/automationsCreate an Automation
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "SSL Renewal Reminder",
"trigger": {
"type": "ssl.expiring",
"conditions": {
"days": 14
}
},
"actions": [
{"type": "notification.slack", "channel": "#infra-alerts"},
{"type": "investigation.create", "title": "SSL renewal needed"}
]
}' \
https://api.unsparing.dev/api/v1/automations