Retrospring/app/controllers/metrics_controller.rb

18 lines
317 B
Ruby
Raw Normal View History

2023-02-13 11:13:32 -08:00
# frozen_string_literal: true
require "prometheus/client/formats/text"
class MetricsController < ActionController::API
include ActionController::MimeResponds
def show
render plain: metrics
end
private
def metrics
Prometheus::Client::Formats::Text.marshal(Prometheus::Client.registry)
end
end