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:
Jonathan Leibiusky
2016-12-15 17:12:17 -08:00
committed by GitHub
parent 946a8e1419
commit 70eaf37d4b
4 changed files with 54 additions and 2 deletions

2
api.go
View File

@@ -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)