Documentation ¶
Index ¶
Constants ¶
View Source
const RPCTypeInternal = "internal"
RPCTypeInternal identifies the "RPC" request as coming from some internal operation that runs on the cluster leader. Technically this is not an RPC request, but these raft.Apply operations have the same impact on blocking queries, and streaming subscriptions, so need to be tracked by the same metric and logs. Really what we are measuring here is a "cluster operation". The term we have used for this historically is "RPC", so we continue to use that here.
View Source
const RPCTypeNetRPC = "net/rpc"
Variables ¶
View Source
var OneTwelveRPCSummary = []prometheus.SummaryDefinition{
{
Name: metricRPCRequest,
Help: "Measures the time an RPC service call takes to make in milliseconds. Labels mark which RPC method was called and metadata about the call.",
},
}
Functions ¶
func GetNetRPCInterceptor ¶
func GetNetRPCInterceptor(recorder *RequestRecorder) rpc.ServerServiceCallInterceptor
func GetNetRPCRateLimitingInterceptor ¶
func GetNetRPCRateLimitingInterceptor(requestLimitsHandler rpcRate.RequestLimitsHandler, panicHandler RecoveryHandlerFunc) rpc.PreBodyInterceptor
Types ¶
type RecoveryHandlerFunc ¶
type RecoveryHandlerFunc func(p interface{}) (err error)
func NewPanicHandler ¶
func NewPanicHandler(logger hclog.Logger) RecoveryHandlerFunc
NewPanicHandler returns a RecoveryHandlerFunc type function to handle panic in RPC server's handlers.
type RequestRecorder ¶
type RequestRecorder struct { Logger hclog.Logger RecorderFunc func(key []string, val float32, labels []metrics.Label) // contains filtered or unexported fields }
func NewRequestRecorder ¶
func NewRequestRecorder(logger hclog.Logger, isLeader func() bool, localDC string) *RequestRecorder
Click to show internal directories.
Click to hide internal directories.