Documentation ¶
Index ¶
- Variables
- func GrpcHeaderCarrierInterceptor() grpc.UnaryServerInterceptor
- func GrpcLogger(config *grpc_server_config.Config) grpc.UnaryServerInterceptor
- func GrpcRecoveryHandler(ctx context.Context, p interface{}) (err error)
- func MetricUnaryServerInterceptor(successCodes []string) grpc.UnaryServerInterceptor
- func UnaryRecoveryInterceptor() grpc.UnaryServerInterceptor
- func UnaryTimeoutInterceptor(timeout time.Duration) grpc.UnaryServerInterceptor
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 GrpcLogger ¶
func GrpcLogger(config *grpc_server_config.Config) grpc.UnaryServerInterceptor
func GrpcRecoveryHandler ¶
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.
Click to show internal directories.
Click to hide internal directories.