interceptor

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerHandledCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "fgo",
			Name:      "grpc_server_handled_total",
			Help:      "Total number of RPCs completed on the server, regardless of success or failure.",
		}, []string{"grpc_type", "method", "code", "uniform_code"})

	ServerHandledHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "fgo",
			Name:      "grpc_server_handling_seconds",
			Help:      "Histogram of response latency (seconds) of gRPC that had been application-level handled by the server.",
		}, []string{"grpc_type", "method"})
)
View Source
var (
	ServerWithBizHandledCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: fmetric.DefaultNamespace,
			Name:      "monitor_grpc_server_result_total",
			Help:      "Total number of RPCs completed on the server, regardless of success or failure.",
		}, []string{"grpc_type", "grpc_service", "grpc_method", "grpc_code", "result_code"})
)

Functions

func GrpcHeaderCarrierInterceptor

func GrpcHeaderCarrierInterceptor() grpc.UnaryServerInterceptor

func GrpcRecoveryHandler

func GrpcRecoveryHandler(ctx context.Context, p interface{}) (err error)

func MetricUnaryServerInterceptor

func MetricUnaryServerInterceptor(successCodes []string) grpc.UnaryServerInterceptor

func UnaryRecoveryInterceptor

func UnaryRecoveryInterceptor() grpc.UnaryServerInterceptor

func UnaryTimeoutInterceptor

func UnaryTimeoutInterceptor(timeout time.Duration) grpc.UnaryServerInterceptor

UnaryTimeoutInterceptor returns a func that sets timeout to incoming unary requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL