middleware

package
v1.13.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

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

Types

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

func (*RequestRecorder) Record

func (r *RequestRecorder) Record(requestName string, rpcType string, start time.Time, request interface{}, respErrored bool)

Jump to

Keyboard shortcuts

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