Integration that allows to:
- Visualize and monitor metrics collected with GitLab and Gitaly through Prometheus
See Monitoring GitLab with Prometheus for more information.
For more in-depth monitoring of your GitLab pipelines, check out CI Pipeline Visibility. CI Pipeline Visibility provides granular insights into your user workflow, lets you access detailed Git metadata, and tracks pipeline performance over time.
This OpenMetrics-based integration has a latest mode (enabled by setting openmetrics_endpoint
to point to the target endpoint) and a legacy mode (enabled by setting prometheus_url
instead). To get all the most up-to-date features, Datadog recommends enabling the latest mode. For more information, see Latest and Legacy Versioning For OpenMetrics-based Integrations.
Metrics marked as [OpenMetricsV1]
or [OpenMetricsV2]
are only available using the corresponding mode of the GitLab integration. All other metrics are collected by both modes.
The GitLab check is included in the Datadog Agent package, so you don't need to install anything else on your GitLab servers.
To configure this check for an Agent running on a host:
-
Edit the
gitlab.d/conf.yaml
file, in theconf.d/
folder at the root of your Agent's configuration directory, to point to the GitLab's metrics endpoint. See the sample gitlab.d/conf.yaml for all available configuration options. If you previously implemented this integration, see the legacy example. -
In the GitLab settings page, ensure that the option
Enable Prometheus Metrics
is enabled (administrator access is required). For more information on how to enable metric collection, see GitLab Prometheus metrics. -
Allow access to monitoring endpoints by updating your
/etc/gitlab/gitlab.rb
to include the following line:gitlab_rails['monitoring_whitelist'] = ['127.0.0.0/8', '192.168.0.1']
Note Save and restart GitLab to see the changes.
-
Collecting logs is disabled by default in the Datadog Agent, enable it in your
datadog.yaml
file:logs_enabled: true
-
Next, edit
gitlab.d/conf.yaml
by uncommenting thelogs
lines at the bottom. Update the logspath
with the correct path to your GitLab log files.logs: - type: file path: /var/log/gitlab/gitlab-rails/production_json.log service: '<SERVICE_NAME>' source: gitlab - type: file path: /var/log/gitlab/gitlab-rails/production.log service: '<SERVICE_NAME>' source: gitlab - type: file path: /var/log/gitlab/gitlab-rails/api_json.log service: '<SERVICE_NAME>' source: gitlab
For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.
Parameter | Value |
---|---|
<INTEGRATION_NAME> |
gitlab |
<INIT_CONFIG> |
blank or {} |
<INSTANCE_CONFIG> |
{"gitlab_url":"http://%%host%%/", "openmetrics_endpoint":"http://%%host%%:10055/-/metrics"} |
Collecting logs is disabled by default in the Datadog Agent. To enable it, see Kubernetes Log Collection.
Parameter | Value |
---|---|
<LOG_CONFIG> |
{"source": "gitlab", "service": "gitlab"} |
Run the Agent's status subcommand and look for gitlab
under the Checks section.
See metadata.csv for a list of metrics provided by this integration.
The GitLab check does not include any events.
See service_checks.json for a list of service checks provided by this integration. More information about the gitlab.readiness.*
service checks can be found in the official GitLab documentation.
Need help? Contact Datadog support.