apiserver: k8s.io/apiserver/pkg/admission/metrics Index | Files

package metrics

import "k8s.io/apiserver/pkg/admission/metrics"

Index

Package Files

metrics.go

Variables

var (

    // Metrics provides access to all admission metrics.
    Metrics = newAdmissionMetrics()
)

func WithControllerMetrics Uses

func WithControllerMetrics(i admission.Interface, name string) admission.Interface

WithControllerMetrics is a decorator for named admission handlers.

func WithMetrics Uses

func WithMetrics(i admission.Interface, observer ObserverFunc, extraLabels ...string) admission.Interface

WithMetrics is a decorator for admission handlers with a generic observer func.

func WithStepMetrics Uses

func WithStepMetrics(i admission.Interface) admission.Interface

WithStepMetrics is a decorator for a whole admission phase, i.e. admit or validation.admission step.

type AdmissionMetrics Uses

type AdmissionMetrics struct {
    // contains filtered or unexported fields
}

AdmissionMetrics instruments admission with prometheus metrics.

func (*AdmissionMetrics) ObserveAdmissionController Uses

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 Uses

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 Uses

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.

func (*AdmissionMetrics) ObserveWebhookRejection Uses

func (m *AdmissionMetrics) ObserveWebhookRejection(name, stepType, operation string, errorType WebhookRejectionErrorType, rejectionCode int)

ObserveWebhookRejection records admission related metrics for an admission webhook rejection.

type ObserverFunc Uses

type ObserverFunc func(elapsed time.Duration, rejected bool, attr admission.Attributes, stepType string, extraLabels ...string)

ObserverFunc is a func that emits metrics.

type WebhookRejectionErrorType Uses

type WebhookRejectionErrorType string

WebhookRejectionErrorType defines different error types that happen in a webhook rejection.

const (

    // WebhookRejectionCallingWebhookError identifies a calling webhook error which causes
    // a webhook admission to reject a request
    WebhookRejectionCallingWebhookError WebhookRejectionErrorType = "calling_webhook_error"
    // WebhookRejectionAPIServerInternalError identifies an apiserver internal error which
    // causes a webhook admission to reject a request
    WebhookRejectionAPIServerInternalError WebhookRejectionErrorType = "apiserver_internal_error"
    // WebhookRejectionNoError identifies a webhook properly rejected a request
    WebhookRejectionNoError WebhookRejectionErrorType = "no_error"
)

Package metrics imports 7 packages (graph) and is imported by 9 packages. Updated 2019-10-17. Refresh now. Tools for package owners.