add requests/errors to stats
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/micro/go-micro/debug/profile/http"
|
||||
"github.com/micro/go-micro/debug/profile/pprof"
|
||||
"github.com/micro/go-micro/debug/service/handler"
|
||||
"github.com/micro/go-micro/debug/stats"
|
||||
"github.com/micro/go-micro/plugin"
|
||||
"github.com/micro/go-micro/server"
|
||||
"github.com/micro/go-micro/util/log"
|
||||
@@ -35,6 +36,9 @@ func newService(opts ...Option) Service {
|
||||
// wrap client to inject From-Service header on any calls
|
||||
options.Client = wrapper.FromService(serviceName, options.Client)
|
||||
|
||||
// wrap the server to provide handler stats
|
||||
options.Server.Init(server.WrapHandler(wrapper.HandlerStats(stats.DefaultStats)))
|
||||
|
||||
return &service{
|
||||
opts: options,
|
||||
}
|
||||
|
Reference in New Issue
Block a user