package handlers import ( "net/http" "github.com/prometheus/client_golang/prometheus/promhttp" ) // HandleMetrics returns the Prometheus scrape handler for the // registry every collector in this process registers on. It is what // promhttp.Handler builds for the global default registry, including // the promhttp_metric_handler_* series that count scrapes, pointed at // that registry instead. func (s *Handlers) HandleMetrics() http.HandlerFunc { reg := s.params.Registry return promhttp.InstrumentMetricHandler( reg, promhttp.HandlerFor(reg, promhttp.HandlerOpts{}), ).ServeHTTP }