Commit aa8aeec1 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'mk-fix-missing-metrics-server-dependency' into 'master'

Fix broken metrics_server dependencies

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