Commit ef9f23b7 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Mark migration as requiring no downtime

+ Add spaces for four phases approach
+ fix InfluxDB rename
parent 254830c1
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
%fieldset %fieldset
%legend Metrics - Influx %legend Metrics - Influx
%p %p
Setup Influx to measure a wide variety of statistics like the time spent Setup InfluxDB to measure a wide variety of statistics like the time spent
in running SQL queries. These settings require a in running SQL queries. These settings require a
= link_to 'restart', help_page_path('administration/restart_gitlab') = link_to 'restart', help_page_path('administration/restart_gitlab')
to take effect. to take effect.
......
...@@ -14,6 +14,7 @@ if defined?(Unicorn) ...@@ -14,6 +14,7 @@ if defined?(Unicorn)
use Unicorn::WorkerKiller::Oom, min, max use Unicorn::WorkerKiller::Oom, min, max
end end
end end
# set default directory for multiproces metrics gathering # set default directory for multiproces metrics gathering
ENV['prometheus_multiproc_dir'] ||= 'tmp/prometheus_data_dir' ENV['prometheus_multiproc_dir'] ||= 'tmp/prometheus_data_dir'
......
...@@ -2,6 +2,8 @@ class AddPrometheusSettingsToMetricsSettings < ActiveRecord::Migration ...@@ -2,6 +2,8 @@ class AddPrometheusSettingsToMetricsSettings < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
disable_ddl_transaction! disable_ddl_transaction!
DOWNTIME = false
def up def up
add_column_with_default(:application_settings, :prometheus_metrics_enabled, :boolean, add_column_with_default(:application_settings, :prometheus_metrics_enabled, :boolean,
default: false, allow_null: false) default: false, allow_null: false)
......
...@@ -27,6 +27,7 @@ describe MetricsController do ...@@ -27,6 +27,7 @@ describe MetricsController do
it 'returns DB ping metrics' do it 'returns DB ping metrics' do
get :metrics get :metrics
expect(response.body).to match(/^db_ping_timeout 0$/) expect(response.body).to match(/^db_ping_timeout 0$/)
expect(response.body).to match(/^db_ping_success 1$/) expect(response.body).to match(/^db_ping_success 1$/)
expect(response.body).to match(/^db_ping_latency [0-9\.]+$/) expect(response.body).to match(/^db_ping_latency [0-9\.]+$/)
...@@ -34,6 +35,7 @@ describe MetricsController do ...@@ -34,6 +35,7 @@ describe MetricsController do
it 'returns Redis ping metrics' do it 'returns Redis ping metrics' do
get :metrics get :metrics
expect(response.body).to match(/^redis_ping_timeout 0$/) expect(response.body).to match(/^redis_ping_timeout 0$/)
expect(response.body).to match(/^redis_ping_success 1$/) expect(response.body).to match(/^redis_ping_success 1$/)
expect(response.body).to match(/^redis_ping_latency [0-9\.]+$/) expect(response.body).to match(/^redis_ping_latency [0-9\.]+$/)
...@@ -41,6 +43,7 @@ describe MetricsController do ...@@ -41,6 +43,7 @@ describe MetricsController do
it 'returns file system check metrics' do it 'returns file system check metrics' do
get :metrics get :metrics
expect(response.body).to match(/^filesystem_access_latency{shard="default"} [0-9\.]+$/) expect(response.body).to match(/^filesystem_access_latency{shard="default"} [0-9\.]+$/)
expect(response.body).to match(/^filesystem_accessible{shard="default"} 1$/) expect(response.body).to match(/^filesystem_accessible{shard="default"} 1$/)
expect(response.body).to match(/^filesystem_write_latency{shard="default"} [0-9\.]+$/) expect(response.body).to match(/^filesystem_write_latency{shard="default"} [0-9\.]+$/)
...@@ -56,6 +59,7 @@ describe MetricsController do ...@@ -56,6 +59,7 @@ describe MetricsController do
it 'returns proper response' do it 'returns proper response' do
get :metrics get :metrics
expect(response.status).to eq(404) expect(response.status).to eq(404)
end end
end end
...@@ -64,6 +68,7 @@ describe MetricsController do ...@@ -64,6 +68,7 @@ describe MetricsController do
context 'without authorization token' do context 'without authorization token' do
it 'returns proper response' do it 'returns proper response' do
get :metrics get :metrics
expect(response.status).to eq(404) expect(response.status).to eq(404)
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