kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go

type resettableCollector

const APIServerComponent

const OtherRequestMethod

var deprecatedRequestGauge

var requestCounter

var longRunningRequestsGauge

var requestLatencies

var requestSloLatencies

var requestSliLatencies

var fieldValidationRequestLatencies

var responseSizes

var TLSHandshakeErrors

var WatchEvents

var WatchEventsSizes

var currentInflightRequests

var currentInqueueRequests

var requestTerminationsTotal

var apiSelfRequestCounter

var requestFilterDuration

var requestAbortsTotal

var requestPostTimeoutTotal

var requestTimestampComparisonDuration

var watchListLatencies

var metrics

var validRequestMethods

var validConnectRequests

const ReadOnlyKind

const MutatingKind

const WaitingPhase

const ExecutingPhase

const deprecatedAnnotationKey

const removedReleaseAnnotationKey

const PostTimeoutSourceTimeoutHandler

const PostTimeoutSourceRestHandler

const PostTimeoutHandlerPanic

const PostTimeoutHandlerError

const PostTimeoutHandlerOK

const PostTimeoutHandlerPending

var registerMetrics

// Register all metrics.
func Register() {}

// Reset all metrics.
func Reset() {}

// UpdateInflightRequestMetrics reports concurrency metrics classified by
// mutating vs Readonly.
func UpdateInflightRequestMetrics(phase string, nonmutating, mutating int) {}

func RecordFilterLatency(ctx context.Context, name string, elapsed time.Duration) {}

func RecordTimestampComparisonLatency(codePath string, elapsed time.Duration) {}

func RecordRequestPostTimeout(source string, status string) {}

// RecordRequestAbort records that the request was aborted possibly due to a timeout.
func RecordRequestAbort(req *http.Request, requestInfo *request.RequestInfo) {}

// RecordDroppedRequest records that the request was rejected via http.TooManyRequests.
func RecordDroppedRequest(req *http.Request, requestInfo *request.RequestInfo, component string, isMutatingRequest bool) {}

// RecordRequestTermination 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). RecordRequestTermination should only be called zero or one times
// per request.
func RecordRequestTermination(req *http.Request, requestInfo *request.RequestInfo, component string, code int) {}

// RecordLongRunning tracks the execution of a long running request against the API server. It provides an accurate count
// of the total number of open long running requests. requestInfo may be nil if the caller is not in the normal request flow.
func RecordLongRunning(req *http.Request, requestInfo *request.RequestInfo, component string, fn func()) {}

// RecordWatchListLatency simply records response latency for watch list requests.
func RecordWatchListLatency(ctx context.Context, gvr schema.GroupVersionResource, metricsScope string) {}

// MonitorRequest 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 MonitorRequest(req *http.Request, verb, group, version, resource, subresource, scope, component string, deprecated bool, removedRelease string, httpCode, respSize int, elapsed time.Duration) {}

// InstrumentRouteFunc works like Prometheus' InstrumentHandlerFunc but wraps
// the go-restful RouteFunction instead of a HandlerFunc plus some Kubernetes endpoint specific information.
func InstrumentRouteFunc(verb, group, version, resource, subresource, scope, component string, deprecated bool, removedRelease string, routeFunc restful.RouteFunction) restful.RouteFunction {}

// InstrumentHandlerFunc works like Prometheus' InstrumentHandlerFunc but adds some Kubernetes endpoint specific information.
func InstrumentHandlerFunc(verb, group, version, resource, subresource, scope, component string, deprecated bool, removedRelease string, handler http.HandlerFunc) http.HandlerFunc {}

// NormalizedVerb returns normalized verb
func NormalizedVerb(req *http.Request) string {}

// CleanScope returns the scope of the request.
func CleanScope(requestInfo *request.RequestInfo) string {}

// CleanListScope computes the request scope for metrics.
//
// Note that normally we would use CleanScope for computation.
// But due to the same reasons mentioned in determineRequestNamespaceAndName we cannot.
func CleanListScope(ctx context.Context, opts *metainternalversion.ListOptions) string {}

// CanonicalVerb distinguishes LISTs from GETs (and HEADs). It assumes verb is
// UPPERCASE.
func CanonicalVerb(verb string, scope string) string {}

// CleanVerb returns a normalized verb, so that it is easy to tell WATCH from
// LIST, APPLY from PATCH and CONNECT from others.
func CleanVerb(verb string, request *http.Request, requestInfo *request.RequestInfo) string {}

// determineRequestNamespaceAndName computes name and namespace for the given requests
//
// note that the logic of this function was copy&pasted from cacher.go
// after an unsuccessful attempt of moving it to RequestInfo
//
// see: https://github.com/kubernetes/kubernetes/pull/120520
func determineRequestNamespaceAndName(ctx context.Context, opts *metainternalversion.ListOptions) (namespace, name string) {}

// cleanVerb additionally ensures that unknown verbs don't clog up the metrics.
func cleanVerb(verb, suggestedVerb string, request *http.Request, requestInfo *request.RequestInfo) string {}

// getVerbIfWatch additionally ensures that GET or List would be transformed to WATCH
func getVerbIfWatch(req *http.Request) string {}

func cleanDryRun(u *url.URL) string {}

func cleanFieldValidation(u *url.URL) string {}

var _

var _

type ResponseWriterDelegator

func (r *ResponseWriterDelegator) Unwrap() http.ResponseWriter {}

func (r *ResponseWriterDelegator) WriteHeader(code int) {}

func (r *ResponseWriterDelegator) Write(b []byte) (int, error) {}

func (r *ResponseWriterDelegator) Status() int {}

func (r *ResponseWriterDelegator) ContentLength() int {}

// Small optimization over Itoa
func codeToString(s int) string {}