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
- PagerDuty + Metabase — incidents with acknowledge and resolve timestamps
- Datadog + Metabase — incidents joined to monitors and SLOs
Related
Metrics
Integrations
Dashboards
FAQ
What is MTTR?
Is MTTR the same as DORA's time to restore service?
What is the difference between MTTR and MTTA?
Mean or median?
percentile_cont(0.5) and percentile_cont(0.9) as in the SQL patterns above, segment by severity, and exclude open incidents (resolved_at IS NULL) from the duration math. The same right-skew applies to MTTA and lead time for changes.Where do start and end times come from?
incident with open and close timestamps. Use detection or failure start time as the start, not when someone got around to opening a ticket, and service restored as the end. Joining a deployment_id from GitHub or GitLab onto each incident also unlocks change failure rate from the same table.