operatorrules

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToScheme

func AddToScheme(scheme *runtime.Scheme) error

func BuildPrometheusRule deprecated

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

Deprecated: BuildPrometheusRule is deprecated.

func BuildRoleAndRoleBinding

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

func CleanRegistry deprecated

func CleanRegistry() error

Deprecated: CleanRegistry is deprecated.

func ListAlerts deprecated

func ListAlerts() []promv1.Rule

Deprecated: ListAlerts is deprecated.

func RegisterAlerts deprecated

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

Deprecated: RegisterAlerts is deprecated.

func RegisterRecordingRules deprecated

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

Deprecated: RegisterRecordingRules is deprecated.

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 deprecated

func ListRecordingRules() []RecordingRule

Deprecated: ListRecordingRules is deprecated.

func (RecordingRule) GetOpts

GetOpts returns the metric options of the recording rule.

func (RecordingRule) GetType

GetType returns the metric type of the recording rule.

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) BuildPrometheusRule

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

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

func (*Registry) ListAlerts

func (r *Registry) ListAlerts() []promv1.Rule

ListAlerts returns the registered alerts.

func (*Registry) ListRecordingRules

func (r *Registry) ListRecordingRules() []RecordingRule

ListRecordingRules returns the registered recording rules.

func (*Registry) RegisterAlerts

func (r *Registry) RegisterAlerts(alerts ...[]promv1.Rule) error

RegisterAlerts registers the given alerts.

func (*Registry) RegisterRecordingRules

func (r *Registry) RegisterRecordingRules(recordingRules ...[]RecordingRule) error

RegisterRecordingRules registers the given recording rules.

Jump to

Keyboard shortcuts

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