From a19ad940276e595ad92a09da0c32ebb6b9239c26 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Tue, 9 May 2023 14:16:39 -0700 Subject: [PATCH] Serve metrics from registry --- scheduler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scheduler.go b/scheduler.go index 0127a1b..43c3714 100644 --- a/scheduler.go +++ b/scheduler.go @@ -67,7 +67,10 @@ func healthHandleFunc(writer http.ResponseWriter, request *http.Request) { func RunHTTPHandlers(addr string) error { http.HandleFunc("/health", healthHandleFunc) - http.Handle("/metrics", promhttp.Handler()) + http.Handle("/metrics", promhttp.HandlerFor( + Metrics.Registry, + promhttp.HandlerOpts{Registry: Metrics.Registry}, //nolint:exhaustruct + )) return fmt.Errorf("error on http server: %w", http.ListenAndServe(addr, nil)) //#nosec: g114 }