Prometheus exporter for GitLab metrics providing deep Activity into project statistics, contributor activities, and repository analytics.
- Project statistics collection (commits, storage, artifacts)
- Contributor activity tracking
- Multi-group support
- Rate-limited API requests
- Pattern-based filtering
- Prometheus metrics endpoint
- Multi-platform support
Metric Name | Type | Description | Labels | Unit |
---|---|---|---|---|
gitlab_project_commits_total |
Gauge | Total number of commits | project |
Count |
gitlab_project_storage_bytes |
Gauge | Total storage size | project |
Bytes |
gitlab_project_repository_bytes |
Gauge | Repository size | project |
Bytes |
gitlab_project_artifacts_bytes |
Gauge | CI/CD artifacts size | project |
Bytes |
gitlab_project_packages_bytes |
Gauge | Package registry size | project |
Bytes |
Metric Name | Type | Description | Labels | Unit |
---|---|---|---|---|
gitlab_contributor_commits_total |
Gauge | Number of commits by contributor | project , email |
Count |
Configuration file format:
gitlab:
api_url: "https://gitlab.company.com/api/v4"
token: "glpat-xxxxxxxxxxxxxxxxxxxx"
max_concurrent_requests: 20
timeout: 45s
projects:
groups:
- path: "production"
recursive: true
- path: "development"
recursive: false
refresh_interval: 30m
filters:
projects:
include_patterns:
- "^production/.+"
exclude_patterns:
- ".+[-_]archive$"
contributors_email:
include_patterns:
- "@company\\.com$"
exclude_patterns:
- "bot@.+"
exporter:
host: "0.0.0.0"
port: 9199
metrics_path: "/metrics"
collection_interval: 1m
log_level: "info"
Download from releases page:
wget https://github.com/your-repo/gitlab-аctivity-exporter/releases/latest/download/gitlab-аctivity-exporter-linux-amd64
chmod +x gitlab-аctivity-exporter-linux-amd64
Requirements:
- Go 1.21+
- Docker (for multi-platform builds)
git clone https://github.com/your-repo/gitlab-аctivity-exporter.git
cd gitlab-аctivity-exporter
./build.sh
- Create configuration file
- Execute:
./gitlab-аctivity-exporter -c config.yml
Metrics endpoint: http://localhost:9199/metrics
-c, --config
: Configuration file path (default: "config.yml")-v, --version
: Version information-h, --help
: Help message
scrape_configs:
- job_name: 'gitlab_аctivity'
static_configs:
- targets: ['localhost:9199']
/
├── cmd/ # Application entry
├── internal/
│ ├── collector/ # Metric collectors
│ ├── config/ # Configuration
│ ├── gitlab/ # GitLab client
│ ├── metrics/ # Prometheus metrics
│ ├── project/ # Project management
│ └── filter/ # Pattern matching