Production engineering guide for error budget policies covering patterns, implementation strategies, and operational best practices.
Error budget policies define how teams manage service reliability and when to stop adding features to maintain availability targets. These policies govern the relationship between reliability goals and development velocity, establishing when work must pause or slow to preserve system health.
Error budgets are calculated as 100% minus the acceptable error rate for a service. For example, a service with a 99.9% uptime target has a 0.1% error budget, meaning 14.4 minutes of downtime per month is acceptable. When that budget is consumed, teams must pause new feature development and focus on reliability.
Error budget policies are typically expressed as a configuration document or API endpoint that defines:
Example policy definition in JSON format:
{
"service": "payment-processing",
"target_availability": "99.9%",
"error_budget": "0.1%",
"measurement_window": "30d",
"policy_rules": [
{
"condition": "error_budget_remaining < 20%",
"action": "pause_feature_development",
"duration": "7d"
},
{
"condition": "error_budget_remaining < 5%",
"action": "require_approval",
"threshold": "99.99%"
}
]
}
Services must expose metrics for error tracking through standard monitoring interfaces. The error budget calculation depends on consistent availability metrics collected over defined time windows.
Example Prometheus query for error rate:
1 - (sum(rate(http_requests_total{status=~"2.*"}[5m])) / sum(rate(http_requests_total[5m])))
Policy enforcement typically requires a service that watches metrics and triggers actions when thresholds are crossed. The enforcement system must be able to:
When a service exceeds its error budget, enforcement systems must immediately detect this condition and begin applying policy actions. The detection mechanism should use sliding time windows for accurate measurements.
Example enforcement logic:
def check_error_budget(service_metrics, policy_config):
current_error_rate = calculate_error_rate(service_metrics)
target_error_rate = 100 - float(policy_config["target_availability"].replace("%", ""))
if current_error_rate > target_error_rate:
return {"violation": True, "excess": current_error_rate - target_error_rate}
return {"violation": False}
When error budget thresholds are exceeded, enforcement systems must trigger automatic responses. These can include:
Example alert notification:
ERROR BUDGET VIOLATION: payment-processing
Current error rate: 0.15%
Error budget remaining: 15%
Action required: Pause all non-critical feature work
Enforcement systems should include mechanisms for manual overrides when policy violations are acceptable. These overrides must be logged and tracked for future review.
Example override request:
{
"service": "payment-processing",
"override_reason": "Customer-facing feature launch",
"requested_budget": "0.2%",
"duration": "3d",
"approved_by": "sre-team-lead"
}
Some conditions may require immediate exceptions to error budget policies, such as:
These exceptions must be tracked separately from normal policy violations and should include:
Exception requests must follow a defined approval process that includes:
Example approval workflow:
approval_process:
required_approvals: 2
escalation_path:
- sre_team_lead
- platform_architect
- engineering_director
review_frequency: "weekly"
Systems should track how often policies are triggered and whether they achieve their intended outcomes. This includes:
Example monitoring query:
rate(error_budget_violations_total[1h])
Policies should be evaluated based on their actual impact on system reliability and team productivity. This involves:
Some error budget violations may not trigger alerts if monitoring systems are misconfigured. For example, when a service is configured to report metrics only at 15-minute intervals, short-lived errors might be missed entirely.
The most common silent failure occurs when:
Teams often misinterpret policy thresholds, particularly when they are expressed as percentages rather than absolute values. For example, a 10% error budget does not mean "10% of all requests fail" but rather that the service exceeds its target availability threshold.
When multiple enforcement systems operate independently, teams may experience inconsistent behavior. For instance, one system might pause deployments while another continues allowing new features to be merged.
Services implementing error budget policies must expose:
Example API contract:
GET /api/v1/error-budget/status
GET /api/v1/error-budget/policy
POST /api/v1/error-budget/exception
GET /api/v1/error-budget/history
The calculation process should use consistent time windows and include:
Example calculation method:
def calculate_error_budget(current_errors, total_requests, target_percentage):
error_rate = current_errors / total_requests
budget_remaining = target_percentage - (error_rate * 100)
return max(0, budget_remaining)
Error budget policies must integrate with:
All error budget policies must be publicly documented and version-controlled. This includes:
Teams must understand when their services are subject to error budget policies and what actions they must take when policies are triggered.
The key sharp edge is that enforcement systems often work by modifying deployment permissions or blocking CI/CD pipelines, but these changes may not be immediately visible to all team members. Teams must know how to check policy status and understand the implications of different violation levels.
This page was rewritten on 16 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.
We use cookies for analytics (Google Analytics) and advertising (Google AdSense) to improve your experience and support free content. Privacy Policy