Api metrics (#1014)

* api metrics support

* comments reflected

* metrics middleware fix
This commit is contained in:
Tomas Knappek
2018-05-25 08:31:37 -07:00
committed by Shiva
parent 05caef0d26
commit e3e264de53
3 changed files with 121 additions and 0 deletions

View File

@@ -537,6 +537,7 @@ func New(ctx context.Context, opts ...ServerOption) *Server {
setMachineID()
s.Router.Use(loggerWrap, traceWrap, panicWrap) // TODO should be opts
optionalCorsWrap(s.Router) // TODO should be an opt
apiMetricsWrap(s)
s.bindHandlers(ctx)
s.appListeners = new(appListeners)
@@ -572,6 +573,7 @@ func WithPrometheus() ServerOption {
}
s.promExporter = exporter
view.RegisterExporter(exporter)
registerViews()
return nil
}
}