Documentation ¶
Index ¶
- Variables
- type ValidatingAdmissionPolicyMetrics
- func (m *ValidatingAdmissionPolicyMetrics) ObserveAdmission(ctx context.Context, elapsed time.Duration, policy, binding string, ...)
- func (m *ValidatingAdmissionPolicyMetrics) ObserveAudit(ctx context.Context, elapsed time.Duration, policy, binding string, ...)
- func (m *ValidatingAdmissionPolicyMetrics) ObserveRejection(ctx context.Context, elapsed time.Duration, policy, binding string, ...)
- func (m *ValidatingAdmissionPolicyMetrics) ObserveWarn(ctx context.Context, elapsed time.Duration, policy, binding string, ...)
- func (m *ValidatingAdmissionPolicyMetrics) Reset()
- type ValidationErrorType
Constants ¶
This section is empty.
Variables ¶
var (
// Metrics provides access to validation admission metrics.
Metrics = newValidationAdmissionMetrics()
)
Functions ¶
This section is empty.
Types ¶
type ValidatingAdmissionPolicyMetrics ¶
type ValidatingAdmissionPolicyMetrics struct {
// contains filtered or unexported fields
}
ValidatingAdmissionPolicyMetrics aggregates Prometheus metrics related to validation admission control.
func (*ValidatingAdmissionPolicyMetrics) ObserveAdmission ¶ added in v0.31.0
func (m *ValidatingAdmissionPolicyMetrics) ObserveAdmission(ctx context.Context, elapsed time.Duration, policy, binding string, errorType ValidationErrorType)
ObserveAdmission observes a policy validation, with an optional error to indicate the error that may occur but ignored.
func (*ValidatingAdmissionPolicyMetrics) ObserveAudit ¶
func (m *ValidatingAdmissionPolicyMetrics) ObserveAudit(ctx context.Context, elapsed time.Duration, policy, binding string, errorType ValidationErrorType)
ObserveAudit observes a policy validation audit annotation was published for a validation failure.
func (*ValidatingAdmissionPolicyMetrics) ObserveRejection ¶
func (m *ValidatingAdmissionPolicyMetrics) ObserveRejection(ctx context.Context, elapsed time.Duration, policy, binding string, errorType ValidationErrorType)
ObserveRejection observes a policy validation error that was at least one of the reasons for a deny.
func (*ValidatingAdmissionPolicyMetrics) ObserveWarn ¶
func (m *ValidatingAdmissionPolicyMetrics) ObserveWarn(ctx context.Context, elapsed time.Duration, policy, binding string, errorType ValidationErrorType)
ObserveWarn observes a policy validation warning was published for a validation failure.
func (*ValidatingAdmissionPolicyMetrics) Reset ¶
func (m *ValidatingAdmissionPolicyMetrics) Reset()
Reset resets all validation admission-related Prometheus metrics.
type ValidationErrorType ¶ added in v0.31.0
type ValidationErrorType string
ValidationErrorType defines different error types that happen to a validation expression
const ( // ValidationCompileError indicates that the expression fails to compile. ValidationCompileError ValidationErrorType = "compile_error" // ValidatingInvalidError indicates that the expression fails due to internal // errors that are out of the control of the user. ValidatingInvalidError ValidationErrorType = "invalid_error" // ValidatingOutOfBudget indicates that the expression fails due to running // out of cost budget, or the budget cannot be obtained. ValidatingOutOfBudget ValidationErrorType = "out_of_budget" // ValidationNoError indicates that the expression returns without an error. ValidationNoError ValidationErrorType = "no_error" )
func ErrorType ¶ added in v0.31.0
func ErrorType(err error) ValidationErrorType
ErrorType decodes the error to determine the error type that the metrics understand.