aboutsummaryrefslogtreecommitdiff
path: root/cmd/cashierd
diff options
context:
space:
mode:
authorKevin Lyda <kevin@ie.suberic.net>2017-02-12 14:38:12 +0000
committerNiall Sheridan <nsheridan@gmail.com>2017-02-12 14:38:12 +0000
commited8bc523fd0d1a66acf3fa449c453508035efdfc (patch)
treec05849546e1dd9d771dcc4c4ff52056d249a95fb /cmd/cashierd
parent9c344a0a95c44ef9cebade7b8a65ac160d9eb900 (diff)
Initial pass at prometheus support. (#56)
Diffstat (limited to 'cmd/cashierd')
-rw-r--r--cmd/cashierd/main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/cashierd/main.go b/cmd/cashierd/main.go
index 7277773..85c2d81 100644
--- a/cmd/cashierd/main.go
+++ b/cmd/cashierd/main.go
@@ -33,12 +33,14 @@ import (
"github.com/nsheridan/cashier/server/auth/gitlab"
"github.com/nsheridan/cashier/server/auth/google"
"github.com/nsheridan/cashier/server/config"
+ "github.com/nsheridan/cashier/server/metrics"
"github.com/nsheridan/cashier/server/signer"
"github.com/nsheridan/cashier/server/static"
"github.com/nsheridan/cashier/server/store"
"github.com/nsheridan/cashier/server/templates"
"github.com/nsheridan/cashier/server/wkfs/vaultfs"
"github.com/nsheridan/wkfs/s3"
+ "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sid77/drop"
)
@@ -374,6 +376,8 @@ func main() {
}
// Unprivileged section
+ metrics.Register()
+
var authprovider auth.Provider
switch conf.Auth.Provider {
case "google":
@@ -416,6 +420,7 @@ func main() {
r.Methods("POST").Path("/admin/revoke").Handler(CSRF(appHandler{ctx, revokeCertHandler}))
r.Methods("GET").Path("/admin/certs").Handler(CSRF(appHandler{ctx, listAllCertsHandler}))
r.Methods("GET").Path("/admin/certs.json").Handler(appHandler{ctx, listCertsJSONHandler})
+ r.Methods("GET").Path("/metrics").Handler(promhttp.Handler())
r.PathPrefix("/").Handler(http.FileServer(static.FS(false)))
h := handlers.LoggingHandler(logfile, r)