filters

package
v0.0.0-...-43b7830 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func WithDispatcher

func WithDispatcher(handler http.Handler, dispacher http.Handler) http.Handler

func WithExtraRequestInfo

func WithExtraRequestInfo(handler http.Handler, resolver request.ExtraRequestInfoResolver, s runtime.NegotiatedSerializer) http.Handler

WithExtraRequestInfo attaches a request host to the context.

func WithImpersonator

func WithImpersonator(handler http.Handler) http.Handler

WithImpersonator record impersonator because request user will be replaced by impersonatee

func WithLoadPressureGoaway

func WithLoadPressureGoaway(
	inner http.Handler,
	inflightThreshold int32,
	qpsThreshold int32,
	throughputThresholdMB int32,
	chance float64,
	rateMonitor *monitor.RateMonitor,
	throughputMonitor *monitor.ThroughputMonitor,
) http.Handler

WithLoadPressureGoaway returns an http.Handler that send GOAWAY probabilistically according to the given chance for HTTP2 requests when proxy server has load pressure. After client receive GOAWAY, the in-flight long-running requests will not be influenced, and the new requests will use a new TCP connection to re-balancing to another server behind the load balance.

func WithNoLoggingImpersonation

func WithNoLoggingImpersonation(handler http.Handler, a authorizer.Authorizer, s runtime.NegotiatedSerializer) http.Handler

the fllowing code is copied from k8s.io/apiserver/pkg/endpoint/filters/impersonation.go and delete httplog for proxy

WithNoLoggingImpersonation is a filter that will inspect and check requests that attempt to change the user.Info for their requests

func WithNoLoggingPanicRecovery

func WithNoLoggingPanicRecovery(handler http.Handler) http.Handler

WithNoLoggingPanicRecovery wraps an http Handler to recover and log panics (except in the special case of http.ErrAbortHandler panics, which suppress logging).

func WithPreProcessingMetrics

func WithPreProcessingMetrics(handler http.Handler) http.Handler

WithPreProcessingMetrics is a filter that record metrics before request being processed.

func WithRequestRate

func WithRequestRate(
	handler http.Handler,
	longRunningRequestCheck apirequest.LongRunningRequestCheck,
	rateMonitor *monitor.RateMonitor,
) http.Handler

WithRequestRate record request rate and inflight

func WithRequestThroughput

func WithRequestThroughput(
	handler http.Handler,
	throughputMonitor *monitor.ThroughputMonitor,
) http.Handler

WithRequestThroughput record request input and output throughput

func WithTerminationMetrics

func WithTerminationMetrics(handler http.Handler) http.Handler

func WithTraceLog

func WithTraceLog(handler http.Handler, enableTracing bool, longRunningRequestCheck apirequest.LongRunningRequestCheck) http.Handler

WithTraceLog is a filter that record trace log.

func WithUpstreamInfo

func WithUpstreamInfo(handler http.Handler, clusterManager clusters.Manager, s runtime.NegotiatedSerializer) http.Handler

WithUpstreamInfo attaches upstream cluster info to ExtraRequestInfo

Types

This section is empty.

Jump to

Keyboard shortcuts

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