GitLab Receiver
Status |
|
Stability |
development: metrics |
Distributions |
[liatrio] |
Issues |
|
[liatrio]:
The GitLab receiver receives data from GitLab. As a
starting point it scrapes metrics from projects but will be extended to
include traces and logs.
The current default set of metrics can be found in
documentation.md.
These metrics can be used as leading indicators (capabilities)
to the DORA metrics; helping provide insight into modern-day
engineering practices.
Getting Started
The collection interval is common to all scrapers and is set to 30 seconds by default.
Note: Generally speaking, if the vendor allows for anonymous API calls, then you
won't have to configure any authentication, but you may only see public repositories
and organizations. You may run into significantly more rate limiting.
gitlab:
initial_delay: <duration>
collection_interval: <duration> #default = 30s recommended 300s
scrapers:
gitlab:
...
A more complete example using the GitLab scrapers with authentication is as follows:
extensions:
bearertokenauth/gitlab:
token: ${env:GL_PAT}
receivers:
gitlab:
initial_delay: 1s
collection_interval: 60s
scrapers:
gitlab:
metrics:
vcs.repository.contributor.count:
enabled: true
gitlab_org: myfancyorg
search_query: "org:myfancyorg topic:o11yalltheway" #Recommended optional query override, defaults to "{org,user}:<gitlab_org>"
endpoint: "https://selfmanagedenterpriseserver.com"
auth:
authenticator: bearertokenauth/gitlab
service:
extensions: [bearertokenauth/gitlab]
pipelines:
metrics:
receivers: [..., gitlab]
processors: []
exporters: [...]
A Grafana Dashboard exists on the marketplace for metrics from this receiver
and can be found
here.
Scraping
Important:
- The GitLab scraper does not emit metrics for refs that have not had
changes since creation from the default ref (trunk).
- Due to GitHub API limitations, it is possible for the ref time metric to
change when rebases occur, recreating the commits with new timestamps.