Commit 3925fdf0 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'rename-self-monitoring-project' into 'master'

Rename Instance Administration project

See merge request gitlab-org/gitlab!23182
parents bfbe80f9 e35d4d5f
......@@ -98,7 +98,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
}
end
if Gitlab::CurrentSettings.instance_administration_project_id.present?
if Gitlab::CurrentSettings.self_monitoring_project_id.present?
return render status: :ok, json: self_monitoring_data
elsif SelfMonitoringProjectCreateWorker.in_progress?(job_id)
......@@ -134,7 +134,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
}
end
if Gitlab::CurrentSettings.instance_administration_project_id.nil?
if Gitlab::CurrentSettings.self_monitoring_project_id.nil?
return render status: :ok, json: {
message: _('Self-monitoring project has been successfully deleted')
}
......@@ -161,8 +161,8 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
def self_monitoring_data
{
project_id: Gitlab::CurrentSettings.instance_administration_project_id,
project_full_path: Gitlab::CurrentSettings.instance_administration_project&.full_path
project_id: Gitlab::CurrentSettings.self_monitoring_project_id,
project_full_path: Gitlab::CurrentSettings.self_monitoring_project&.full_path
}
end
......@@ -171,7 +171,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
status: :not_implemented,
json: {
message: _('Self-monitoring is not enabled on this GitLab server, contact your administrator.'),
documentation_url: help_page_path('administration/monitoring/gitlab_instance_administration_project/index')
documentation_url: help_page_path('administration/monitoring/gitlab_self_monitoring_project/index')
}
)
end
......
......@@ -351,10 +351,10 @@ module ApplicationSettingsHelper
status_delete_self_monitoring_project_admin_application_settings_path,
'self_monitoring_project_exists' =>
Gitlab::CurrentSettings.instance_administration_project.present?.to_s,
Gitlab::CurrentSettings.self_monitoring_project.present?.to_s,
'self_monitoring_project_full_path' =>
Gitlab::CurrentSettings.instance_administration_project&.full_path
Gitlab::CurrentSettings.self_monitoring_project&.full_path
}
end
end
......
......@@ -10,7 +10,9 @@ class ApplicationSetting < ApplicationRecord
add_authentication_token_field :health_check_access_token
add_authentication_token_field :static_objects_external_storage_auth_token
belongs_to :instance_administration_project, class_name: "Project"
belongs_to :self_monitoring_project, class_name: "Project", foreign_key: 'instance_administration_project_id'
alias_attribute :self_monitoring_project_id, :instance_administration_project_id
belongs_to :instance_administrators_group, class_name: "Group"
# Include here so it can override methods from
......
......@@ -102,7 +102,7 @@ class PrometheusService < MonitoringService
private
def self_monitoring_project?
project && project.id == current_settings.instance_administration_project_id
project && project.id == current_settings.self_monitoring_project_id
end
def internal_prometheus_url?
......
---
title: Rename 'GitLab Instance Administration' project to 'GitLab self monitoring' project
merge_request: 23182
author:
type: changed
# GitLab instance administration project
---
redirect_to: '../gitlab_self_monitoring_project/index.md'
---
NOTE: **Note:**
This feature is available behind a feature flag called `self_monitoring_project`
since [12.7](https://gitlab.com/gitlab-org/gitlab/issues/32351). The feature flag
will be removed once we [add dashboards to display metrics](https://gitlab.com/groups/gitlab-org/-/epics/2367).
GitLab has been adding the ability for administrators to see insights into the health of
their GitLab instance. In order to surface this experience in a native way, similar to how
you would interact with an application deployed via GitLab, a base project called
"GitLab Instance Administration" with
[internal visibility](../../../public_access/public_access.md#internal-projects) will be
added under a group called "GitLab Instance Administrators" specifically created for
visualizing and configuring the monitoring of your GitLab instance.
All administrators at the time of creation of the project and group will be added
as maintainers of the group and project, and as an admin, you'll be able to add new
members to the group in order to give them maintainer access to the project.
This project will be used for self-monitoring your GitLab instance.
## Connection to Prometheus
The project will be automatically configured to connect to the
[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).
If that's not the case or if you have an external Prometheus instance or an HA setup,
you should
[configure it manually](../../../user/project/integrations/prometheus.md#manual-configuration-of-prometheus).
## Taking action on Prometheus alerts **(ULTIMATE)**
You can [add a webhook](../../../user/project/integrations/prometheus.md#external-prometheus-instances)
to the Prometheus config in order for GitLab to receive notifications of any alerts.
Once the webhook is setup, you can
[take action on incoming alerts](../../../user/project/integrations/prometheus.md#taking-action-on-incidents-ultimate).
This document was moved to [another location](../gitlab_self_monitoring_project/index.md).
# GitLab self monitoring project
NOTE: **Note:**
This feature is available behind a feature flag called `self_monitoring_project`
since [12.7](https://gitlab.com/gitlab-org/gitlab/issues/32351). The feature flag
will be removed once we [add dashboards to display metrics](https://gitlab.com/groups/gitlab-org/-/epics/2367).
GitLab has been adding the ability for administrators to see insights into the health of
their GitLab instance. In order to surface this experience in a native way, similar to how
you would interact with an application deployed via GitLab, a base project called
"GitLab self monitoring" with
[internal visibility](../../../public_access/public_access.md#internal-projects) will be
added under a group called "GitLab Instance Administrators" specifically created for
visualizing and configuring the monitoring of your GitLab instance.
All administrators at the time of creation of the project and group will be added
as maintainers of the group and project, and as an admin, you'll be able to add new
members to the group in order to give them maintainer access to the project.
This project will be used for self-monitoring your GitLab instance.
## Connection to Prometheus
The project will be automatically configured to connect to the
[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).
If that's not the case or if you have an external Prometheus instance or an HA setup,
you should
[configure it manually](../../../user/project/integrations/prometheus.md#manual-configuration-of-prometheus).
## Taking action on Prometheus alerts **(ULTIMATE)**
You can [add a webhook](../../../user/project/integrations/prometheus.md#external-prometheus-instances)
to the Prometheus config in order for GitLab to receive notifications of any alerts.
Once the webhook is setup, you can
[take action on incoming alerts](../../../user/project/integrations/prometheus.md#taking-action-on-incidents-ultimate).
......@@ -2,7 +2,7 @@
Explore our features to monitor your GitLab instance:
- [GitLab self-monitoring](gitlab_instance_administration_project/index.md): The
- [GitLab self-monitoring](gitlab_self_monitoring_project/index.md): The
GitLab instance administration project helps to monitor the GitLab instance and
take action on alerts.
- [Performance monitoring](performance/index.md): GitLab Performance Monitoring makes it possible to measure a wide variety of statistics of your instance.
......
......@@ -13,11 +13,11 @@ module Gitlab
end
def self_monitoring_project
application_settings.instance_administration_project
application_settings.self_monitoring_project
end
def self_monitoring_project_id
application_settings.instance_administration_project_id
application_settings.self_monitoring_project_id
end
end
end
......
......@@ -9,7 +9,7 @@ module Gitlab
include SelfMonitoring::Helpers
VISIBILITY_LEVEL = Gitlab::VisibilityLevel::INTERNAL
PROJECT_NAME = 'GitLab Instance Administration'
PROJECT_NAME = 'GitLab self monitoring'
steps :validate_application_settings,
:create_group,
......@@ -69,7 +69,7 @@ module Gitlab
return success(result) if project_created?
response = application_settings.update(
instance_administration_project_id: result[:project].id
self_monitoring_project_id: result[:project].id
)
if response
......@@ -115,7 +115,7 @@ module Gitlab
def docs_path
Rails.application.routes.url_helpers.help_page_path(
'administration/monitoring/gitlab_instance_administration_project/index'
'administration/monitoring/gitlab_self_monitoring_project/index'
)
end
......
......@@ -107,7 +107,7 @@ describe ApplicationSettingsHelper do
let(:project) { build(:project) }
before do
stub_application_setting(instance_administration_project: project)
stub_application_setting(self_monitoring_project: project)
end
it 'returns self_monitoring_project_exists true' do
......
......@@ -103,7 +103,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do
end
it 'creates project with correct name and description' do
path = 'administration/monitoring/gitlab_instance_administration_project/index'
path = 'administration/monitoring/gitlab_self_monitoring_project/index'
docs_path = Rails.application.routes.url_helpers.help_page_path(path)
expect(result[:status]).to eq(:success)
......@@ -122,13 +122,13 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do
it 'saves the project id' do
expect(result[:status]).to eq(:success)
expect(application_setting.instance_administration_project_id).to eq(project.id)
expect(application_setting.self_monitoring_project_id).to eq(project.id)
end
it 'returns error when saving project ID fails' do
allow(application_setting).to receive(:update).and_call_original
allow(application_setting).to receive(:update)
.with(instance_administration_project_id: anything)
.with(self_monitoring_project_id: anything)
.and_return(false)
expect(result).to eq(
......@@ -144,7 +144,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do
before do
application_setting.instance_administrators_group_id = existing_group.id
application_setting.instance_administration_project_id = existing_project.id
application_setting.self_monitoring_project_id = existing_project.id
end
it 'returns success' do
......
......@@ -24,7 +24,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService do
let(:application_setting) do
create(
:application_setting,
instance_administration_project_id: project.id,
self_monitoring_project_id: project.id,
instance_administrators_group_id: group.id
)
end
......@@ -38,7 +38,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService do
it 'deletes project ID from application settings' do
subject.execute
expect(application_setting.reload.instance_administration_project_id).to be_nil
expect(application_setting.reload.self_monitoring_project_id).to be_nil
end
it 'does not delete group' do
......
......@@ -70,7 +70,7 @@ describe PrometheusService, :use_clean_rails_memory_store_caching do
before do
service.api_url = 'http://localhost:9090'
stub_application_setting(instance_administration_project_id: project.id)
stub_application_setting(self_monitoring_project_id: project.id)
stub_config(prometheus: { enable: true, listen_address: 'localhost:9090' })
end
......
......@@ -84,8 +84,8 @@ describe 'Self-Monitoring project requests' do
let(:project) { build(:project) }
before do
stub_application_setting(instance_administration_project_id: 1)
stub_application_setting(instance_administration_project: project)
stub_application_setting(self_monitoring_project_id: 1)
stub_application_setting(self_monitoring_project: project)
end
it 'does not need job_id' do
......@@ -169,7 +169,7 @@ describe 'Self-Monitoring project requests' do
.with(job_id)
.and_return(true)
stub_application_setting(instance_administration_project_id: 1)
stub_application_setting(self_monitoring_project_id: 1)
end
it_behaves_like 'sets polling header and returns accepted' do
......@@ -179,7 +179,7 @@ describe 'Self-Monitoring project requests' do
context 'when self-monitoring project exists and job does not exist' do
before do
stub_application_setting(instance_administration_project_id: 1)
stub_application_setting(self_monitoring_project_id: 1)
end
it 'returns bad_request' do
......
......@@ -12,7 +12,7 @@ RSpec.shared_examples 'not accessible if feature flag is disabled' do
expect(response).to have_gitlab_http_status(:not_implemented)
expect(json_response).to eq(
'message' => _('Self-monitoring is not enabled on this GitLab server, contact your administrator.'),
'documentation_url' => help_page_path('administration/monitoring/gitlab_instance_administration_project/index')
'documentation_url' => help_page_path('administration/monitoring/gitlab_self_monitoring_project/index')
)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment