diff options
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/1_settings.rb | 6 | ||||
-rw-r--r-- | config/initializers/8_metrics.rb | 9 | ||||
-rw-r--r-- | config/initializers/doorkeeper_openid_connect.rb | 2 | ||||
-rw-r--r-- | config/initializers/flipper.rb | 6 | ||||
-rw-r--r-- | config/initializers/relative_naming_ci_namespace.rb | 4 |
5 files changed, 21 insertions, 6 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 8ddf8e4d2e4..cb11d2c34f4 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -495,6 +495,12 @@ Settings.webpack.dev_server['host'] ||= 'localhost' Settings.webpack.dev_server['port'] ||= 3808 # +# Prometheus metrics settings +# +Settings['prometheus'] ||= Settingslogic.new({}) +Settings.prometheus['unicorn_sampler_interval'] ||= 10 + +# # Testing settings # if Rails.env.test? diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index a0a63ddf8f0..d56fd7a6cfa 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -119,6 +119,13 @@ def instrument_classes(instrumentation) end # rubocop:enable Metrics/AbcSize +Gitlab::Metrics::UnicornSampler.initialize_instance(Settings.prometheus.unicorn_sampler_interval).start + +Gitlab::Application.configure do |config| + # 0 should be Sentry to catch errors in this middleware + config.middleware.insert(1, Gitlab::Metrics::ConnectionRackMiddleware) +end + if Gitlab::Metrics.enabled? require 'pathname' require 'influxdb' @@ -175,7 +182,7 @@ if Gitlab::Metrics.enabled? GC::Profiler.enable - Gitlab::Metrics::Sampler.new.start + Gitlab::Metrics::InfluxSampler.initialize_instance.start module TrackNewRedisConnections def connect(*args) diff --git a/config/initializers/doorkeeper_openid_connect.rb b/config/initializers/doorkeeper_openid_connect.rb index 4ff9019c43c..c58f425b19b 100644 --- a/config/initializers/doorkeeper_openid_connect.rb +++ b/config/initializers/doorkeeper_openid_connect.rb @@ -29,7 +29,7 @@ Doorkeeper::OpenidConnect.configure do o.claim(:email) { |user| user.public_email } o.claim(:email_verified) { |user| true if user.public_email? } o.claim(:website) { |user| user.full_website_url if user.website_url? } - o.claim(:profile) { |user| Rails.application.routes.url_helpers.user_url user } + o.claim(:profile) { |user| Gitlab::Routing.url_helpers.user_url user } o.claim(:picture) { |user| user.avatar_url(only_path: false) } end end diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index 0fee832788d..8ec9613a4b7 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -1,4 +1,6 @@ require 'flipper/middleware/memoizer' -Rails.application.config.middleware.use Flipper::Middleware::Memoizer, - lambda { Feature.flipper } +unless Rails.env.test? + Rails.application.config.middleware.use Flipper::Middleware::Memoizer, + lambda { Feature.flipper } +end diff --git a/config/initializers/relative_naming_ci_namespace.rb b/config/initializers/relative_naming_ci_namespace.rb index 03ac55be0b6..d9d3034150f 100644 --- a/config/initializers/relative_naming_ci_namespace.rb +++ b/config/initializers/relative_naming_ci_namespace.rb @@ -4,10 +4,10 @@ # - [project.namespace, project, build] # # instead of: -# - namespace_project_job_path(project.namespace, project, build) +# - project_job_path(project, build) # # Without that, Ci:: namespace is used for resolving routes: -# - namespace_project_ci_build_path(project.namespace, project, build) +# - project_ci_build_path(project, build) module Ci def self.use_relative_model_naming? |