Skip to content

CICD-360 · Error budget deployment gate ​

Encyclopedia · Observability and SRE pipelines · All snippets

Previous · CICD-359 · Next · CICD-361

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites staging metrics stack, provisioned endpoints and read-only CI identity except explicitly approved writes.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters PROM_URL.

2. Copy the snippet ​

bash
curl -fsSG "${PROM_URL:?}/api/v1/query" --data-urlencode 'query=slo:burn_rate_1h{service="web"}' | jq -e '.data.result | length==1 and (.[0].value[1]|tonumber) <= 2'

3. How it works ​

Burn rate estimates how rapidly the observed error rate consumes the available budget. This gate accepts only one sample below the stated policy limit.

The deployment gate rejects unusable samples as well as over-budget values.

flowchart TD
  N1["Query burn rate"]
  N2{"One sample within budget"}
  N1 --> N2
  N3["Gate passes"]
  N2 -->|Yes| N3
  N4["Hold deployment"]
  N2 -->|No| N4

4. Verify the result ​

Define the burn-rate rule and release threshold with the SLO owner. Escalate a failed gate through the documented operational route.

Validation syntax-validated (Bash parse). Status definitions.