diff --git a/interceptors/metrics/interceptors.go b/interceptors/metrics/interceptors.go index d840a0b..0345958 100644 --- a/interceptors/metrics/interceptors.go +++ b/interceptors/metrics/interceptors.go @@ -22,6 +22,7 @@ type ServerInterceptors interface { Registerer interceptors.ServerInterceptors prometheus.Collector + EnableHandlingTimeHistogram(opts ...grpc_prometheus.HistogramOption) } type ClientInterceptors interface { @@ -33,6 +34,12 @@ type metrics struct { c *grpc_prometheus.ClientMetrics } +func (m *metrics) EnableHandlingTimeHistogram(opts ...grpc_prometheus.HistogramOption) { + if m.s != nil { + m.s.EnableHandlingTimeHistogram(opts...) + } +} + func (m *metrics) Describe(descs chan<- *prometheus.Desc) { if m.s != nil { m.s.Describe(descs)