From 7d9c87559961c9be573e6f6afd4f3e0b57c582a5 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 14 Sep 2026 20:41:01 -0700 Subject: [PATCH] filer: expose /metrics on main HTTP port Allows the admin server to scrape filer metrics without a separate -metricsPort. --- weed/server/filer_server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go index 7d998ad8f..e79ef02b3 100644 --- a/weed/server/filer_server.go +++ b/weed/server/filer_server.go @@ -10,6 +10,7 @@ import ( "sync/atomic" "time" + "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/seaweedfs/seaweedfs/weed/credential" "github.com/seaweedfs/seaweedfs/weed/stats" "golang.org/x/sync/singleflight" @@ -260,6 +261,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption) if !option.DisableHttp { defaultMux.HandleFunc("/healthz", requestIDMiddleware(fs.filerHealthzHandler)) defaultMux.HandleFunc("/readyz", requestIDMiddleware(fs.filerHealthzHandler)) + defaultMux.Handle("/metrics", promhttp.HandlerFor(stats.Gather, promhttp.HandlerOpts{})) // TUS resumable upload protocol handler if option.TusBasePath != "" { // Normalize TusPath to always have a leading slash and no trailing slash