Documentation ¶
Index ¶
- Constants
- Variables
- func InstrumentRouteFunc(verb, resource, subresource, scope string, routeFunc restful.RouteFunction) restful.RouteFunction
- func Monitor(verb, resource, subresource, scope, client, contentType string, ...)
- func MonitorRequest(request *http.Request, verb, resource, subresource, scope, contentType string, ...)
- func Register()
- func Reset()
- func UpdateInflightRequestMetrics(nonmutating, mutating int)
- type ResponseWriterDelegator
Constants ¶
View Source
const ( // ReadOnlyKind is a string identifying read only request kind ReadOnlyKind = "readOnly" // MutatingKind is a string identifying mutating request kind MutatingKind = "mutating" )
Variables ¶
View Source
var ( // DroppedRequests is a number of requests dropped with 'Try again later' reponse" DroppedRequests = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "apiserver_dropped_requests", Help: "Number of requests dropped with 'Try again later' reponse", }, []string{"requestKind"}, ) )
Functions ¶
func InstrumentRouteFunc ¶
func InstrumentRouteFunc(verb, resource, subresource, scope string, routeFunc restful.RouteFunction) restful.RouteFunction
InstrumentRouteFunc works like Prometheus' InstrumentHandlerFunc but wraps the go-restful RouteFunction instead of a HandlerFunc
func Monitor ¶
func Monitor(verb, resource, subresource, scope, client, contentType string, httpCode, respSize int, reqStart time.Time)
Monitor records a request to the apiserver endpoints that follow the Kubernetes API conventions. verb must be uppercase to be backwards compatible with existing monitoring tooling.
func MonitorRequest ¶ added in v1.8.0
func MonitorRequest(request *http.Request, verb, resource, subresource, scope, contentType string, httpCode, respSize int, reqStart time.Time)
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 UpdateInflightRequestMetrics ¶ added in v1.8.8
func UpdateInflightRequestMetrics(nonmutating, mutating int)
Types ¶
type ResponseWriterDelegator ¶ added in v1.8.0
type ResponseWriterDelegator struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriterDelegator interface wraps http.ResponseWriter to additionally record content-length, status-code, etc.
func (*ResponseWriterDelegator) ContentLength ¶ added in v1.8.0
func (r *ResponseWriterDelegator) ContentLength() int
func (*ResponseWriterDelegator) Status ¶ added in v1.8.0
func (r *ResponseWriterDelegator) Status() int
func (*ResponseWriterDelegator) Write ¶ added in v1.8.0
func (r *ResponseWriterDelegator) Write(b []byte) (int, error)
func (*ResponseWriterDelegator) WriteHeader ¶ added in v1.8.0
func (r *ResponseWriterDelegator) WriteHeader(code int)
Click to show internal directories.
Click to hide internal directories.