Prometheus integration

Introduced in GitLab 9.0.

GitLab offers powerful integration with Prometheus for monitoring key metrics of your apps, directly within GitLab. Metrics for each environment are retrieved from Prometheus, and then displayed within the GitLab interface.

Environment Dashboard

There are two ways to set up Prometheus integration, depending on where your apps are running:

Once enabled, GitLab will automatically detect metrics from known services in the metric library. You can also add your own metrics.

Enabling Prometheus Integration

Managed Prometheus on Kubernetes

GitLab 10.5 で導入されました

GitLab can seamlessly deploy and manage Prometheus on a connected Kubernetes cluster, making monitoring of your apps easy.



Once you have a connected Kubernetes cluster, deploying a managed Prometheus is as easy as a single click.

  1. Go to the Operations > Kubernetes page to view your connected clusters
  2. Select the cluster you would like to deploy Prometheus to
  3. Click the Install button to deploy Prometheus to the cluster

Managed Prometheus Deploy

Getting metrics to display on the Metrics Dashboard

After completing the steps above, you will also need deployments in order to view the Operations > Metrics page. Setting up Auto DevOps will help you to quickly create a deployment:

  1. Navigate to your project’s Operations > Kubernetes page, and ensure that, in addition to “Prometheus”, you also have “Runner” and “Ingress” installed. Once “Ingress” is installed, copy its endpoint.
  2. Navigate to your project’s Settings > CI/CD page. In the Auto DevOps section, select a deployment strategy and save your changes.
  3. On the same page, in the Variables section, add a variable named KUBE_INGRESS_BASE_DOMAIN with the value of the Ingress endpoint you have copied in the previous step. Leave the type as “Variable”.
  4. Navigate to your project’s CI/CD > Pipelines page, and run a pipeline on any branch.
  5. When the pipeline has run successfully, graphs will be available on the Operations > Metrics page.

Monitoring Dashboard

About managed Prometheus deployments

Prometheus is deployed into the gitlab-managed-apps namespace, using the official Helm chart. Prometheus is only accessible within the cluster, with GitLab communicating through the Kubernetes API.

The Prometheus server will automatically detect and monitor nodes, pods, and endpoints. To configure a resource to be monitored by Prometheus, simply set the following Kubernetes annotations:

  • to true to enable monitoring of the resource.
  • to define the port of the metrics endpoint.
  • to define the path of the metrics endpoint. Defaults to /metrics.

CPU and Memory consumption is monitored, but requires naming conventions in order to determine the environment. If you are using Auto DevOps, this is handled automatically.

The NGINX Ingress that is deployed by GitLab to clusters, is automatically annotated for monitoring providing key response metrics: latency, throughput, and error rates.

Manual configuration of Prometheus


Integration with Prometheus requires the following:

  1. GitLab 9.0 or higher
  2. Prometheus must be configured to collect one of the supported metrics
  3. Each metric must be have a label to indicate the environment
  4. GitLab must have network connectivity to the Prometheus server


Installing and configuring Prometheus to monitor applications is fairly straightforward.

  1. Install Prometheus
  2. Set up one of the supported monitoring targets
  3. Configure the Prometheus server to collect their metrics

Configuration in GitLab

The actual configuration of Prometheus integration within GitLab is very simple. All you will need is the domain name or IP address of the Prometheus server you’d like to integrate with.

  1. Navigate to the Integrations page.
  2. Click the Prometheus service.
  3. Provide the domain name or IP address of your server, for example or
  4. 変更を保存するをクリックします。

Configure Prometheus Service

Thanos configuration in GitLab

You can configure Thanos as a drop-in replacement for Prometheus with GitLab. You will need the domain name or IP address of the Thanos server you’d like to integrate with.

  1. Navigate to the Integrations page.
  2. Click the Prometheus service.
  3. Provide the domain name or IP address of your server, for example or
  4. 変更を保存するをクリックします。

Precedence with multiple Prometheus configurations

Although you can enable both a manual configuration and auto configuration of Prometheus, only one of them will be used:

Determining the performance impact of a merge

Version history

Developers can view the performance impact of their changes within the merge request workflow.

Note: Requires Kubernetes metrics.

When a source branch has been deployed to an environment, a sparkline and numeric comparison of the average memory consumption will appear. On the sparkline, a dot indicates when the current changes were deployed, with up to 30 minutes of performance data displayed before and after. The comparison shows the difference between the 30 minute average before and after the deployment. This information is updated after each commit has been deployed.

Once merged and the target branch has been redeployed, the metrics will switch to show the new environments this revision has been deployed to.

Performance data will be available for the duration it is persisted on the Prometheus server.

Merge Request with Performance Impact