added prometheus metrics

This commit is contained in:
Jakub Matys
2018-03-13 11:34:49 +01:00
parent ab2d2c2f0d
commit d7229f8db0
11 changed files with 243 additions and 43 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
// HTTPServer is handle to HttpServer
@@ -47,6 +48,7 @@ func NewHTTPServer(httpServerBinding string, certFiles string, db *db.RocksDB, c
r.HandleFunc("/transactions/{address}/{lower}/{higher}", s.transactions)
r.HandleFunc("/confirmedTransactions/{address}/{lower}/{higher}", s.confirmedTransactions)
r.HandleFunc("/unconfirmedTransactions/{address}", s.unconfirmedTransactions)
r.HandleFunc("/metrics", promhttp.Handler().ServeHTTP)
var h http.Handler = r
h = handlers.LoggingHandler(os.Stderr, h)