From 1788119e5a2ed2e4e0c9255553c2e100fe3dd02d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 14 Sep 2026 20:40:50 -0700 Subject: [PATCH] volume: expose /metrics on admin mux Allows the admin server to scrape volume server metrics from the admin HTTP port (same port as /status and /healthz). --- weed/server/volume_server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/server/volume_server.go b/weed/server/volume_server.go index 1b6feeac4..f283c8eb7 100644 --- a/weed/server/volume_server.go +++ b/weed/server/volume_server.go @@ -6,6 +6,7 @@ import ( "sync" "time" + "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/seaweedfs/seaweedfs/weed/pb" "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb" "github.com/seaweedfs/seaweedfs/weed/storage/types" @@ -142,6 +143,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, adminMux.HandleFunc("/status", requestIDMiddleware(vs.statusHandler)) adminMux.HandleFunc("/healthz", requestIDMiddleware(vs.healthzHandler)) adminMux.HandleFunc("/readyz", requestIDMiddleware(vs.healthzHandler)) + adminMux.Handle("/metrics", promhttp.HandlerFor(stats.Gather, promhttp.HandlerOpts{})) if signingKey == "" || enableUiAccess { // only expose the volume server details for safe environments adminMux.HandleFunc("/ui/index.html", requestIDMiddleware(vs.uiStatusHandler))