Platform Engineering · Lesson 227

Service Ownership, Operational Contracts, Toil, and Team Health

Reliability starts with a clear answer to "whose is this?". Service ownership means one team owns a service end to end: its code, its SLOs, its on-call, its runbooks, and its budget. An operational contract writes down what the service promises its consumers (SLOs, support hours, how to get help, change notice) and what it needs from its dependencies. SLAs are the subset of promises with financial consequences for external customers, set looser than the internal SLOs. Toil is manual, repetitive, automatable work that grows with the service; SRE practice caps it (Google's guideline is under 50% of time) and measures it. And all of it is done by people, so cognitive load and team health are reliability inputs too. This lesson follows one service through a quarter, and shows two failures: a service nobody owned, and a team buried in toil.

Difficulty: Advanced · Know this first: Lesson 218, Lesson 220

What you will learn

By the end of this lesson you can work at four levels:

This page teaches it with a plain-language analogy, an animated diagram with normal and failure scenarios, a simulator, a quiz, basic, intermediate, advanced, and master checks, the expert detail ("Go deeper"), a production incident, a hands-on lab with commands and their output, and a production design exercise.

Run it as:

When it breaks, I check

One thing to remember

Where the time goes

This bar adds up hours of reliability work in one quarter. It is a worked example, not a measurement. The owner and toil hops are where services and teams quietly fail.

Try it: ownership and toil

Pick how ownership is kept, whether toil is measured and capped, and the size of the on-call rota.

18%time on toil
1 in 8weeks on call
loworphaned-service risk

Check yourself

Three questions. No score is saved anywhere — this is just you against the material.

Basic to master

Operational ownership grows in four levels: knowing what you own, writing contracts and SLOs, measuring and cutting toil, and keeping ownership and teams healthy across an organisation.

Basic — Know what you own

At the basic level you can say what your team owns and what it promises.

  • Your services in the catalogue, their SLOs, and their consumers.
  • SLI, SLO, SLA, error budget.
  • Toil versus overhead versus engineering work.

Where it breaks: an SLA stricter than the SLO.

Try it: Basic

An SLA promises 99.9% and the internal SLO is 99.5%. What is wrong?

Now do it: Compare your SLAs and SLOs.

Intermediate — Contracts and dependencies

At the intermediate level promises and needs are written down.

  • An operational contract per service: SLOs, limits, support, change notice.
  • Dependencies with their SLOs and failure behaviour.
  • Expiry monitoring for certificates, credentials, and quotas.

Try it: Intermediate

Which "dependency" most often causes silent outages?

Now do it: List every certificate your service depends on.

Advanced — Measure and cut toil

At the advanced level toil is measured and reduced every quarter.

  • Toil from ticket tags, interrupt logs, and time samples.
  • Ranked by hours; causes removed (retries, self-service, alert fixes).
  • A cap (for example 30%) with reserved engineering time.

Try it: Advanced

What is the best fix for a manual morning rerun of failed batches?

Now do it: Rank your top five toil tasks by hours.

Master — Ownership and health at scale

At the master level ownership and team health are managed across the organisation.

  • Ownership checks in the catalogue; reorganisations include an ownership transfer step.
  • Cognitive load reviewed when teams take on services.
  • On-call load, toil, and health survey trends reported and acted on.

Trade-off: "you build it, you run it" gives fast feedback and burns teams without platform and SRE support; the support is part of the model.

Try it: Master

A team owns 11 services in 5 languages and diagnosis often waits for one person. What do you do?

Now do it: Count services and technologies per team.

Go deeper

An operational contract, short enough to be read:

Service:        notifications (owner: team-messaging, on-call: messaging-primary)
Consumers:      checkout, accounts, marketing
Promises:       99.9% of messages accepted within 2 s (28-day SLO); delivery to provider within 60 s for 99%
Limits:         500 messages/s per consumer; payload ≤ 64 KB; templates must be registered
Support:        P1 24/7 (page messaging-primary); P2 business hours; #messaging-help
Changes:        60 days' notice for breaking API changes; changelog in the portal
Dependencies:   two email providers (failover), SMS provider, Kafka (SLO 99.95%), Postgres
External SLA:   99.5% monthly to enterprise customers (backed by the 99.9% SLO)
Review:         every quarter with consumers

Measuring toil without a big process: tag tickets and interrupt work as toil, sample two weeks of time across the team twice a year, and add up hours per task. Google's SRE book defines toil as manual, repetitive, automatable, tactical, devoid of enduring value, and scaling linearly with service growth; its guideline caps toil at 50% of an SRE's time, and many teams aim far lower.

One time it broke

This is a composite of a failure pattern that keeps repeating; the details are illustrative. The service that belonged to a team that no longer existed.

Timeline

  • Month 0A reorganisation splits the team that built notifications. The catalogue is not updated; the alert channel is archived.
  • Month 5, Saturday 02:00The certificate used for the email provider integration expires. Sends fail. Alerts fire into the archived channel.
  • Saturday 21:00Customer support escalates: password-reset and receipt emails are missing. The incident commander cannot find an owner.
  • Sunday 08:00An engineer who once worked on the service renews the certificate. Queued messages are sent; some password-reset links have expired.

What changed after

Reorganisation checklists include ownership transfer, the catalogue flags services whose owning team has no members, certificate renewal is automated with expiry alerts, and every alert route is tested monthly.

Try it yourself, from scratch

Everything here runs on any Linux machine: your own laptop, WSL on Windows (run wsl --install in PowerShell once), or a small cloud VM. The Python needs only Python 3 and its standard library; check that you have it with python3 --version.

Before you start: Linux with OpenSSL and network access, and Python 3.

1. Linux commands

Type each one, read what it prints, and compare it with the note above it.

  1. Check when a certificate expires, the dependency that most often fails silently.

    Read-only

    echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate -subject

    Options: -servername sends SNI so you get the right certificate; -enddate prints the expiry.

    Expect: notAfter= a date, and the subject. Read-only.

  2. Turn it into a check that fails when expiry is under 14 days, ready for cron or a monitor.

    Read-only

    end=$(echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate | cut -d= -f2)
    days=$(( ( $(date -d "$end" +%s) - $(date +%s) ) / 86400 ))
    echo "example.com expires in $days days"; [ "$days" -ge 14 ] || { echo "RENEW NOW"; exit 1; }

    Expect: The days remaining, and exit code 0 unless it is under 14. Read-only.

  3. Openssl can also check every certificate in a list of hosts your service depends on.

    Read-only

    for h in example.com example.org; do
      printf "%-14s " "$h"; echo | openssl s_client -connect "$h:443" -servername "$h" 2>/dev/null | openssl x509 -noout -enddate
    done

    Expect: One expiry date per dependency. Read-only.

    Clean up: nothing to clean up: every step only reads, and nothing was created or changed.

2. Python: ownership.py

This program audits ownership and toil the way an SRE team would at the start of a quarter: it finds services whose owning team no longer exists, checks that every SLA is backed by a stricter SLO, and ranks toil from tagged tickets so the biggest, most automatable items come first. Save it as ownership.py, then run it.

# ownership.py
TEAMS = {"team-messaging": 7, "team-payments": 6, "team-growth": 0}     # members today
SERVICES = {
    "notifications": {"owner": "team-growth", "slo": 99.9, "sla": 99.5},
    "payments-api": {"owner": "team-payments", "slo": 99.95, "sla": 99.9},
    "receipts": {"owner": "team-messaging", "slo": 99.5, "sla": 99.9},
}
for name, s in SERVICES.items():
    problems = []
    if TEAMS.get(s["owner"], 0) == 0:
        problems.append(f"owner {s['owner']} has no members: orphaned")
    if s["sla"] >= s["slo"]:
        problems.append(f"SLA {s['sla']}% is not looser than SLO {s['slo']}%")
    print(f"{name:<14} {'; '.join(problems) if problems else 'ok'}")
print()

TICKETS = [  # (task, minutes, automatable?)
    ("rerun failed send batch", 25, True), ("quota increase for provider", 40, True), ("ack flapping alert", 5, True),
    ("rerun failed send batch", 25, True), ("customer template question", 20, False), ("rerun failed send batch", 25, True),
    ("ack flapping alert", 5, True), ("quota increase for provider", 40, True), ("ack flapping alert", 5, True),
    ("design review", 90, False), ("rerun failed send batch", 25, True), ("ack flapping alert", 5, True),
]
WEEKS, TEAM_HOURS_PER_WEEK = 1, 7 * 36
toil = {}
for task, mins, auto in TICKETS:
    if auto:
        toil[task] = toil.get(task, 0) + mins
SCALE = 30                                         # the sample is one day of tickets; a month is about 30 times that
print("toil, ranked (sampled day x 30):")
for task, mins in sorted(toil.items(), key=lambda kv: -kv[1]):
    print(f"  {task:<30} {mins * SCALE / 60:5.1f} h a month")
total_h = sum(toil.values()) * SCALE / 60
print(f"toil is about {total_h / (TEAM_HOURS_PER_WEEK * 4.3):.0%} of the team's month; cap 30%")

Run it, and you should see this output:

$ python3 ownership.py
notifications  owner team-growth has no members: orphaned
payments-api   ok
receipts       SLA 99.9% is not looser than SLO 99.5%

toil, ranked (sampled day x 30):
  rerun failed send batch         50.0 h a month
  quota increase for provider     40.0 h a month
  ack flapping alert              10.0 h a month
toil is about 9% of the team's month; cap 30%

3. What to notice

4. Advanced: every step as one Bash script

The same Linux steps, made into a real script you can keep and run again. It uses the Bash features a production script needs: functions (one per step), an array of step names, arguments to choose steps, a case for options, exit codes recorded for each step, and a trap that prints a summary even when you stop it with Ctrl+C. Make a folder for this lesson (mkdir -p ~/labs/service-ownership-operational-contracts-and-toil && cd ~/labs/service-ownership-operational-contracts-and-toil) and save this as lab.sh.

#!/usr/bin/env bash
# The Linux steps of "Service Ownership, Operational Contracts, Toil, and Team Health", as one script (save it as lab.sh).
#
#   ./lab.sh          run every step, in order
#   ./lab.sh 2 4      run only steps 2 and 4
#   ./lab.sh --list   list the steps
#
# The steps share one shell, so a later step can use what an earlier one set up (a folder,
# a variable, a container): run them all in order the first time. Your own scripts should
# start with "set -euo pipefail"; this one runs teaching commands, and some of them fail on
# purpose, so it records each step's exit code instead of stopping at the first failure.

STEPS=(
  'Check when a certificate expires, the dependency that most often fails silently.'
  'Turn it into a check that fails when expiry is under 14 days, ready for cron or a monitor.'
  'Openssl can also check every certificate in a list of hosts your service depends on.'
)

step_1() {
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate -subject
}

step_2() {
end=$(echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate | cut -d= -f2)
days=$(( ( $(date -d "$end" +%s) - $(date +%s) ) / 86400 ))
echo "example.com expires in $days days"; [ "$days" -ge 14 ] || { echo "RENEW NOW"; exit 1; }
}

step_3() {
for h in example.com example.org; do
  printf "%-14s " "$h"; echo | openssl s_client -connect "$h:443" -servername "$h" 2>/dev/null | openssl x509 -noout -enddate
done
}

# print a step that has to be run by hand, instead of running it
by_hand() {
  echo "  (run this one yourself: $1)"
  sed 's/^/    /'
}

RESULTS=()
run_step() {
  local n=$1 start=$SECONDS code
  printf '\n== step %d of %d: %s\n' "$n" "${#STEPS[@]}" "${STEPS[n-1]}"
  "step_$n"
  code=$?
  RESULTS+=("step $n: exit code $code, $((SECONDS - start)) s")
}

summary() {
  echo
  echo "== summary"
  local r
  for r in "${RESULTS[@]}"; do echo "  $r"; done
}

case "${1:-}" in
  -h|--help) sed -n '2,6p' "$0"; exit 0 ;;
  --list) for i in "${!STEPS[@]}"; do echo "$((i + 1)). ${STEPS[i]}"; done; exit 0 ;;
