luci: go.chromium.org/luci/grpc/grpcmon Index | Files

package grpcmon

import "go.chromium.org/luci/grpc/grpcmon"

Package grpcmon defines gRPC interceptors with monitoring instrumentation.

Index

Package Files

client.go doc.go server.go

func NewUnaryClientInterceptor Uses

func NewUnaryClientInterceptor(next grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor

NewUnaryClientInterceptor returns an interceptor that gathers RPC call metrics and sends them to tsmon.

It can be optionally chained with other interceptor. The reported metrics include time spent in this other interceptor too.

Can be passed to a gRPC client via WithUnaryInterceptor(...) dial option.

Use option.WithGRPCDialOption(grpc.WithUnaryInterceptor(...)) when instrumenting Google Cloud API clients.

It assumes the RPC context has tsmon initialized already.

func UnaryServerInterceptor Uses

func UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

UnaryServerInterceptor is a grpc.UnaryServerInterceptor that gathers RPC handler metrics and sends them to tsmon.

It assumes the RPC context has tsmon initialized already.

Package grpcmon imports 11 packages (graph) and is imported by 9 packages. Updated 2020-04-07. Refresh now. Tools for package owners.