GitLab π
Description π
The Splunk Distribution of OpenTelemetry Collector provides this integration as the gitlab
monitor type by using the Smart Agent Receiver.
GitLab is an open-source web-based git repository manager developed by GitLab Inc. GitLab has built-in features for creating wiki pages, issue-tracking and CI/CD pipelines. GitLab is bundled with Prometheus exporters, which can be configured to export performance metrics of itself and of the bundled software that GitLab depends on. These exporters publish Prometheus metrics at endpoints that are scraped by this monitor type.
This monitor type is available on Kubernetes, Linux, and Windows using GitLab version 9.3 or later.
Benefits π
After you configure the integration, you can access these features:
View metrics. You can create your own custom dashboards, and most monitors provide built-in dashboards as well. For information about dashboards, see View dashboards in Observability Cloud.
View a data-driven visualization of the physical servers, virtual machines, AWS instances, and other resources in your environment that are visible to Infrastructure Monitoring. For information about navigators, see Splunk Infrastructure Monitoring navigators.
Access the Metric Finder and search for metrics sent by the monitor. For information, see Use the Metric Finder.
Installation π
Follow these steps to deploy this integration:
Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform:
Configure the monitor, as described in the Configuration section.
Restart the Splunk Distribution of OpenTelemetry Collector.
Configuration π
GitLab configuration π
Follow the instructions on Monitoring GitLab with Prometheus to configure the GitLab Prometheus exporters to expose metric endpoint targets. For the GitLab Runner monitoring configuration, see GitLab Runner monitoring.
Note that configuring GitLab by editing /etc/gitlab/gitlab.rb
should be
accompanied by running the command gitlab-ctl reconfigure
for
the changes to take effect.
Also, configuring nginx by editing the file
/var/opt/gitlab/nginx/conf/nginx-status.conf
, for instance, should be
accompanied by running command gitlab-ctl restart
. Note that changes to
the configuration file /var/opt/gitlab/nginx/conf/nginx-status.conf
in
particular are erased by subsequent runs of gitlab-ctl reconfigure
because gitlab-ctl reconfigure
restores the original
configuration file.
The following table shows some of the Prometheus endpoint targets with links to
their respective configuration pages. Note that target gitlab_monitor
metrics are just targets gitlab_monitor_database
,
gitlab_monitor_process
and gitlab_monitor_sidekiq
metrics combined.
Monitor type |
Reference |
Standard port |
Standard path |
---|---|---|---|
|
9168 |
/metrics |
|
|
9236 |
/metrics |
|
|
8082 |
/metrics |
|
|
8080 |
/-/metrics |
|
|
9229 |
/metrics |
|
|
8060 |
/metrics |
|
|
9100 |
/metrics |
|
|
9187 |
/metrics |
|
|
9090 |
/metrics |
|
|
9121 |
/metrics |
|
|
9252 |
/metrics |
GitLab Prometheus exporters, nginx, and GitLab Runner must be configured to
accept requests from the host or Docker
container of the OpenTelemetry Collector. For example, the following configuration
in /etc/gitlab/gitlab.rb
configures the GitLab Postgres Prometheus
exporter to allow network connections on port 9187
from any IP address:
postgres_exporter['listen_address'] = '0.0.0.0:9187'
The previous configuration can also be written as follows:
postgres_exporter['listen_address'] = ':9187'
The following excerpt from the file /var/opt/gitlab/nginx/conf/nginx-status.conf
shows the location /metrics
block for metric related configuration. This file configures nginx. The statement allow 172.17.0.0/16;
allows
network connection in the 172.17.0.0/16
IP range. The assumption is that
the IP address associated with the OpenTelemetry Collector is in that IP
range.
server {
...
location /metrics {
...
allow 172.17.0.0/16;
deny all;
}
}
The following line is part of the global section of the file /etc/gitlab-runner/config.toml
. This file configures GitLab Runner. The following statement configures GitLab Runnerβs Prometheus metrics HTTP server to allows network connection on port 9252
from any IP address:
listen_address = "0.0.0.0:9252"
...
GitLab sample configuration π
Use the following configuration to monitor some of the features supported in GitLab:
monitors:
- type: gitlab-unicorn
host: localhost
port: 8080
- type: gitlab
host: localhost
port: 9168
- type: gitlab-runner
host: localhost
port: 9252
- type: gitlab-workhorse
host: localhost
port: 9229
- type: gitlab-sidekiq
host: localhost
port: 8082
- type: gitlab-gitaly
host: localhost
port: 9236
- type: prometheus/postgres
host: localhost
port: 9187
- type: prometheus/nginx-vts
host: localhost
port: 8060
You can use autodiscovery by specifying a discoveryRule
instead of host
and port
.
See GitLab for information on the monitors used in the configuration.
Collector configuration π
To use this Smart Agent monitor with the Collector, include the smartagent
receiver and service pipeline in your configuration file. The Smart Agent receiver is fully supported only on x86_64/amd64 platforms.
Read more in Use Smart Agent monitors with the Collector.
Learn about config options in Collector default configuration.
See the examples below for more details.
receivers:
smartagent/gitlab:
type: gitlab
... # Additional config
To complete the integration, include the Smart Agent receiver using this monitor in a metrics
pipeline. To do this, add the receiver item to the service
/pipelines
/metrics
/receivers
section of your configuration file. For example:
receivers:
smartagent/gitlab-workhorse:
type: gitlab
host: localhost
port: 9229
smartagent/gitlab-sidekiq:
type: gitlab
host: localhost
port: 8082
exporters:
logging:
service:
pipelines:
metrics:
receivers:
- smartagent/gitlab-workhorse
- smartagent/gitlab-sidekiq
exporters:
- logging
See configuration examples for specific use cases that show how the Splunk Distribution of OpenTelemetry Collector can integrate and complement existing environments.
Collector configuration options π
The following table shows the configuration options for this monitor:
Option |
Required |
Type |
Description |
---|---|---|---|
|
no |
|
HTTP timeout duration for both read and writes. This should be a duration string that is accepted by ParseDuration. The default value is |
|
no |
|
Basic Auth username to use on each request, if any. |
|
no |
|
Basic Auth password to use on each request, if any. |
|
no |
|
If |
|
no |
|
A map of HTTP header names to values. Comma-separated multiple values for the same message-header is supported. |
|
no |
|
If |
|
no |
|
Path to the CA cert that has signed the TLS cert, unnecessary if |
|
no |
|
Path to the client TLS cert to use for TLS required connections |
|
no |
|
Path to the client TLS key to use for TLS required connections |
|
yes |
|
Host of the exporter |
|
yes |
|
Port of the exporter |
|
no |
|
Use pod service account to authenticate. The default value is |
|
no |
|
Path to the metrics endpoint on the exporter server, usually |
|
no |
|
Send all the metrics that come out of the Prometheus exporter without any filtering. This option has no effect when using the Prometheus exporter monitor directly since there is no built-in filtering, only when embedding it in other monitors. The default value is |
Metrics π
The following metrics are available for this integration:
Get help π
If you are not able to see your data in Splunk Observability Cloud, try these tips:
Submit a case in the Splunk Support Portal
Available to Splunk Observability Cloud customers
-
Available to Splunk Observability Cloud customers
Ask a question and get answers through community support at Splunk Answers
Available to Splunk Observability Cloud customers and free trial users
Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide
Available to Splunk Observability Cloud customers and free trial users
To learn how to join, see Get Started with Splunk Community - Chat groups
To learn about even more support options, see Splunk Customer Success.