How do you use SLOs to decide whether a deploy should be rolled back automatically?

AdvancedScenarioSLOs and Error Budgets
Answer

Situation read → Progressive delivery can use the SLI as its health signal.

What I'd do →

  1. Use Argo Rollouts or Flagger with canary steps (5%, 25%, 50%).
  2. Define an AnalysisTemplate querying Prometheus for the canary's error ratio and latency SLI.
  3. Fail the analysis if the canary burns budget faster than baseline (e.g. error ratio > 1% for 2 consecutive checks).
  4. Automatic rollback on failure; notify the team.
metrics:
  - name: error-ratio
    interval: 1m
    failureLimit: 2
    successCondition: result[0] < 0.01
    provider:
      prometheus:
        address: http://prometheus.monitoring:9090
        query: sum(rate(http_requests_total{app="api",track="canary",code=~"5.."}[2m])) / sum(rate(http_requests_total{app="api",track="canary"}[2m]))

Why → Bad deploys are caught on a fraction of traffic before they burn the full budget.

Interview tip → Compare canary to baseline, not to a fixed number, when traffic varies.

All Monitoring & Observability questions

More on SLOs and Error Budgets