doc/user/glql/data_sources/contributions.md
{{< details >}}
{{< /details >}}
{{< history >}}
granularity parameter introduced in GitLab 19.3.{{< /history >}}
Contributions is a data source that provides aggregated metrics about contribution activity (such as commits, issues, and merge requests) across your projects or groups.
| Scope | Description |
|---|---|
project | Query contributions in a specific project. |
group | Query contributions across all projects in a group, including subgroups. |
| Field | Name | Operators |
|---|---|---|
| Created at | created | =, >, <, >=, <= |
| User | user | =, in |
Description: Filter contributions by date when they were created.
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:
= operator, GLQL considers the time range from 00:00 to 23:59 in the user's time zone.Description: Filter by the user who made the contributions.
Allowed value types:
Number (user ID)List (use in operator for multiple user IDs)[!note] Support for username filtering is being tracked in GLQL issue 143.
| Dimension | Name | Description |
|---|---|---|
| Created at | created | Group by contribution creation date. Accepts a granularity parameter of daily, weekly, or monthly (default: monthly). For example, created(weekly). |
| Metric | Name | Description |
|---|---|---|
| Total count | totalCount | Total number of contributions. |
| Users count | usersCount | Number of unique contributors. |
Sort by any field included in your selected dimensions or metrics. For more information, see analytics mode sorting.
Monthly contribution trend for a project:
```glql
title: "Monthly contributions"
display: table
mode: analytics
query: type = Contribution and project = "gitlab-org/gitlab"
dimensions: created as "Month"
metrics: totalCount as "Total", usersCount as "Contributors"
sort: created desc
```
Contribution trend for a set of users:
```glql
title: "Contributions from a set of users"
display: table
mode: analytics
query: type = Contribution and project = "gitlab-org/gitlab" and user in (1234567, 2345678) and created >= -90d
dimensions: created as "Month"
metrics: totalCount as "Total"
sort: created desc
```
A specific user's contributions over the last year, by month:
```glql
title: "User contribution history"
display: table
mode: analytics
query: type = Contribution and group = "gitlab-org" and user = 1234567 and created >= -365d
dimensions: created as "Month"
metrics: totalCount as "Total"
sort: created asc
```
Overall contribution metrics for a group, without grouping:
```glql
title: "Overall contribution metrics"
display: table
mode: analytics
query: type = Contribution and group = "gitlab-org" and created >= -90d
metrics: totalCount as "Total", usersCount as "Contributors"
```