Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Now = time.Now Since = time.Since )
Functions ¶
func StreamInterceptor ¶
func StreamInterceptor(opts ...Option) grpc.StreamServerInterceptor
StreamInterceptor returns a grpc.StreamServerInterceptor that handle request metrics.
func UnaryInterceptor ¶
func UnaryInterceptor(opts ...Option) grpc.UnaryServerInterceptor
UnaryInterceptor returns a grpc.UnaryServerInterceptor that handle request metrics.
Types ¶
type Option ¶
type Option func(mw *metricsWrapper)
Option is metrics option func.
func WithDurationObserver ¶
WithDurationObserver returns an Option that configures request handling duration observer. We suggest these labels are set before passing the observer to this function:
app_id: domain.biz.module env: prd/uat/fat/dev region: regionId. optional zone: zoneId. optional cluster: clusterId. optional host: hostname addr: ip:port transport: grpc actor: server
func WithInflightGauge ¶
WithInflightGauge returns an Option that configures inflight request count gauge. We suggest these labels are set before passing the gauge to this function:
app_id: domain.biz.module env: prd/uat/fat/dev region: regionId. optional zone: zoneId. optional cluster: clusterId. optional host: hostname addr: ip:port transport: grpc actor: server
func WithRequestCounter ¶
WithRequestCounter returns an Option that configures request counter. We suggest these labels are set before passing the counter to this function:
app_id: domain.biz.module env: prd/uat/fat/dev region: regionId. optional zone: zoneId. optional cluster: clusterId. optional host: hostname addr: ip:port transport: grpc actor: server