diff --git a/cmd/hwtd/main.go b/cmd/hwtd/main.go index 45ac0e5..7dc1da3 100644 --- a/cmd/hwtd/main.go +++ b/cmd/hwtd/main.go @@ -5,6 +5,7 @@ import ( "net/http" "os" + "github.com/prometheus/client_golang/prometheus/promhttp" "mcquay.me/hwt" pb "mcquay.me/hwt/rpc/hwt" ) @@ -16,7 +17,10 @@ func main() { } s := &hwt.Server{hn} th := pb.NewHelloWorldServer(s, nil) - if err := http.ListenAndServe(":8080", th); err != nil { + sm := http.NewServeMux() + sm.Handle("/", th) + sm.Handle("/metrics", promhttp.Handler()) + if err := http.ListenAndServe(":8080", sm); err != nil { log.Fatalf("listen and serve: %v", err) } }