Overview

This module uses GitLab’s GraphQL API to calculate core DevOps performance metrics for a single repository. It gathers merge request and incident data in bulk and produces structured time-series results.

Authentication & Permissions

  • Personal Access Token (PAT)
    • Required scope: api
    • Optional: read_repository, read_api, read_user
  • Self-Managed Instances
    • Use your instance’s base URL (e.g., https://gitlab.example.com)
    • Ensure network rules allow API access

Metrics

Deployment Frequency

  • Count of merge requests merged in the date range where the last pipeline status is SUCCESS.

Lead Time for Changes

  • Average time from merge request creation to merge, based on MR timestamps.

Change Failure Rate

  • Proportion of merge requests whose last pipeline status is FAILED.

Mean Time to Recovery (MTTR)

  • Average time to close issues labeled incident.

First Review Time

  • Average time from merge request creation to the first non-system note.

First Approval Time

  • Average time from merge request creation to the first approval note.

First-to-Last Approval Time

  • Average interval between the first and last approval notes on each merge request.

Last Approval-to-Merge Time

  • Average duration from the final approval note to merge completion.

Time to Open

  • Average time between the earliest commit in the MR branch and its creation (zeroed if negative).

Time to Merge

  • Average duration from merge request creation to merge completion.