Browse Source

added prometheus route

master
Stephen McQuay 4 years ago
parent
commit
abe0e155a9
No known key found for this signature in database GPG Key ID: 1ABF428F71BAFC3D
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      main.go

+ 2
- 0
main.go View File

@@ -11,6 +11,7 @@ import (

"github.com/elazarl/go-bindata-assetfs"
"github.com/gorilla/sessions"
"github.com/prometheus/client_golang/prometheus"
)

//go:generate go-bindata -o static.go static/
@@ -24,6 +25,7 @@ var store = sessions.NewCookieStore([]byte(os.Getenv("MMG_SECRET_KEY")))
func main() {
rand.Seed(time.Now().UTC().UnixNano())
flag.Parse()
http.Handle("/metrics", prometheus.Handler())
http.HandleFunc("/api/v0/addsub/problem/", addsub)
http.HandleFunc("/api/v0/mul/problem/", mul)
http.HandleFunc("/api/v0/attempt/", attempt)


Loading…
Cancel
Save