diff --git a/src/frontend/main.go b/src/frontend/main.go index a6bccda..ab46ae2 100644 --- a/src/frontend/main.go +++ b/src/frontend/main.go @@ -33,6 +33,8 @@ import ( "go.opencensus.io/stats/view" "go.opencensus.io/trace" "google.golang.org/grpc" + + "github.com/prometheus/client_golang/prometheus/promhttp" ) const ( @@ -131,6 +133,7 @@ func main() { r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static/")))) r.HandleFunc("/robots.txt", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, "User-agent: *\nDisallow: /") }) r.HandleFunc("/_healthz", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, "ok") }) + r.HandleFunc("/metrics", promhttp.Handler()) var handler http.Handler = r handler = &logHandler{log: log, next: handler} // add logging