Welcome to mirror list, hosted at ThFree Co, Russian Federation.

metrics_service.rb « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f39cc1a85348ad3038863f317e70681fc8ba4bbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'prometheus/client/formats/text'

class MetricsService
  def prometheus_metrics_text
    if Feature.enabled?(:prom_metrics_rust)
      ::Prometheus::Client::Formats::Text.marshal_multiprocess(multiprocess_metrics_path, use_rust: true)
    else
      ::Prometheus::Client::Formats::Text.marshal_multiprocess(multiprocess_metrics_path)
    end
  end

  def metrics_text
    prometheus_metrics_text
  end

  private

  def multiprocess_metrics_path
    ::Prometheus::Client.configuration.multiprocess_files_dir
  end
end