Merge request analytics

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

Analytics mode returns aggregated metrics for merge requests, with data typically available within 10 minutes.

To query individual merge request records, use Merge requests.

Allowed scopes

ScopeDescription
projectQuery merge requests in a specific project.
groupQuery merge requests across all projects in a group, including subgroups.

To aggregate merge requests across multiple groups or projects, use a list with the in operator. For more information, see multiple groups and projects.

Query filters

Use these fields in the query parameter to filter your results.

FieldNameOperators
Author is humanauthorHuman=, !=
Created atcreated=, >, <, >=, <=
Created by DuocreatedByDuo=, !=
Merged atmerged=, >, <, >=, <=
Statestate=, !=, in, not in
Target branchtargetBranch=, !=, in, not in

Author is human

Description: Filter merge requests by whether their author is a human user.

Allowed value types:

  • Boolean (true or false)

Notes:

  • Bots, service accounts, and every other non-human user type count as not human. For example, merge requests opened with a project access token or by a GitLab Duo service account count as not human.
  • Merge requests by deleted users, and imported merge requests not yet reassigned to a user, count as not human.
  • Merge requests with no author count as not human.
  • Changes to a user’s type can take up to an hour to apply.

Created at

Description: Filter merge requests by their creation date.

Allowed value types:

  • AbsoluteDate (in the format YYYY-MM-DD)
  • RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted, digit is an integer, and unit is one of d (days), w (weeks), m (months) or y (years))

Notes:

  • For the = operator, the time range is considered from 00:00 to 23:59 in the user’s time zone.

Created by Duo

Description: Filter merge requests by whether a GitLab Duo Agent Platform session created them.

Allowed value types:

  • Boolean (true or false)

Notes:

  • A merge request counts as created by Duo when an Agent Platform session records that it opened the merge request. A merge request that a session was started from, for example to review it, does not count.
  • The author does not affect this filter. Sessions that run in GitLab CI/CD open merge requests as a service account, so to compare against a human baseline, use authorHuman = true only with createdByDuo = false.

Merged at

Description: Filter merge requests by their merge date.

Allowed value types:

  • AbsoluteDate (in the format YYYY-MM-DD)
  • RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted, digit is an integer, and unit is one of d (days), w (weeks), m (months) or y (years))

Notes:

  • For the = operator, the time range is considered from 00:00 to 23:59 in the user’s time zone.

State

Description: Filter merge requests by their state.

Allowed value types:

  • Enum, one of opened, closed, merged, or locked
  • List (use in or not in operator for multiple values)

Notes:

  • The all value is not supported. To include merge requests in all states, omit the filter.

Target branch

Description: Filter merge requests by their target branch.

Allowed value types:

  • String
  • List (use in or not in operator for multiple values)

Dimensions

DimensionNameDescription
Created atcreatedGroup by creation date. Accepts a granularity parameter of daily, weekly, monthly, or a number of days such as 30d (default: weekly), and an optional origin. For example, created(monthly) or created(granularity=30d, origin=2026-07-16).
Created by DuocreatedByDuoGroup by whether a GitLab Duo Agent Platform session created the merge request.
Merged atmergedGroup by merge date. Accepts a granularity parameter of daily, weekly, monthly, or a number of days such as 30d (default: weekly), and an optional origin. For example, merged(monthly) or merged(granularity=30d, origin=2026-07-16).
StatestateGroup by merge request state.
Target branchtargetBranchGroup by target branch.

Metrics

MetricNameDescription
Acceptance rateacceptanceRateShare of merge requests that were merged.
Throughput countthroughputCountNumber of merged merge requests.
Time to merge maxtimeToMergeMaxLongest time from creation to merge, in seconds.
Time to merge meantimeToMergeMeanAverage time from creation to merge, in seconds.
Time to merge mintimeToMergeMinShortest time from creation to merge, in seconds.
Time to merge quantiletimeToMergeQuantileTime from creation to merge, in seconds, rendered as a duration. For example, 1d 2h. Accepts a quantile parameter between 0.01 and 0.99 (default: 0.5, the median). For example, timeToMergeQuantile(0.95).
Time to merge sumtimeToMergeSumTotal time from creation to merge across all merged merge requests, in seconds.
Total counttotalCountTotal number of merge requests.

Sort fields

Sort by any field included in your selected dimensions or metrics. For more information, see analytics mode sorting.

Examples

  • Weekly merge request throughput trend for the last 30 days:

    yaml
    ```glql
    title: "Weekly merge request throughput (last 30 days)"
    display: table
    mode: analytics
    query: type = MergeRequest and project = "gitlab-org/gitlab" and merged > -30d
    dimensions: merged(weekly) as "Week"
    metrics: totalCount as "Total", throughputCount as "Merged", timeToMergeQuantile(0.5) as "Median time to merge"
    sort: merged desc
    ```
  • Median and p95 time to merge by week:

    yaml
    ```glql
    title: "Median and p95 time to merge by week"
    display: table
    mode: analytics
    query: type = MergeRequest and project = "gitlab-org/gitlab" and merged > -90d
    dimensions: merged(weekly) as "Week"
    metrics: timeToMergeQuantile(0.5) as "Median time to merge", timeToMergeQuantile(0.95) as "p95 time to merge"
    sort: merged desc
    ```
  • Merge requests grouped by state:

    yaml
    ```glql
    title: "Merge requests by state (last 30 days)"
    display: table
    mode: analytics
    query: type = MergeRequest and project = "gitlab-org/gitlab" and created > -30d
    dimensions: state as "State"
    metrics: totalCount as "Total"
    sort: totalCount desc
    ```
  • Throughput per target branch across a group:

    yaml
    ```glql
    title: "Merge request throughput by target branch"
    display: table
    mode: analytics
    query: type = MergeRequest and group = "gitlab-org" and merged > -30d
    dimensions: targetBranch as "Target branch"
    metrics: totalCount as "Total", throughputCount as "Merged"
    sort: throughputCount desc
    ```
  • Acceptance rate of merge requests created by GitLab Duo compared to other merge requests:

    yaml
    ```glql
    title: "Merge request acceptance rate by origin (last 30 days)"
    display: table
    mode: analytics
    query: type = MergeRequest and group = "gitlab-org" and created > -30d
    dimensions: createdByDuo as "Created by Duo"
    metrics: totalCount as "Total", throughputCount as "Merged", acceptanceRate as "Acceptance rate"
    sort: totalCount desc
    ```
  • Overall merge request count for a group, without grouping:

    yaml
    ```glql
    title: "Merge requests created in the last 7 days"
    display: table
    mode: analytics
    query: type = MergeRequest and group = "gitlab-org" and created > -7d
    metrics: totalCount as "Total"
    ```