Commit e35d4d5f authored by Reuben Pereira's avatar Reuben Pereira Committed by Achilleas Pipinellis

Rename Instance Administration project

Rename the Instance Administration Project to self monitoring project.
parent bfbe80f9
...@@ -98,7 +98,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -98,7 +98,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
} }
end 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 return render status: :ok, json: self_monitoring_data
elsif SelfMonitoringProjectCreateWorker.in_progress?(job_id) elsif SelfMonitoringProjectCreateWorker.in_progress?(job_id)
...@@ -134,7 +134,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -134,7 +134,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
} }
end end
if Gitlab::CurrentSettings.instance_administration_project_id.nil? if Gitlab::CurrentSettings.self_monitoring_project_id.nil?
return render status: :ok, json: { return render status: :ok, json: {
message: _('Self-monitoring project has been successfully deleted') message: _('Self-monitoring project has been successfully deleted')
} }
...@@ -161,8 +161,8 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -161,8 +161,8 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
def self_monitoring_data def self_monitoring_data
{ {
project_id: Gitlab::CurrentSettings.instance_administration_project_id, project_id: Gitlab::CurrentSettings.self_monitoring_project_id,
project_full_path: Gitlab::CurrentSettings.instance_administration_project&.full_path project_full_path: Gitlab::CurrentSettings.self_monitoring_project&.full_path
} }
end end
...@@ -171,7 +171,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -171,7 +171,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
status: :not_implemented, status: :not_implemented,
json: { json: {
message: _('Self-monitoring is not enabled on this GitLab server, contact your administrator.'), 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
......
...@@ -351,10 +351,10 @@ module ApplicationSettingsHelper ...@@ -351,10 +351,10 @@ module ApplicationSettingsHelper
status_delete_self_monitoring_project_admin_application_settings_path, status_delete_self_monitoring_project_admin_application_settings_path,
'self_monitoring_project_exists' => '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' => 'self_monitoring_project_full_path' =>
Gitlab::CurrentSettings.instance_administration_project&.full_path Gitlab::CurrentSettings.self_monitoring_project&.full_path
} }
end end
end end
......
...@@ -10,7 +10,9 @@ class ApplicationSetting < ApplicationRecord ...@@ -10,7 +10,9 @@ class ApplicationSetting < ApplicationRecord
add_authentication_token_field :health_check_access_token add_authentication_token_field :health_check_access_token
add_authentication_token_field :static_objects_external_storage_auth_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" belongs_to :instance_administrators_group, class_name: "Group"
# Include here so it can override methods from # Include here so it can override methods from
......
...@@ -102,7 +102,7 @@ class PrometheusService < MonitoringService ...@@ -102,7 +102,7 @@ class PrometheusService < MonitoringService
private private
def self_monitoring_project? def self_monitoring_project?
project && project.id == current_settings.instance_administration_project_id project && project.id == current_settings.self_monitoring_project_id
end end
def internal_prometheus_url? 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 document was moved to [another location](../gitlab_self_monitoring_project/index.md).
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).
# 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 @@ ...@@ -2,7 +2,7 @@
Explore our features to monitor your GitLab instance: 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 GitLab instance administration project helps to monitor the GitLab instance and
take action on alerts. 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. - [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 ...@@ -13,11 +13,11 @@ module Gitlab
end end
def self_monitoring_project def self_monitoring_project
application_settings.instance_administration_project application_settings.self_monitoring_project
end end
def self_monitoring_project_id def self_monitoring_project_id
application_settings.instance_administration_project_id application_settings.self_monitoring_project_id
end end
end end
end end
......
...@@ -9,7 +9,7 @@ module Gitlab ...@@ -9,7 +9,7 @@ module Gitlab
include SelfMonitoring::Helpers include SelfMonitoring::Helpers
VISIBILITY_LEVEL = Gitlab::VisibilityLevel::INTERNAL VISIBILITY_LEVEL = Gitlab::VisibilityLevel::INTERNAL
PROJECT_NAME = 'GitLab Instance Administration' PROJECT_NAME = 'GitLab self monitoring'
steps :validate_application_settings, steps :validate_application_settings,
:create_group, :create_group,
...@@ -69,7 +69,7 @@ module Gitlab ...@@ -69,7 +69,7 @@ module Gitlab
return success(result) if project_created? return success(result) if project_created?
response = application_settings.update( response = application_settings.update(
instance_administration_project_id: result[:project].id self_monitoring_project_id: result[:project].id
) )
if response if response
...@@ -115,7 +115,7 @@ module Gitlab ...@@ -115,7 +115,7 @@ module Gitlab
def docs_path def docs_path
Rails.application.routes.url_helpers.help_page_path( Rails.application.routes.url_helpers.help_page_path(
'administration/monitoring/gitlab_instance_administration_project/index' 'administration/monitoring/gitlab_self_monitoring_project/index'
) )
end end
......
...@@ -107,7 +107,7 @@ describe ApplicationSettingsHelper do ...@@ -107,7 +107,7 @@ describe ApplicationSettingsHelper do
let(:project) { build(:project) } let(:project) { build(:project) }
before do before do
stub_application_setting(instance_administration_project: project) stub_application_setting(self_monitoring_project: project)
end end
it 'returns self_monitoring_project_exists true' do it 'returns self_monitoring_project_exists true' do
......
...@@ -103,7 +103,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do ...@@ -103,7 +103,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do
end end
it 'creates project with correct name and description' do 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) docs_path = Rails.application.routes.url_helpers.help_page_path(path)
expect(result[:status]).to eq(:success) expect(result[:status]).to eq(:success)
...@@ -122,13 +122,13 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do ...@@ -122,13 +122,13 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do
it 'saves the project id' do it 'saves the project id' do
expect(result[:status]).to eq(:success) 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 end
it 'returns error when saving project ID fails' do it 'returns error when saving project ID fails' do
allow(application_setting).to receive(:update).and_call_original allow(application_setting).to receive(:update).and_call_original
allow(application_setting).to receive(:update) allow(application_setting).to receive(:update)
.with(instance_administration_project_id: anything) .with(self_monitoring_project_id: anything)
.and_return(false) .and_return(false)
expect(result).to eq( expect(result).to eq(
...@@ -144,7 +144,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do ...@@ -144,7 +144,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do
before do before do
application_setting.instance_administrators_group_id = existing_group.id 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 end
it 'returns success' do it 'returns success' do
......
...@@ -24,7 +24,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService do ...@@ -24,7 +24,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService do
let(:application_setting) do let(:application_setting) do
create( create(
:application_setting, :application_setting,
instance_administration_project_id: project.id, self_monitoring_project_id: project.id,
instance_administrators_group_id: group.id instance_administrators_group_id: group.id
) )
end end
...@@ -38,7 +38,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService do ...@@ -38,7 +38,7 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService do
it 'deletes project ID from application settings' do it 'deletes project ID from application settings' do
subject.execute 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 end
it 'does not delete group' do it 'does not delete group' do
......
...@@ -70,7 +70,7 @@ describe PrometheusService, :use_clean_rails_memory_store_caching do ...@@ -70,7 +70,7 @@ describe PrometheusService, :use_clean_rails_memory_store_caching do
before do before do
service.api_url = 'http://localhost:9090' 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' }) stub_config(prometheus: { enable: true, listen_address: 'localhost:9090' })
end end
......
...@@ -84,8 +84,8 @@ describe 'Self-Monitoring project requests' do ...@@ -84,8 +84,8 @@ describe 'Self-Monitoring project requests' do
let(:project) { build(:project) } let(:project) { build(:project) }
before do before do
stub_application_setting(instance_administration_project_id: 1) stub_application_setting(self_monitoring_project_id: 1)
stub_application_setting(instance_administration_project: project) stub_application_setting(self_monitoring_project: project)
end end
it 'does not need job_id' do it 'does not need job_id' do
...@@ -169,7 +169,7 @@ describe 'Self-Monitoring project requests' do ...@@ -169,7 +169,7 @@ describe 'Self-Monitoring project requests' do
.with(job_id) .with(job_id)
.and_return(true) .and_return(true)
stub_application_setting(instance_administration_project_id: 1) stub_application_setting(self_monitoring_project_id: 1)
end end
it_behaves_like 'sets polling header and returns accepted' do it_behaves_like 'sets polling header and returns accepted' do
...@@ -179,7 +179,7 @@ describe 'Self-Monitoring project requests' do ...@@ -179,7 +179,7 @@ describe 'Self-Monitoring project requests' do
context 'when self-monitoring project exists and job does not exist' do context 'when self-monitoring project exists and job does not exist' do
before do before do
stub_application_setting(instance_administration_project_id: 1) stub_application_setting(self_monitoring_project_id: 1)
end end
it 'returns bad_request' do it 'returns bad_request' do
......
...@@ -12,7 +12,7 @@ RSpec.shared_examples 'not accessible if feature flag is disabled' 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(response).to have_gitlab_http_status(:not_implemented)
expect(json_response).to eq( expect(json_response).to eq(
'message' => _('Self-monitoring is not enabled on this GitLab server, contact your administrator.'), '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
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