This document defines Service Level Objectives (SLOs), error budgets, and reliability practices for PredictIQ.
Service Level Objectives (SLOs) are target values or ranges for service levels measured by Service Level Indicators (SLIs). They represent the reliability goals we commit to achieving.
- SLI (Service Level Indicator): A quantitative measure of service level (e.g., request success rate, latency)
- SLO (Service Level Objective): Target value for an SLI (e.g., 99.9% availability)
- Error Budget: The allowed amount of unreliability (100% - SLO target)
- Burn Rate: How fast we're consuming the error budget
- Target: 99.9% (three nines)
- Measurement Window: 30 days
- Error Budget: 0.1% (43.2 minutes/month)
- Calculation:
successful_requests / total_requests * 100
- Target: ≤ 200ms
- Measurement Window: 30 days
- Error Budget: 5% of requests may exceed target
- Calculation:
percentage of requests with latency ≤ 200ms
- Target: ≤ 500ms
- Measurement Window: 30 days
- Error Budget: 1% of requests may exceed target
- Calculation:
percentage of requests with latency ≤ 500ms
- Target: ≤ 10 seconds
- Measurement Window: 7 days
- Error Budget: 5% of sync operations may exceed target
- Calculation:
percentage of sync operations completing within 10s
- Target: ≤ 50ms (P95)
- Measurement Window: 7 days
- Error Budget: 5% of queries may exceed target
- Calculation:
percentage of queries with latency ≤ 50ms
- Target: 99.95% (three nines five)
- Measurement Window: 30 days
- Error Budget: 0.05% (21.6 minutes/month)
- Calculation:
successful_cache_operations / total_cache_operations * 100
- Target: 99.0%
- Measurement Window: 30 days
- Error Budget: 1.0%
- Calculation:
delivered_emails / sent_emails * 100
The error budget determines how much unreliability is acceptable. When the budget is exhausted, we prioritize reliability over new features.
| Budget Remaining | Status | Action |
|---|---|---|
| 100% | ✅ Healthy | Normal operations - all features enabled |
| 50% | Review recent changes and incidents | |
| 25% | 🚨 Alert | Freeze non-critical feature deployments |
| 10% | 🔴 Critical | Freeze all deployments, focus on reliability |
| 0% | 💀 Emergency | Rollback recent changes, incident response |
Error budgets reset monthly at the beginning of each calendar month.
We use multi-window multi-burn-rate alerting to detect when we're consuming error budget too quickly.
- Short Window: 1 hour
- Long Window: 6 hours
- Burn Rate Threshold: 14.4x
- Meaning: At this rate, we'll exhaust the 30-day budget in 2 days
- Severity: Critical
- Action: Immediate investigation and mitigation
- Short Window: 6 hours
- Long Window: 24 hours
- Burn Rate Threshold: 6.0x
- Meaning: At this rate, we'll exhaust the 30-day budget in 5 days
- Severity: Warning
- Action: Review and plan mitigation
Error Budget Consumed = (Actual Errors / Error Budget) * 100
Error Budget Remaining = 100 - Error Budget Consumed
Burn Rate = Error Budget Consumed / Days in Window
For API Availability (99.9% target, 30-day window):
- Target: 99.9%
- Error Budget: 0.1%
- Actual Performance: 99.85%
- Actual Errors: 0.15%
Error Budget Consumed = (0.15 / 0.1) * 100 = 150%
Error Budget Remaining = 100 - 150 = -50% (exhausted!)
Burn Rate = 150 / 30 = 5% per day
Run the calculator script:
cd performance
node scripts/calculate-error-budget.jsThis generates a report showing:
- Current SLO compliance
- Error budget consumption
- Burn rates
- Status and recommended actions
SLO metrics are calculated using Prometheus recording rules defined in performance/config/prometheus-slo-rules.yml.
Key metrics:
slo:api_availability:success_rateslo:api_availability:error_budget_remainingslo:api_availability:burn_rate_1hslo:api_availability:burn_rate_6hslo:api_availability:burn_rate_24h
Import the SLO dashboard from performance/config/grafana-slo-dashboard.json to visualize:
- SLO compliance
- Error budget remaining
- Burn rates
- Historical trends
- Active alerts
Prometheus alerts are configured for:
- Fast burn (critical)
- Slow burn (warning)
- Error budget exhausted (critical)
- Error budget low (warning)
- Individual SLO violations
- Base SLOs on historical performance
- Consider user expectations
- Account for dependencies
- Leave room for maintenance
- Track SLO compliance daily
- Review error budget weekly
- Analyze trends monthly
- Adjust targets quarterly
- Spend budget on innovation
- Don't waste budget on preventable issues
- Balance reliability and velocity
- Communicate budget status to team
- Investigate root causes
- Implement fixes
- Update runbooks
- Conduct blameless postmortems
- Review SLOs quarterly
- Adjust based on business needs
- Update error budget policy
- Refine alerting thresholds
- Acknowledge: Confirm the violation in monitoring
- Assess: Determine impact and severity
- Mitigate: Take immediate action to restore service
- Communicate: Update stakeholders
- Resolve: Fix the root cause
- Review: Conduct postmortem
- Freeze Deployments: Stop all non-critical changes
- Focus on Reliability: Prioritize bug fixes and stability
- Root Cause Analysis: Identify what consumed the budget
- Implement Fixes: Address systemic issues
- Monitor Closely: Track recovery
- Resume Gradually: Lift freeze when budget recovers
Generated automatically and sent to:
- SRE team
- Engineering leadership
- Product management
Includes:
- SLO compliance percentage
- Error budget remaining
- Burn rate trends
- Incidents and violations
- MTTR (Mean Time To Recovery)
Conducted at the beginning of each month:
- Review previous month's performance
- Analyze budget consumption
- Identify improvement opportunities
- Adjust targets if needed
- Reset error budgets
node performance/scripts/calculate-error-budget.jsnode performance/scripts/generate-report.jscurl 'http://prometheus:9090/api/v1/query?query=slo:api_availability:success_rate'- Google SRE Book - SLOs
- Google SRE Workbook - SLO Engineering
- Multi-Window Multi-Burn-Rate Alerts
- Error Budget Policy
For questions or issues:
- Slack: #sre-team
- Email: sre-team@predictiq.com
- On-call: PagerDuty rotation