Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Operator ¶
type Operator interface { // ListCustomAlertingRules lists the custom alerting rules. ListCustomAlertingRules(ctx context.Context, namespace string, queryParams *v2alpha1.AlertingRuleQueryParams) (*v2alpha1.GettableAlertingRuleList, error) // ListCustomRulesAlerts lists the alerts of the custom alerting rules. ListCustomRulesAlerts(ctx context.Context, namespace string, queryParams *v2alpha1.AlertQueryParams) (*v2alpha1.AlertList, error) // GetCustomAlertingRule gets the custom alerting rule with the given name. GetCustomAlertingRule(ctx context.Context, namespace, ruleName string) (*v2alpha1.GettableAlertingRule, error) // ListCustomRuleAlerts lists the alerts of the custom alerting rule with the given name. ListCustomRuleAlerts(ctx context.Context, namespace, ruleName string) (*v2alpha1.AlertList, error) // CreateCustomAlertingRule creates a custom alerting rule. CreateCustomAlertingRule(ctx context.Context, namespace string, rule *v2alpha1.PostableAlertingRule) error // UpdateCustomAlertingRule updates the custom alerting rule with the given name. UpdateCustomAlertingRule(ctx context.Context, namespace, ruleName string, rule *v2alpha1.PostableAlertingRule) error // DeleteCustomAlertingRule deletes the custom alerting rule with the given name. DeleteCustomAlertingRule(ctx context.Context, namespace, ruleName string) error // CreateOrUpdateCustomAlertingRules creates or updates custom alerting rules in bulk. CreateOrUpdateCustomAlertingRules(ctx context.Context, namespace string, rs []*v2alpha1.PostableAlertingRule) (*v2alpha1.BulkResponse, error) // DeleteCustomAlertingRules deletes a batch of custom alerting rules. DeleteCustomAlertingRules(ctx context.Context, namespace string, ruleNames []string) (*v2alpha1.BulkResponse, error) // ListBuiltinAlertingRules lists the builtin(non-custom) alerting rules ListBuiltinAlertingRules(ctx context.Context, queryParams *v2alpha1.AlertingRuleQueryParams) (*v2alpha1.GettableAlertingRuleList, error) // ListBuiltinRulesAlerts lists the alerts of the builtin(non-custom) alerting rules ListBuiltinRulesAlerts(ctx context.Context, queryParams *v2alpha1.AlertQueryParams) (*v2alpha1.AlertList, error) // GetBuiltinAlertingRule gets the builtin(non-custom) alerting rule with the given id GetBuiltinAlertingRule(ctx context.Context, ruleId string) (*v2alpha1.GettableAlertingRule, error) // ListBuiltinRuleAlerts lists the alerts of the builtin(non-custom) alerting rule with the given id ListBuiltinRuleAlerts(ctx context.Context, ruleId string) (*v2alpha1.AlertList, error) }
Operator contains all operations to alerting rules. The operations may involve manipulations of prometheusrule custom resources where the rules are persisted, and querying the rules state from prometheus endpoint and thanos ruler endpoint. For the following apis, if namespace is empty, do operations to alerting rules with cluster level, or do operations only to rules of the specified namespaces. All custom rules will be configured for thanos ruler, so the operations to custom alerting rule can not be done if thanos ruler is not enabled.
func NewOperator ¶
func NewOperator(informers informers.InformerFactory, promResourceClient promresourcesclient.Interface, ruleClient alerting.RuleClient, option *alerting.Options) Operator
Click to show internal directories.
Click to hide internal directories.