SRE (Site Reliability Engineering) — discipline from Google (2003, Ben Treynor Sloss), applying software engineering principles to infra+ops. Core ideas: **error budgets** (acceptable downtime), **toil reduction** (automate manual work), **SLO-driven** (data over gut feel), shared ownership with dev teams. Differs from DevOps: SRE — SWE role with 50% coding, DevOps — practice + culture.
Below: details, example, related terms, FAQ.
Free online tool — HTTP header checker: instant results, no signup.
// SLO (Service Level Objective):
99.9% of HTTP requests return 2xx/3xx within 200ms, measured over 30 days
// Error budget depletion triggers:
- Feature freeze if budget < 25%
- Automated rollback if burn rate > 10xSite Reliability Engineering (SRE) relies heavily on metrics and monitoring to ensure system reliability and performance. Key metrics include:
To effectively monitor these metrics, SRE teams often leverage tools like Prometheus, Grafana, or Datadog. For instance, you can set up a basic Prometheus configuration to monitor your application:
global:
scrape_interval: 15s # Set the default scrape interval to every 15 seconds.
scrape_configs:
- job_name: 'my_application'
static_configs:
- targets: ['localhost:8080']This configuration allows Prometheus to scrape metrics from your application running on localhost:8080 every 15 seconds. By analyzing these metrics, SRE teams can proactively identify issues before they affect users.
Automation is a cornerstone of Site Reliability Engineering, aimed at reducing toil and enhancing efficiency. SREs utilize automation to streamline operational tasks, allowing them to focus on higher-value activities such as improving system reliability and developing new features.
Common areas where automation is applied include:
For example, to automate the deployment of an application using Terraform, you might use a configuration file like this:
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "app_server" {
ami = "ami-123456"
instance_type = "t2.micro"
}This Terraform script provisions an EC2 instance in AWS, enabling SRE teams to manage their infrastructure more efficiently. By leveraging automation, SREs can significantly reduce the amount of manual work required, allowing them to focus on enhancing system reliability.
Effective incident management is crucial in Site Reliability Engineering. SRE teams must ensure that incidents are handled efficiently to minimize downtime and impact on users. Here are some best practices for incident management:
For example, an on-call schedule can be set up using a simple configuration in PagerDuty:
{
"schedule": {
"name": "SRE On-Call",
"time_zone": "UTC",
"escalation_policy": "SRE Escalation Policy",
"users": ["user1@example.com", "user2@example.com"]
}
}By implementing these best practices, SRE teams can effectively manage incidents, ensuring that services remain reliable and user experience is preserved.
SRE — concrete role (SWE + ops). DevOps — culture + practices. SRE is a way to implement DevOps. Google treats them as distinct; many companies use the terms interchangeably.
Full SRE role — yes for <10 devs. But principles (SLO, blameless postmortems, toil reduction) applicable at any size.
"Site Reliability Engineering" (2016) + "SRE Workbook" (2018) — free at sre.google/books. Canonical source.
Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.