Metadata-Version: 2.1
Name: datadog-gitlab-runner
Version: 2.13.0
Summary: The Gitlab Runner check
Home-page: https://github.com/DataDog/integrations-core
Author: Datadog
Author-email: packages@datadoghq.com
License: BSD
Keywords: datadog agent gitlab_runner check
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Topic :: System :: Monitoring
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Description-Content-Type: text/markdown
Requires-Dist: datadog-checks-base (>=22.0.0)
Provides-Extra: deps
Requires-Dist: protobuf (==3.7.0) ; extra == 'deps'

# Gitlab Runner Integration

## Overview

Integration that allows to:

- Visualize and monitor metrics collected via Gitlab Runners through Prometheus
- Validate that the Gitlab Runner can connect to Gitlab

See the [Gitlab Runner documentation][1] for
more information about Gitlab Runner and its integration with Prometheus

## Setup

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the [Autodiscovery Integration Templates][2] for guidance on applying these instructions.

### Installation

The Gitlab Runner check is included in the [Datadog Agent][3] package, so you don't need to install anything else on your Gitlab servers.

### Configuration

Edit the `gitlab_runner.d/conf.yaml` file, in the `conf.d/` folder at the root of your [Agent's configuration directory][4], to point to the Runner's Prometheus metrics endpoint and to the Gitlab master to have a service check. See the [sample gitlab_runner.d/conf.yaml][5] for all available configuration options.

**Note**: The `allowed_metrics` item in the `init_config` section allows to specify the metrics that should be extracted.

**Remarks**: Some metrics should be reported as `rate` (i.e., `ci_runner_errors`)

### Validation

[Run the Agent's `status` subcommand][6] and look for `gitlab_runner` under the Checks section.

## Data Collected

### Metrics

See [metadata.csv][7] for a list of metrics provided by this integration.

### Log collection


1. In your `gitlab_runner` [configuration file][8], change the log format to `json` (_Available for Gitlab Runner versions >=11.4.0_ ):
   ```toml
   log_format = "json"
   ```

2. Collecting logs is disabled by default in the Datadog Agent, you need to enable it in `datadog.yaml`:

   ```yaml
   logs_enabled: true
   ```

3. Add the `dd-agent` user to the `systemd-journal` group by running:
   ```text
   usermod -a -G systemd-journal dd-agent
   ```

4. Add this configuration block to your `gitlab_runner.d/conf.yaml` file to start collecting your Gitlab Runner Logs:

   ```yaml
   logs:
     - type: journald
       source: gitlab-runner
   ```

    See the [sample gitlab_runner.d/conf.yaml][5] for all available configuration options.

5. [Restart the Agent][9].

### Events

The Gitlab Runner check does not include any events.

### Service Checks

The Gitlab Runner check provides a service check to ensure that the Runner can talk to the Gitlab master and another one to ensure that the
local Prometheus endpoint is available.

## Troubleshooting

Need help? Contact [Datadog support][10].

[1]: https://docs.gitlab.com/runner/monitoring/README.html
[2]: https://docs.datadoghq.com/agent/kubernetes/integrations/
[3]: https://app.datadoghq.com/account/settings#agent
[4]: https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory
[5]: https://github.com/DataDog/integrations-core/blob/master/gitlab_runner/datadog_checks/gitlab_runner/data/conf.yaml.example
[6]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
[7]: https://github.com/DataDog/integrations-core/blob/master/gitlab_runner/metadata.csv
[8]: https://docs.gitlab.com/runner/configuration/advanced-configuration.html
[9]: https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent
[10]: https://docs.datadoghq.com/help/

