8d413bf58717bf77fb2b3c8fa5f7f0b3533774b3
[akkoma] / lib / pleroma / web / akkoma_api / controllers / metrics_controller.ex
1 defmodule Pleroma.Web.AkkomaAPI.MetricsController do
2 use Pleroma.Web, :controller
3
4 alias Pleroma.Web.Plugs.OAuthScopesPlug
5
6 plug(
7 OAuthScopesPlug,
8 %{scopes: ["admin:metrics"]}
9 when action in [
10 :show
11 ]
12 )
13
14 def show(conn, _params) do
15 stats = TelemetryMetricsPrometheus.Core.scrape()
16
17 conn
18 |> text(stats)
19 end
20 end