2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
require 'prometheus/client/formats/text'
|
|
|
|
|
|
|
|
class MetricsService
|
|
|
|
def prometheus_metrics_text
|
2021-09-30 23:02:18 +05:30
|
|
|
::Prometheus::Client::Formats::Text.marshal_multiprocess(multiprocess_metrics_path)
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def metrics_text
|
2018-11-08 19:23:39 +05:30
|
|
|
prometheus_metrics_text
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def multiprocess_metrics_path
|
|
|
|
::Prometheus::Client.configuration.multiprocess_files_dir
|
|
|
|
end
|
|
|
|
end
|