[VOL-5506] Enable grpc stats
Change-Id: I78fe2235a2df26855053aa91da6f0b2c4fccd5f0
Signed-off-by: Abhay Kumar <abhay.kumar@radisys.com>
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index a72c011..c85be74 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -39,6 +39,7 @@
"github.com/gogo/protobuf/proto"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
+ grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"github.com/opencord/voltha-lib-go/v7/pkg/config"
"github.com/opencord/voltha-lib-go/v7/pkg/events/eventif"
flow_utils "github.com/opencord/voltha-lib-go/v7/pkg/flows"
@@ -1209,15 +1210,18 @@
}
logger.Debugw(ctx, "Dailing grpc", log.Fields{"device-id": dh.device.Id})
+ grpc_prometheus.EnableClientHandlingTimeHistogram()
// Use Interceptors to automatically inject and publish Open Tracing Spans by this GRPC client
dh.clientCon, err = grpc.Dial(dh.device.GetHostAndPort(),
grpc.WithInsecure(),
grpc.WithBlock(),
grpc.WithStreamInterceptor(grpc_middleware.ChainStreamClient(
grpc_opentracing.StreamClientInterceptor(grpc_opentracing.WithTracer(log.ActiveTracerProxy{})),
+ grpc_prometheus.StreamClientInterceptor,
)),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
grpc_opentracing.UnaryClientInterceptor(grpc_opentracing.WithTracer(log.ActiveTracerProxy{})),
+ grpc_prometheus.UnaryClientInterceptor,
)))
if err != nil {