Documentation ¶
Index ¶
- Variables
- func WithControllerMetrics(i admission.Interface, name string) admission.Interface
- func WithMetrics(i admission.Interface, observer ObserverFunc, extraLabels ...string) admission.Interface
- func WithStepMetrics(i admission.Interface) admission.Interface
- type AdmissionMetrics
- func (m *AdmissionMetrics) ObserveAdmissionController(elapsed time.Duration, rejected bool, attr admission.Attributes, ...)
- func (m *AdmissionMetrics) ObserveAdmissionStep(elapsed time.Duration, rejected bool, attr admission.Attributes, ...)
- func (m *AdmissionMetrics) ObserveWebhook(elapsed time.Duration, rejected bool, attr admission.Attributes, ...)
- type ObserverFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// Metrics provides access to all admission metrics.
Metrics = newAdmissionMetrics()
)
Functions ¶
func WithControllerMetrics ¶
WithControllerMetrics is a decorator for named admission handlers.
func WithMetrics ¶
func WithMetrics(i admission.Interface, observer ObserverFunc, extraLabels ...string) admission.Interface
WithMetrics is a decorator for admission handlers with a generic observer func.
Types ¶
type AdmissionMetrics ¶
type AdmissionMetrics struct {
// contains filtered or unexported fields
}
AdmissionMetrics instruments admission with prometheus metrics.
func (*AdmissionMetrics) ObserveAdmissionController ¶
func (m *AdmissionMetrics) ObserveAdmissionController(elapsed time.Duration, rejected bool, attr admission.Attributes, stepType string, extraLabels ...string)
ObserveAdmissionController records admission related metrics for a built-in admission controller, identified by it's plugin handler name.
func (*AdmissionMetrics) ObserveAdmissionStep ¶
func (m *AdmissionMetrics) ObserveAdmissionStep(elapsed time.Duration, rejected bool, attr admission.Attributes, stepType string, extraLabels ...string)
ObserveAdmissionStep records admission related metrics for a admission step, identified by step type.
func (*AdmissionMetrics) ObserveWebhook ¶
func (m *AdmissionMetrics) ObserveWebhook(elapsed time.Duration, rejected bool, attr admission.Attributes, stepType string, extraLabels ...string)
ObserveWebhook records admission related metrics for a admission webhook.
type ObserverFunc ¶
type ObserverFunc func(elapsed time.Duration, rejected bool, attr admission.Attributes, stepType string, extraLabels ...string)
ObserverFunc is a func that emits metrics.
Click to show internal directories.
Click to hide internal directories.