2017-09-10 17:25:29 +05:30
|
|
|
require 'prometheus/client/formats/text'
|
|
|
|
|
|
|
|
class MetricsService
|
|
|
|
def prometheus_metrics_text
|
|
|
|
Prometheus::Client::Formats::Text.marshal_multiprocess(multiprocess_metrics_path)
|
|
|
|
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
|