Skip to main content
Version: v2 (current)

GitLab Integration

PanDev Metrics integration with GitLab allows you to analyze development activity, merge requests, and automatically add quality metrics to code reviews.

Integration Features

  • Automatic MR Comments — adding code quality metrics to merge requests
  • Repository Analytics — analysis of commits, branches, and contributors
  • Code Review Metrics — review time, number of comments, MR cycle time
  • Privacy — data is collected only from your projects

Supported Versions

  • GitLab.com (SaaS)
  • GitLab Self-Managed (On-Premise)

Integration Setup

Step 1: Create a Service Account

Create a separate GitLab account that will be used to collect analytics and generate reports.

Why use a service account?

A separate account allows you to distinguish automatic comments from personal ones and simplifies access management.

Step 2: Grant Access

Add the service account to GitLab groups/projects with the Maintainer or Owner role.

Step 3: Create a Token

  1. Log in to the service account
  2. Go to User Settings → Access Tokens
  3. Click Add new token
  4. Configure the token:
ParameterValue
Token namepandev-metrics
Expiration date90 days (or no expiration for Self-Managed)
  1. Select access rights (scopes):
ScopeDescription
apiFull API access
read_repositoryRead repositories
write_repositoryWrite to repositories (for comments)
  1. Click Create personal access token and save the token

Step 4: Connect in PanDev Metrics

  1. Go to Settings → Integrations → GitLab
  2. Specify GitLab URL:
    • For GitLab.com: https://gitlab.com
    • For Self-Managed: Your server URL (e.g., https://gitlab.company.local)
  3. Paste the copied token
  4. Click Check Connection
  5. After successful verification, click Activate

Step 5: Select Projects

  1. Select groups or projects to monitor
  2. Configure branch filters (optional)
  3. Save settings

Tracked Metrics

  • Commits — number and frequency of commits by developers
  • Merge Requests — MR cycle time, time to merge, number of revisions
  • Code Review — review time, number of comments
  • Activity — activity trends by projects and contributors

FAQ

Does integration work with GitLab Self-Managed? Yes, both GitLab.com and Self-Managed versions are supported.

What permissions are sufficient for basic analytics? For analytics without comments, api and read_repository scopes are sufficient.

How often is data updated? Data is updated in real-time via GitLab webhooks.