metrics interceptors: fix default server registration

metrics interceptors: add missing client histogram methods

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-11-06 22:51:03 +01:00
parent dcd2f18f65
commit 01b37a0d91
2 changed files with 41 additions and 2 deletions

View File

@ -110,7 +110,7 @@ func run(opts ...service.Option) {
ready := make(chan struct{})
var svc service.Service
var err error
metrics := metrics2.NewInterceptors()
metrics := metrics2.DefaultInterceptors()
validation := validation2.NewInterceptors(true)
defaulter := defaulter.NewInterceptors()
address := "0.0.0.0:9991"
@ -156,6 +156,7 @@ func run(opts ...service.Option) {
panic(err)
}
RegisterGreeterServer(svc, &GreeterHandler{})
metrics.EnableHandlingTimeHistogram()
metrics.Register(svc)
go func() {
if err := svc.Start(); err != nil {