- Populate your metrics dashboard
- Customize your metrics dashboard
- Metrics dashboard visibility
- Adding custom metrics
- Editing additional metrics from the dashboard
- Keyboard shortcuts for charts
GitLab scans the Prometheus server for metrics from known servers like Kubernetes and NGINX, and attempts to identify individual environments. To learn more about the supported metrics and scan processes, see the Prometheus Metrics Library documentation.
To view the metrics dashboard for an environment that has completed at least one deployment:
- If the metrics dashboard is only visible to project members, sign in to GitLab as a member of a project. Learn more about metrics dashboard visibility.
- In your project, navigate to Operations > Metrics.
GitLab displays the default metrics dashboard for the environment, like the following example:
The top of the dashboard contains a navigation bar. From left to right, the navigation bar contains:
- Dashboard - A dropdown list of all dashboards available for the project, with starred dashboards listed first.
- Environment - A dropdown list of all environments that searches through all environments as you type.
- Range - The time period of data to display.
- Refresh dashboard - Reload the dashboard with current data.
- Set refresh rate - Set a time frame for refreshing the data displayed.
- Star dashboard - Click to mark a dashboard as a favorite. Starred dashboards display a solid star button, and display first in the Dashboard dropdown list. (Introduced in GitLab 13.0.)
- Edit dashboard - Edit the source YAML file of a custom dashboard. Only available on custom dashboards. (Introduced in GitLab 12.5.)
- Create dashboard - Create a new custom dashboard for your project.
- Metrics settings - Configure the settings for this dashboard.
- Navigate to your project’s Operations > Kubernetes page.
- Ensure that, in addition to Prometheus, you also have Runner and Ingress installed.
- After installing Ingress, copy its endpoint.
- Navigate to your project’s Settings > CI/CD page. In the Auto DevOps section, select a deployment strategy and save your changes.
- On the same page, in the Variables section, add a variable named
KUBE_INGRESS_BASE_DOMAINwith the value of the Ingress endpoint you copied previously. Leave the type as Variable.
- Navigate to your project’s CI/CD > Pipelines page, and run a pipeline on any branch.
- When the pipeline has run successfully, graphs are available on the Operations > Metrics page.
After creating your dashboard, you can customize it to meet your needs:
- Add custom metrics: In addition to the GitLab default metrics, you can create custom metrics and display them on your metrics dashboard.
- Configure alerts for metrics: Configure custom alerts for your team when environment performance falls outside of the boundaries you set.
- Trigger actions from alerts: Open new issues for your team when environment performance falls outside of the boundaries you set.
Introduced in GitLab 13.0.
You can set the visibility of the metrics dashboard to Only Project Members or Everyone With Access. When set to Everyone with Access, the metrics dashboard is visible to authenticated and non-authenticated users.
Custom metrics can be monitored by adding them on the monitoring dashboard page. After saving them, they display on the environment metrics dashboard provided that either:
- A connected Kubernetes cluster with the matching environment scope is used and Prometheus installed on the cluster.
- Prometheus is manually configured.
A few fields are required:
- Name: Chart title
- Type: Type of metric. Metrics of the same type will be shown together.
- Query: Valid PromQL query.
- Y-axis label: Y axis title to display on the dashboard.
Unit label: Query units, for example
req / sec. Shown next to the value.
Multiple metrics can be displayed on the same chart if the fields Name, Type,
and Y-axis label match between metrics. For example, a metric with Name
Requests Rate, Type
Business, and Y-axis label
rec / sec would display
on the same chart as a second metric with the same values. A Legend label is
suggested if this feature is used.
Introduced in GitLab 12.9.
You can edit existing additional custom metrics for your dashboard by clicking the More actions dropdown and selecting Edit metric.
Introduced in GitLab 13.2.
You can use keyboard shortcuts to interact more quickly with your currently-focused chart panel. To activate keyboard shortcuts, use keyboard tabs to highlight the More actions dropdown menu, or hover over the dropdown menu with your mouse, then press the key corresponding to your desired action:
- Expand panel - e
- View logs - l (lowercase ‘L’)
- Download CSV - d
- Copy link to chart - c
- Alerts - a