observer

package
v0.0.0-...-2e24269 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RequestStatusUnmatched          = RequestStatus("Unmatched")
	RequestStatusNotRelevant        = RequestStatus("NotRelevant")
	RequestStatusAlreadyTerminating = RequestStatus("AlreadyTerminating")
	RequestStatusAlreadyUnavailable = RequestStatus("AlreadyUnavailable")
	RequestStatusAdmittedAll        = RequestStatus("AdmittedAll")
	RequestStatusRetryAdvised       = RequestStatus("RetryAdvised")
	RequestStatusRejected           = RequestStatus("Rejected")
	RequestStatusError              = RequestStatus("Error")
)

Variables

Functions

func ProvideLogging

func ProvideLogging() component.Declared[Observer]

func ProvideMetrics

func ProvideMetrics() component.Declared[Observer]

Types

type BatchArg

type BatchArg struct {
	CellId string
	PodUid types.UID
}

Argument for webhook retry-batch-pool, moved to this package to hack import cycles.

type EndExecuteRetryErr

type EndExecuteRetryErr struct {
	Err error
}

type EndExecuteRetryRetry

type EndExecuteRetryRetry struct {
	Delay time.Duration
}

type EndExecuteRetrySuccess

type EndExecuteRetrySuccess struct {
	Results func(int) pprutil.DisruptionResult
}

type EndHandlePodInPpr

type EndHandlePodInPpr struct {
	Rejected bool
	Code     uint16
	Err      string
}

type ExecuteRetryQuota

type ExecuteRetryQuota struct {
	Before pprutil.DisruptionQuota
	After  pprutil.DisruptionQuota
}

type HttpError

type HttpError struct {
	Err error
}

type Observer

type Observer struct {
	HttpRequest         o11y.ObserveScopeFunc[Request]
	HttpRequestComplete o11y.ObserveFunc[RequestComplete]
	HttpError           o11y.ObserveFunc[HttpError]

	StartHandlePodInPpr o11y.ObserveScopeFunc[StartHandlePodInPpr]
	EndHandlePodInPpr   o11y.ObserveFunc[EndHandlePodInPpr]

	StartExecuteRetry      o11y.ObserveScopeFunc[StartExecuteRetry]
	EndExecuteRetrySuccess o11y.ObserveFunc[EndExecuteRetrySuccess]
	EndExecuteRetryRetry   o11y.ObserveFunc[EndExecuteRetryRetry]
	EndExecuteRetryErr     o11y.ObserveFunc[EndExecuteRetryErr]
	ExecuteRetryQuota      o11y.ObserveFunc[ExecuteRetryQuota]
}

func (Observer) ComponentName

func (Observer) ComponentName() string

func (Observer) Join

func (observer Observer) Join(other Observer) Observer

type Request

type Request struct {
	Cell       string
	RemoteAddr string
}

type RequestComplete

type RequestComplete struct {
	Request *admissionv1.AdmissionRequest
	Status  RequestStatus
}

type RequestStatus

type RequestStatus string

type StartExecuteRetry

type StartExecuteRetry struct {
	Key  pprutil.PodProtectorKey
	Args []BatchArg
}

type StartHandlePodInPpr

type StartHandlePodInPpr struct {
	Namespace        string
	PprName          string
	PodName          string
	DeleteUserName   string
	DeleteUserGroups []string
}

Jump to

Keyboard shortcuts

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