Add metrics (#70)
* Add prometheus support to count sessions, instances and clientes over time * Track counters on server reload * Change to gauges
This commit is contained in:
committed by
GitHub
parent
946a8e1419
commit
70eaf37d4b
2
api.go
2
api.go
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/franela/play-with-docker/services"
|
||||
"github.com/franela/play-with-docker/templates"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/urfave/negroni"
|
||||
)
|
||||
|
||||
@@ -71,6 +72,7 @@ func main() {
|
||||
}))
|
||||
|
||||
r.Handle("/sessions/{sessionId}/ws/", server)
|
||||
r.Handle("/metrics", promhttp.Handler())
|
||||
|
||||
n := negroni.Classic()
|
||||
n.UseHandler(r)
|
||||
|
||||
Reference in New Issue
Block a user