summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Kangas <gabek@real-ity.com>2022-02-22 23:27:32 -0800
committerGabe Kangas <gabek@real-ity.com>2022-02-22 23:27:32 -0800
commit08c589f4db611d39bfb73876624dfdb5c881fd0c (patch)
tree45076a828a3c6e0bc065b50fbf8c3a6adc5ba425
parent0d4e158bb3f8b8266f18f16a0e5af5f9a2a729a2 (diff)
Wrap prometheus metrics endpoint in admin middlewaregek/prometheus-metrics
-rw-r--r--router/router.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/router/router.go b/router/router.go
index f41a98e78..8cffe5b02 100644
--- a/router/router.go
+++ b/router/router.go
@@ -308,7 +308,9 @@ func Start() error {
http.HandleFunc("/api/admin/federation/actions", middleware.RequireAdminAuth(admin.GetFederatedActions))
// Prometheus metrics
- http.Handle("/api/admin/prometheus", promhttp.Handler())
+ http.Handle("/api/admin/prometheus", middleware.RequireAdminAuth(func(rw http.ResponseWriter, r *http.Request) {
+ promhttp.Handler().ServeHTTP(rw, r)
+ }))
// ActivityPub has its own router
activitypub.Start(data.GetDatastore())