Commit e24c9e2d authored by Matthias Käppler's avatar Matthias Käppler Committed by Bob Van Landuyt

Fix broken metrics_server dependencies

parent 257d5598
#!/usr/bin/env ruby #!/usr/bin/env ruby
# frozen_string_literal: true # frozen_string_literal: true
require_relative '../metrics_server/dependencies'
require_relative '../metrics_server/metrics_server' require_relative '../metrics_server/metrics_server'
target = ENV['METRICS_SERVER_TARGET'] target = ENV['METRICS_SERVER_TARGET']
......
# frozen_string_literal: true # frozen_string_literal: true
PUMA_EXTERNAL_METRICS_SERVER = Gitlab::Utils.to_boolean(ENV['PUMA_EXTERNAL_METRICS_SERVER']) PUMA_EXTERNAL_METRICS_SERVER = Gitlab::Utils.to_boolean(ENV['PUMA_EXTERNAL_METRICS_SERVER'])
require Rails.root.join('metrics_server', 'metrics_server') if PUMA_EXTERNAL_METRICS_SERVER
# Keep separate directories for separate processes # Keep separate directories for separate processes
def prometheus_default_multiproc_dir def prometheus_default_multiproc_dir
...@@ -74,8 +75,7 @@ Gitlab::Cluster::LifecycleEvents.on_master_start do ...@@ -74,8 +75,7 @@ Gitlab::Cluster::LifecycleEvents.on_master_start do
if Gitlab::Runtime.puma? if Gitlab::Runtime.puma?
Gitlab::Metrics::Samplers::PumaSampler.instance.start Gitlab::Metrics::Samplers::PumaSampler.instance.start
if Settings.monitoring.web_exporter.enabled && PUMA_EXTERNAL_METRICS_SERVER if PUMA_EXTERNAL_METRICS_SERVER && Settings.monitoring.web_exporter.enabled
require_relative '../../metrics_server/metrics_server'
MetricsServer.start_for_puma MetricsServer.start_for_puma
else else
Gitlab::Metrics::Exporter::WebExporter.instance.start Gitlab::Metrics::Exporter::WebExporter.instance.start
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
require_relative '../config/boot' require_relative '../config/boot'
require_relative 'dependencies'
class MetricsServer # rubocop:disable Gitlab/NamespacedClass class MetricsServer # rubocop:disable Gitlab/NamespacedClass
# The singleton instance used to supervise the Puma metrics server. # The singleton instance used to supervise the Puma metrics server.
PumaProcessSupervisor = Class.new(Gitlab::ProcessSupervisor) PumaProcessSupervisor = Class.new(Gitlab::ProcessSupervisor)
......
...@@ -10,12 +10,10 @@ require 'time' ...@@ -10,12 +10,10 @@ require 'time'
# we may run into "already initialized" warnings, hence the check. # we may run into "already initialized" warnings, hence the check.
require_relative '../lib/gitlab' unless Object.const_defined?('Gitlab') require_relative '../lib/gitlab' unless Object.const_defined?('Gitlab')
require_relative '../lib/gitlab/utils' require_relative '../lib/gitlab/utils'
require_relative '../lib/gitlab/daemon'
require_relative '../lib/gitlab/sidekiq_config/cli_methods' require_relative '../lib/gitlab/sidekiq_config/cli_methods'
require_relative '../lib/gitlab/sidekiq_config/worker_matcher' require_relative '../lib/gitlab/sidekiq_config/worker_matcher'
require_relative '../lib/gitlab/sidekiq_logging/json_formatter' require_relative '../lib/gitlab/sidekiq_logging/json_formatter'
require_relative '../lib/gitlab/process_management' require_relative '../metrics_server/dependencies'
require_relative '../lib/gitlab/process_supervisor'
require_relative '../metrics_server/metrics_server' require_relative '../metrics_server/metrics_server'
require_relative 'sidekiq_cluster' require_relative 'sidekiq_cluster'
......
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