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.
started_at → resolved_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
incidentstable:started_at,resolved_at,severity,environment, and optionallydeployment_id. - Source: PagerDuty, Opsgenie, incident.io, Statuspage, or GitHub/GitLab issues labeled
incidentwith open/close timestamps.
SQL patterns
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;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
resolved_at IS NULL) from the duration math.Where this metric applies
- GitHub + Metabase — incidents joined to the triggering deploy
- GitLab + Metabase — incidents joined to pipeline deployments