Back to godoc.org

Package grpcmon

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Package grpcmon defines gRPC interceptors with monitoring instrumentation.

Index

func NewUnaryClientInterceptor

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

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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier