summaryrefslogtreecommitdiff
path: root/lib/gitlab/metrics/exporter/web_exporter.rb
blob: f4b42759fb9d63e9eb879a4147063b02ccbbe2c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

require 'webrick'
require 'prometheus/client/rack/exporter'

module Gitlab
  module Metrics
    module Exporter
      class WebExporter < BaseExporter
        # This exporter is always run on master process
        def initialize
          super

          self.additional_checks = [
            Gitlab::HealthChecks::PumaCheck,
            Gitlab::HealthChecks::UnicornCheck
          ]
        end

        def settings
          Settings.monitoring.web_exporter
        end

        def log_filename
          File.join(Rails.root, 'log', 'web_exporter.log')
        end
      end
    end
  end
end