operatorrules

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: Apache-2.0 Imports: 9 Imported by: 12

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 added in v0.0.11

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 added in v0.0.22

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

func NewRegistry added in v0.0.22

func NewRegistry() *Registry

func (*Registry) BuildPrometheusRule added in v0.0.22

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 added in v0.0.22

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

ListAlerts returns the registered alerts.

func (*Registry) ListRecordingRules added in v0.0.22

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

ListRecordingRules returns the registered recording rules.

func (*Registry) RegisterAlerts added in v0.0.22

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

RegisterAlerts registers the given alerts.

func (*Registry) RegisterRecordingRules added in v0.0.22

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