adding prometheus to frontend
This commit is contained in:
parent
dc98b16a4d
commit
1636786a27
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue