Serve metrics from registry
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
IamTheFij 2023-05-09 14:16:39 -07:00
parent 8b9844465c
commit a19ad94027

View File

@ -67,7 +67,10 @@ func healthHandleFunc(writer http.ResponseWriter, request *http.Request) {
func RunHTTPHandlers(addr string) error { func RunHTTPHandlers(addr string) error {
http.HandleFunc("/health", healthHandleFunc) 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 return fmt.Errorf("error on http server: %w", http.ListenAndServe(addr, nil)) //#nosec: g114
} }