esac

[ $# -eq 0 ] && set -- $(seq 1 "${#STEPS[@]}")
for n in "$@"; do
  if ! [[ $n =~ ^[0-9]+$ ]] || (( n < 1 || n > ${#STEPS[@]} )); then
    echo "there is no step '$n'; try --list" >&2
    exit 2
  fi
done
trap summary EXIT
trap 'echo; echo "stopped with Ctrl+C"; exit 130' INT
for n in "$@"; do run_step "$n"; done

Then make it executable and run it:

chmod +x lab.sh
./lab.sh --list     # the steps
./lab.sh            # every step, then a summary of exit codes and times
./lab.sh 2 3        # only steps 2 and 3

5. Learn the basics behind it

New to a feature used above? These W3Schools pages explain each one from zero, with examples you can run in the browser.

If you remember nothing else

Design exercise

You join as head of SRE in a company with 150 services, unclear ownership after two reorganisations, and teams reporting heavy on-call. Plan the first six months.

Clarifying questions to ask

How do you establish ownership and keep it current? What goes into operational contracts? How do SLOs and SLAs relate? How do you measure toil and on-call load? What do you change first? How do you know team health is improving?

Rough sizing

Say 150 services, 20 teams, 30 services with no clear owner, an average of 5 pages per on-call shift, and toil estimated at 50% on the platform team.

Shape of the answer

An ownership drive: every service assigned in the catalogue within six weeks, unowned ones retired or adopted, ownership transfer added to reorganisation checklists; operational contracts for tier-1 services first; SLOs per service with SLAs looser; alert hygiene to cut pages to actionable ones; toil measured by tags and a time sample, top items removed each quarter with a 30% cap; on-call rotas of at least six to eight; quarterly health surveys; reports on pages per shift, toil share, and health trends.

Trade-offs to name

Forcing ownership of legacy services is unpopular and stops silent failures; capping toil means saying no to some manual requests; bigger rotas spread load and mean each person is on call less often, so knowledge needs runbooks.

Failure modes and how to troubleshoot them

Each row is one way this system went wrong in the diagram's scenarios. The hop number is where to look first.

ScenarioWhereEffectWhat goes wrong
Owned by nobodyHop 1: OwnerBreaksThe team that built notifications was split up in a reorganisation. The catalogue still lists it as owner; its alert channel is archived. A TLS certificate on the email provider integration expires on a Saturday. Alerts go nowhere.
Toil not measuredHop 6: ToilBreaksToil is never measured. Manual reruns of failed batches, provider quota tickets, and acknowledging the same flapping alert take 70% of the team's time. Project work stops; incident follow-ups are never done, so the same incidents recur.

How to troubleshoot

  1. Write down the symptom and when it started: what users see, which number moved, and what changed just before (a deploy, a config change, traffic).
  2. Walk the path in order, from the first hop to the last: Owner → Operational contract → SLOs and SLAs → Dependencies → On-call → Toil → Toil reduction → Cognitive load → Team health. The first hop whose evidence is wrong is where to dig.
  3. At that hop, run the read-only check from the diagram or the lab first; change nothing until the evidence points at a cause.
  4. Fix the smallest thing that restores service, or roll back the last change, and confirm the symptom is gone with the same check.
  5. Write down what you found and the check that would have caught it sooner, so the next person starts there.

References and review

The official documentation and standards behind this lesson. Versions and defaults change; when a command or field here differs from them, trust the official page.

Last updated . Next review due by November 2027. Found something out of date? Tell me.

Saved on this device, in this browser.
Next in this series · Lesson 228
Incident Command, Communications, Status Pages, and Postmortems

In a serious incident, the technical fix is often the easy part; coordinating people is hard. Incident command gives an incident a structure: one incident commander who coordinates and decides, an operations lead who directs the…

Go to Lesson 228 →

Or browse the full course from the Lessons index.