debian-mirror-gitlab/doc/administration/monitoring/gitlab_self_monitoring_project/index.md

121 lines
5.7 KiB
Markdown
Raw Normal View History

2020-06-23 00:09:42 +05:30
---
stage: Monitor
2021-04-29 21:17:54 +05:30
group: Monitor
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-06-23 00:09:42 +05:30
---
2021-03-11 19:13:27 +05:30
# GitLab self monitoring project **(FREE SELF)**
2020-03-13 15:44:24 +05:30
2020-06-23 00:09:42 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32351) in GitLab 12.7, behind a disabled feature flag (`self_monitoring_project`).
> - The feature flag was removed and the Self Monitoring Project was [made generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/198511) in GitLab 12.8.
2020-03-13 15:44:24 +05:30
2021-01-03 14:25:43 +05:30
GitLab has been adding the ability for administrators to see insights into the
health of their GitLab instance. To surface this experience in a native way
(similar to how you would interact with an application deployed using GitLab),
a base project called "GitLab self monitoring" with
[internal visibility](../../../public_access/public_access.md#internal-projects)
2021-02-22 17:27:13 +05:30
is added under a group called "GitLab Instance Administrators"
2021-01-03 14:25:43 +05:30
specifically created for visualizing and configuring the monitoring of your
GitLab instance.
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
All administrators at the time of creation of the project and group are
2021-03-11 19:13:27 +05:30
added as maintainers of the group and project, and as an administrator, you can
2021-09-04 01:27:46 +05:30
add new members to the group to give them the [Maintainer role](../../../user/permissions.md) for
the project.
2020-03-13 15:44:24 +05:30
2020-06-23 00:09:42 +05:30
This project is used to self monitor your GitLab instance. The metrics dashboard
of the project shows some basic resource usage charts, such as CPU and memory usage
of each server in [Omnibus GitLab](https://docs.gitlab.com/omnibus/) installations.
You can also use the project to configure your own
2020-07-28 23:09:34 +05:30
[custom metrics](../../../operations/metrics/index.md#adding-custom-metrics) using
2020-05-24 23:13:21 +05:30
metrics exposed by the [GitLab exporter](../prometheus/gitlab_metrics.md#metrics-available).
2020-03-13 15:44:24 +05:30
2020-04-08 14:13:33 +05:30
## Creating the self monitoring project
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
1. On the top bar, select **Menu >** **{admin}** **Admin**.
1. On the left sidebar, select **Settings > Metrics and profiling** and expand **Self monitoring**.
2020-03-13 15:44:24 +05:30
1. Toggle the **Create Project** button on.
2021-09-04 01:27:46 +05:30
1. After your GitLab instance creates the project, GitLab displays a link to the
project in the text above the **Create Project** toggle. You can also find it
from the top bar by selecting **Menu > Project**, then selecting **Your projects**.
2020-03-13 15:44:24 +05:30
2020-04-08 14:13:33 +05:30
## Deleting the self monitoring project
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
WARNING:
Deleting the self monitoring project removes any changes made to the project. If
you create the project again, it's created in its default state.
2020-03-13 15:44:24 +05:30
2021-09-04 01:27:46 +05:30
1. On the top bar, select **Menu >** **{admin}** **Admin**.
1. On the left sidebar, go to **Settings > Metrics and profiling** and expand **Self monitoring**.
2020-03-13 15:44:24 +05:30
1. Toggle the **Create Project** button off.
1. In the confirmation dialog that opens, click **Delete project**.
It can take a few seconds for it to be deleted.
1. After the project is deleted, GitLab displays a message confirming your action.
2020-07-28 23:09:34 +05:30
## Dashboards available in Omnibus GitLab
Omnibus GitLab provides a dashboard that displays CPU and memory usage
of each GitLab server. To select the servers to be displayed in the
panels, provide a regular expression in the **Instance label regex** field.
The dashboard uses metrics available in
[Omnibus GitLab](https://docs.gitlab.com/omnibus/) installations.
2020-10-24 23:57:45 +05:30
![GitLab self monitoring overview dashboard](img/self_monitoring_overview_dashboard.png)
2020-07-28 23:09:34 +05:30
You can also
2020-10-24 23:57:45 +05:30
[create your own dashboards](../../../operations/metrics/dashboards/index.md).
2020-07-28 23:09:34 +05:30
2020-03-13 15:44:24 +05:30
## Connection to Prometheus
2021-02-22 17:27:13 +05:30
The project is automatically configured to connect to the
2020-03-13 15:44:24 +05:30
[internal Prometheus](../prometheus/index.md) instance if the Prometheus
instance is present (should be the case if GitLab was installed via Omnibus
and you haven't disabled it).
2020-05-24 23:13:21 +05:30
If that's not the case or if you have an external Prometheus instance or a customized setup,
2020-03-13 15:44:24 +05:30
you should
[configure it manually](../../../user/project/integrations/prometheus.md#manual-configuration-of-prometheus).
## Taking action on Prometheus alerts **(ULTIMATE)**
2020-07-28 23:09:34 +05:30
You can [add a webhook](../../../operations/metrics/alerts.md#external-prometheus-instances)
2021-01-03 14:25:43 +05:30
to the Prometheus configuration for GitLab to receive notifications of any
alerts.
2020-03-13 15:44:24 +05:30
Once the webhook is setup, you can
2020-11-24 15:15:51 +05:30
[take action on incoming alerts](../../../operations/metrics/alerts.md#trigger-actions-from-alerts).
2020-03-13 15:44:24 +05:30
## Adding custom metrics to the self monitoring project
You can add custom metrics in the self monitoring project by:
2020-10-24 23:57:45 +05:30
1. [Duplicating](../../../operations/metrics/dashboards/index.md#duplicate-a-gitlab-defined-dashboard) the overview dashboard.
1. [Editing](../../../operations/metrics/index.md) the newly created dashboard file and configuring it with [dashboard YAML properties](../../../operations/metrics/dashboards/yaml.md).
2020-04-08 14:13:33 +05:30
## Troubleshooting
2021-04-29 21:17:54 +05:30
### Getting error message in logs: `Could not create instance administrators group. Errors: ["You don't have permission to create groups."]`
2020-04-08 14:13:33 +05:30
2020-06-23 00:09:42 +05:30
There is [a bug](https://gitlab.com/gitlab-org/gitlab/-/issues/208676) which causes
2020-04-08 14:13:33 +05:30
project creation to fail with the following error (which appears in the log file)
2021-03-11 19:13:27 +05:30
when the first administrator user is an
2020-11-24 15:15:51 +05:30
[external user](../../../user/permissions.md#external-users):
2020-04-08 14:13:33 +05:30
2020-05-24 23:13:21 +05:30
```plaintext
2021-04-29 21:17:54 +05:30
Could not create instance administrators group. Errors: ["You don't have permission to create groups."]
2020-04-08 14:13:33 +05:30
```
2021-03-11 19:13:27 +05:30
Run the following in a Rails console to check if the first administrator user is an external user:
2020-04-08 14:13:33 +05:30
```ruby
User.admins.active.first.external?
```
2021-03-11 19:13:27 +05:30
If this returns true, the first administrator user is an external user.
2020-04-08 14:13:33 +05:30
If you face this issue, you can temporarily
2021-03-11 19:13:27 +05:30
[make the administrator user a non-external user](../../../user/permissions.md#external-users)
2020-04-08 14:13:33 +05:30
and then try to create the project.
2021-03-11 19:13:27 +05:30
Once the project is created, the administrator user can be changed back to an external user.