operatorrules

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToScheme

func AddToScheme(scheme *runtime.Scheme) error

func BuildPrometheusRule

func BuildPrometheusRule(name, namespace string, labels map[string]string) (*promv1.PrometheusRule, error)

BuildPrometheusRule builds a PrometheusRule object from the registered recording rules and alerts.

func BuildRoleAndRoleBinding

func BuildRoleAndRoleBinding(namePrefix, namespace, promSAName, promSANamespace string, labels map[string]string) (*rbacv1.Role, *rbacv1.RoleBinding)

func CleanRegistry added in v0.0.11

func CleanRegistry() error

CleanRegistry removes all registered rules and alerts.

func ListAlerts

func ListAlerts() []promv1.Rule

ListAlerts returns the registered alerts.

func RegisterAlerts

func RegisterAlerts(alerts ...[]promv1.Rule) error

RegisterAlerts registers the given alerts.

func RegisterRecordingRules

func RegisterRecordingRules(recordingRules ...[]RecordingRule) error

RegisterRecordingRules registers the given recording rules.

Types

type RecordingRule

type RecordingRule struct {
	MetricsOpts operatormetrics.MetricOpts
	MetricType  operatormetrics.MetricType
	Expr        intstr.IntOrString
}

RecordingRule is a struct that represents a Prometheus recording rule.

func ListRecordingRules

func ListRecordingRules() []RecordingRule

ListRecordingRules returns the registered recording rules.

func (RecordingRule) GetOpts

GetOpts returns the metric options of the recording rule.

func (RecordingRule) GetType

GetType returns the metric type of the recording rule.

Jump to

Keyboard shortcuts

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