5.8 KiB
Alerts and Incident Response
Alertmanager: configured in monitoring/alertmanager-config.yaml
Receivers:
- Email →
garfield@squaremcp.comvia Azure Comm Services (smtp.azurecomm.net:587) - Slack →
#alertsvia existing webhook
Current alert routing
| Alert | Severity | Route | Action |
|---|---|---|---|
| Default alerts | critical/warning | Slack #alerts + email |
Page/notify |
InfoInhibitor |
info | null |
Suppressed |
Watchdog |
none | null |
Heartbeat, no notification |
Alerts to pay attention to
Website down
Likely cause: certificate expiry, DNS issue, ingress misconfig, service crash, host/network outage.
PromQL: probe_success{job="blackbox-http"} == 0
Response:
- Check
probe_duration_secondsto see if it is a timeout vs. connection refused. - Test manually:
curl -I https://<site>. - Check ingress:
microk8s kubectl get ingress -Aandmicrok8s kubectl get pods -n ingress. - Check the backing pod logs:
microk8s kubectl logs -n <namespace> -l app=<app> --insecure-skip-tls-verify-backend=true. - Check SSL expiry:
(probe_ssl_earliest_cert_expiry - time()) / 86400.
MySQL down
PromQL: up{job="mysql"} == 0 or mysql_up == 0
Response:
- MySQL runs as a Docker container on the host at
:3306. - Check container:
docker ps | grep mysqlorss -tlnp | grep 3306. - If stopped, restart from the
fetcherpay_mysql_datavolume (see previous deployment notes). - Check mysql-exporter pod:
microk8s kubectl get pods -n fetcherpay -l app=mysql-exporter.
Redis down
PromQL: up{job="redis"} == 0 or redis_up == 0
Response:
- Check Redis pod:
microk8s kubectl get pods -n fetcherpay -l app=redis. - Check logs:
microk8s kubectl logs -n fetcherpay -l app=redis --insecure-skip-tls-verify-backend=true. - Verify exporter:
microk8s kubectl get pods -n fetcherpay -l app=redis-exporter.
Prometheus down
PromQL: up{job="prometheus"} == 0
Response:
- Check pod:
microk8s kubectl get pods -n fetcherpay -l app=prometheus. - Check logs; common issue is invalid config.
- If ConfigMap changed, restart:
microk8s kubectl rollout restart deployment/prometheus -n fetcherpay.
OTel collector down
PromQL: up{job="otel-collector"} == 0 or absent otelcol_process_uptime_total
Response:
- Check pod:
microk8s kubectl get pods -n observability -l app=otel-collector. - Common failure: invalid YAML config. Fix and reapply
monitoring/opentelemetry-collector.yaml. - Restart:
microk8s kubectl rollout restart deployment/otel-collector -n observability.
High container restart rate
PromQL: rate(kube_pod_container_status_restarts_total[5m]) > 0.01
Response:
- Identify pod/namespace from labels.
- Check events:
microk8s kubectl describe pod -n <ns> <pod>. - Check logs (with TLS skip flag if needed).
- Investigate resource limits, OOM, liveness probe failures.
Node CPU / memory / disk high
PromQL:
- CPU:
100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 85 - Memory:
100 * (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) > 85 - Disk:
100 - ((node_filesystem_avail_bytes{mountpoint="/"} * 100) / node_filesystem_size_bytes{mountpoint="/"}) > 85
Response:
- Identify which pod/container is consuming resources via K8s Prometheus.
- Scale, restart, or optimize the offending workload.
- For disk: clean logs, old images (
docker system prune -a), or expand storage.
SSL certificate expiring
PromQL: (probe_ssl_earliest_cert_expiry{job="blackbox-http"} - time()) / 86400 < 14
Response:
- Renew the cert (likely cert-manager handles this).
- Check cert-manager:
microk8s kubectl get certificates -A. - Force renewal if stuck.
Pre-existing issues that will trigger alerts
These are already unhealthy and will show red in dashboards. They are not caused by recent deployments.
fetcherpay-leads-api / fetcherpay-leads-worker ImagePullBackOff
Why: stale image references to dead registry 23.120.207.35:32000. Current registry is localhost:32000, and tag v16-import-fix does not exist.
Fix options:
- Update Deployments to use
localhost:32000/fetcherpay/leads-api:latest. - Delete the Deployments if the leads feature is abandoned.
nginx-ingress-microk8s-controller restarts
Why: chronic single-node instability (~1 restart/day over 9 months). Likely OOM, liveness timeouts, or containerd sandbox churn.
Mitigation:
- Add memory request/limit to the ingress DaemonSet.
- Monitor
kube_pod_container_status_restarts_total{namespace="ingress"}. - Check
dmesg/ kernel OOM logs if restarts spike.
How to add a new alert rule
- Edit the Prometheus ConfigMap or kube-prometheus-stack PrometheusRule CRDs.
- For FetcherPay Prometheus, add a
rule_filessection or userecording_rules/alerting_rulesinmonitoring/prometheus-config.yaml. - Apply and restart Prometheus.
- Verify in Alertmanager:
https://dashboard.fetcherpay.com/alerting/or API.
Example simple rule:
groups:
- name: fetcherpay
rules:
- alert: WebsiteDown
expr: probe_success{job="blackbox-http"} == 0
for: 2m
labels:
severity: critical
annotations:
summary: "Website {{ $labels.instance }} is down"
Runbook quick-decision tree
ALERT fires
│
├─ Is it a website? → check probe_success, curl manually, check ingress
├─ Is it MySQL/Redis/Prometheus/OTel? → check pod status, restart if needed
├─ Is it a pod restart spike? → describe pod, check OOM/probes
├─ Is it node resource pressure? → identify top consumer, scale/restart
└─ Is it a known pre-existing issue? → document, do not page unless it worsens