Documentation ¶
Index ¶
- Constants
- Variables
- func CleanScope(requestInfo *request.RequestInfo) string
- func MonitorProxyRequest(req *http.Request, serverName, endpoint, flowControl string, ...)
- func RecordGlobalFlowControlAcquire(serverName string, flowControlType string, limitMethod string, ...)
- func RecordProxyRateAndInflight(rate float64, inflight int32)
- func RecordProxyRequestReceived(req *http.Request, serverName string, requestInfo *request.RequestInfo)
- func RecordProxyRequestTermination(req *http.Request, code int, reason, flowControl string)
- func RecordProxyTraceLatency(traceLatencies map[string]time.Duration, serverName string, ...)
- func RecordRateLimiterRequest(serverName string, method string, result string, flowControl string, ...)
- func RecordRequestThroughput(requestSizeTotal, responseSizeTotal int64)
- func RecordUnhealthyUpstream(serverName string, endpoint string, reason string)
- func RecordWatcherRegistered(serverName, endpoint, resource string)
- func RecordWatcherUnregistered(serverName, endpoint, resource string)
- func Register()
- type MetricInfo
- type MetricObserver
- type UnionObserver
Constants ¶
View Source
const (
OtherRequestMethod string = "other"
)
Variables ¶
View Source
var ( ProxyUpstreamUnhealthyObservers = newUnionObserver() ProxyReceiveRequestCounterObservers = newUnionObserver() ProxyRequestCounterObservers = newUnionObserver() ProxyRequestLatenciesObservers = newUnionObserver() ProxyResponseSizesObservers = newUnionObserver() ProxyRequestTerminationsObservers = newUnionObserver() ProxyWatcherRegisteredObservers = newUnionObserver() ProxyWatcherUnregisteredObservers = newUnionObserver() ProxyRateLimiterRequestCounterObservers = newUnionObserver() ProxyGlobalFlowControlAcquireObservers = newUnionObserver() ProxyRequestInflightObservers = newUnionObserver() ProxyRequestThroughputObservers = newUnionObserver() ProxyHandlingLatencyObservers = newUnionObserver() )
View Source
var ( // ValidRequestMethods are the valid request methods which we report in our metrics. // Any other request methods will be aggregated under 'unknown' ValidRequestMethods = utilsets.NewString( "APPLY", "CONNECT", "CREATE", "DELETE", "DELETECOLLECTION", "GET", "LIST", "PATCH", "POST", "PROXY", "PUT", "UPDATE", "WATCH", "WATCHLIST", ) )
Functions ¶
func CleanScope ¶
func CleanScope(requestInfo *request.RequestInfo) string
CleanScope returns the scope of the request.
func MonitorProxyRequest ¶
func MonitorProxyRequest(req *http.Request, serverName, endpoint, flowControl string, requestInfo *request.RequestInfo, contentType string, httpCode, respSize int, elapsed time.Duration)
MonitorProxyRequest handles standard transformations for client and the reported verb and then invokes Monitor to record a request. verb must be uppercase to be backwards compatible with existing monitoring tooling.
func RecordProxyRequestReceived ¶
func RecordProxyRequestReceived(req *http.Request, serverName string, requestInfo *request.RequestInfo)
func RecordProxyRequestTermination ¶
RecordProxyRequestTermination records that the request was terminated early as part of a resource preservation or apiserver self-defense mechanism (e.g. timeouts, maxinflight throttling, proxyHandler errors). RecordProxyRequestTermination should only be called zero or one times per request.
func RecordProxyTraceLatency ¶
func RecordRateLimiterRequest ¶
func RecordRateLimiterRequest(serverName string, method string, result string, flowControl string, elapsed time.Duration)
RecordRateLimiterRequest records ratelimiter requests
func RecordRequestThroughput ¶
func RecordRequestThroughput(requestSizeTotal, responseSizeTotal int64)
func RecordUnhealthyUpstream ¶
RecordUnhealthyUpstream records that the upstream endpoint is unhealthy.
func RecordWatcherRegistered ¶
func RecordWatcherRegistered(serverName, endpoint, resource string)
func RecordWatcherUnregistered ¶
func RecordWatcherUnregistered(serverName, endpoint, resource string)
Types ¶
type MetricInfo ¶
type MetricInfo struct { Request *http.Request IsResourceRequest bool ServerName string Endpoint string FlowControl string Verb string Resource string HttpCode string Path string Reason string Stage string RequestSize int64 ResponseSize int64 Latency float64 Rate float64 Inflight float64 TraceLatencies map[string]time.Duration Method string Result string LimitMethod string Type string }
type MetricObserver ¶
type MetricObserver interface {
Observe(metric MetricInfo)
}
type UnionObserver ¶
type UnionObserver interface { MetricObserver AddObserver(MetricObserver) }
Click to show internal directories.
Click to hide internal directories.