Metric · DORA

What is MTTR, and how do you measure it in Metabase?

MTTR — mean time to recovery, which DORA calls time to restore service — is how long it takes to recover from a production failure. It's a DORA stability metric, the recovery half of change failure rate. Measure it in Metabase from incident timestamps, joined where possible to the GitHub or GitLab deploy that triggered the failure.

TL;DR — Incident started_atresolved_at, reported as a median (and p90), not a mean. Despite the name, don't use the average — recovery times are heavily skewed.

What MTTR measures

It measures recovery speed: from when a production incident starts to when service is restored. Low MTTR means failures are detected and resolved fast, so you can deploy frequently without large blast radius. Report median + p90; a single multi-day outage will wreck a mean.

What data does it need?

  • An incidents table: started_at, resolved_at, severity, environment, and optionally deployment_id.
  • Source: PagerDuty, Opsgenie, incident.io, Statuspage, or GitHub/GitLab issues labeled incident with open/close timestamps.

SQL patterns

Median + p90 time to restore by monthPostgreSQL
SELECT
  date_trunc('month', started_at) AS month,
  COUNT(*) AS incidents,
  percentile_cont(0.5) WITHIN GROUP (
    ORDER BY EXTRACT(EPOCH FROM (resolved_at - started_at)) / 3600
  ) AS median_restore_hours,
  percentile_cont(0.9) WITHIN GROUP (
    ORDER BY EXTRACT(EPOCH FROM (resolved_at - started_at)) / 3600
  ) AS p90_restore_hours
FROM incidents
WHERE resolved_at IS NOT NULL
  AND environment = 'production'
GROUP BY 1
ORDER BY 1;
By severity (trailing 90 days)PostgreSQL
SELECT
  severity,
  COUNT(*) AS incidents,
  percentile_cont(0.5) WITHIN GROUP (
    ORDER BY EXTRACT(EPOCH FROM (resolved_at - started_at)) / 60
  ) AS median_restore_minutes
FROM incidents
WHERE resolved_at IS NOT NULL
  AND started_at >= CURRENT_DATE - INTERVAL '90 days'
GROUP BY 1
ORDER BY median_restore_minutes DESC;

Pitfalls

Reporting the mean.→ Despite the "M" in MTTR, use the median (and p90); one long outage skews the average.
Wrong start time.→ Use detection/start time, not the time someone got around to opening a ticket.
Mixing incident types.→ Segment by severity; a Sev-1 outage and a minor blip shouldn't be averaged together.
Counting unresolved incidents.→ Exclude open incidents (resolved_at IS NULL) from the duration math.

Where this metric applies

Metrics

Integrations

Dashboards

FAQ

Is MTTR the same as DORA's time to restore service?
They're used interchangeably. DORA's official label is time to restore service; MTTR (mean time to recovery) is the common shorthand. Report it as a median.
Mean or median?
Median, plus p90. Recovery times are right-skewed, so the mean overstates typical recovery.
Where do start and end times come from?
From your incident tool (PagerDuty, Opsgenie, incident.io) or labeled issues. Use detection/start time as the start and resolution as the end.