تخطَّ إلى المحتوى

SRE Runbooks

هذا المحتوى غير متوفر بلغتك بعد.

ɳSelf ships 7 pre-written runbooks for the most common failure scenarios. When a Grafana alert fires, Alertmanager can automatically invoke the matching runbook via the claw-ops agent.

IDTrigger AlertSeverityAuto-executable
high-error-rateHighErrorRatecriticalYes
postgres-connection-exhaustionPostgresConnectionsHighcriticalNo (requires_confirmation)
redis-oomRedisMemoryHighcriticalNo
webhook-dlq-overflowWebhookDLQHighwarningNo
loki-disk-fullLokiDiskFullwarningNo
certificate-expiryCertificateExpiringSoonwarningYes
plugin-crash-loopPluginCrashLoopcriticalYes
Terminal window
# List all installed runbooks
nself runbook list
# Execute a runbook (production)
nself runbook run high-error-rate
# Dry run - prints steps without executing
nself runbook test high-error-rate
# Pass alert context variables
nself runbook run plugin-crash-loop --var service=ai --var plugin_port=8100

Runbooks are Markdown files with a YAML front matter header. Custom runbooks go in monitoring/runbooks/ in your ɳSelf project:

---
id: my-custom-runbook
title: My Custom Runbook
trigger:
alert: MyCustomAlert
severity: warning
steps:
- action: check_logs
params:
service: my-service
last: 10m
requires_confirmation: false
- action: restart_service
params:
service: my-service
requires_confirmation: true
---
# My Custom Runbook
Describe what this runbook does...
ActionParametersAuto-executes
check_logsservice, last, levelAlways
restart_serviceserviceUnless requires_confirmation: true
notify_slackchannel, messageAlways (requires SLACK_WEBHOOK_URL)
run_commandcommandAlways
run_queryquery (SQL)Always
escalatemessagePosts to Slack, requires_confirmation=true

When Alertmanager fires an alert, it sends a webhook to the claw-ops endpoint. The claw-ops agent matches the alert name to a runbook and executes all steps not marked requires_confirmation: true.

Enable by setting nself in .env.prod:

Terminal window
NSELF_CLAW_OPS_WEBHOOK_URL=http://127.0.0.1:8001/runbook/trigger

Steps with requires_confirmation: true always escalate to Slack for human review.