Documentation ¶
Index ¶
- Constants
- Variables
- func GetAlertManagerDefaultConfig() *alertconfig.Config
- func Metric2Rule(groupID, ruleID, serverity, displayName, clusterName, projectName string, ...) monitoringv1.Rule
- type APIAlert
- type AlertManager
- func (m *AlertManager) AddSilenceRule(matcherName, matcherValue string) error
- func (m *AlertManager) GetAlertList() ([]*APIAlert, error)
- func (m *AlertManager) GetAlertManagerEndpoint() (string, error)
- func (m *AlertManager) GetState(matcherName, matcherValue string, apiAlerts []*APIAlert) string
- func (m *AlertManager) RemoveSilenceRule(matcherName, matcherValue string) error
- func (m *AlertManager) SendAlert(labels map[string]string) error
- type AlertStatus
- type Matcher
- type Matchers
- type PromOperatorCRDManager
- func (c *PromOperatorCRDManager) AddRule(ruleGroup *monitoringv1.RuleGroup, rule monitoringv1.Rule)
- func (c *PromOperatorCRDManager) AddRuleGroup(promRule *monitoringv1.PrometheusRule, ruleGroup monitoringv1.RuleGroup)
- func (c *PromOperatorCRDManager) DeletePrometheusRule(namespace, name string) error
- func (c *PromOperatorCRDManager) GetDefaultPrometheusRule(namespace, name string) *monitoringv1.PrometheusRule
- func (c *PromOperatorCRDManager) GetRuleGroup(name string) *monitoringv1.RuleGroup
- func (c *PromOperatorCRDManager) SyncPrometheusRule(promRule *monitoringv1.PrometheusRule) error
- type Silence
- type SilenceState
- type SilenceStatus
- type State
Constants ¶
View Source
const ( AlertStateUnprocessed State = "unprocessed" AlertStateActive = "active" AlertStateSuppressed = "suppressed" )
Variables ¶
View Source
var ( ComparisonEqual = "equal" ComparisonNotEqual = "not-equal" ComparisonGreaterThan = "greater-than" ComparisonLessThan = "less-than" ComparisonGreaterOrEqual = "greater-or-equal" ComparisonLessOrEqual = "less-or-equal" )
Functions ¶
func GetAlertManagerDefaultConfig ¶
func GetAlertManagerDefaultConfig() *alertconfig.Config
func Metric2Rule ¶
func Metric2Rule(groupID, ruleID, serverity, displayName, clusterName, projectName string, metric *v3.MetricRule) monitoringv1.Rule
Types ¶
type APIAlert ¶
type APIAlert struct { *model.Alert Status AlertStatus `json:"status"` Receivers []string `json:"receivers"` Fingerprint string `json:"fingerprint"` }
type AlertManager ¶
type AlertManager struct { IsDeploy bool // contains filtered or unexported fields }
func NewAlertManager ¶
func NewAlertManager(cluster *config.UserContext) *AlertManager
func (*AlertManager) AddSilenceRule ¶
func (m *AlertManager) AddSilenceRule(matcherName, matcherValue string) error
func (*AlertManager) GetAlertList ¶
func (m *AlertManager) GetAlertList() ([]*APIAlert, error)
func (*AlertManager) GetAlertManagerEndpoint ¶
func (m *AlertManager) GetAlertManagerEndpoint() (string, error)
func (*AlertManager) GetState ¶
func (m *AlertManager) GetState(matcherName, matcherValue string, apiAlerts []*APIAlert) string
func (*AlertManager) RemoveSilenceRule ¶
func (m *AlertManager) RemoveSilenceRule(matcherName, matcherValue string) error
type AlertStatus ¶
type PromOperatorCRDManager ¶
type PromOperatorCRDManager struct {
// contains filtered or unexported fields
}
func NewPrometheusCRDManager ¶
func NewPrometheusCRDManager(ctx context.Context, cluster *config.UserContext) *PromOperatorCRDManager
func (*PromOperatorCRDManager) AddRule ¶
func (c *PromOperatorCRDManager) AddRule(ruleGroup *monitoringv1.RuleGroup, rule monitoringv1.Rule)
func (*PromOperatorCRDManager) AddRuleGroup ¶
func (c *PromOperatorCRDManager) AddRuleGroup(promRule *monitoringv1.PrometheusRule, ruleGroup monitoringv1.RuleGroup)
func (*PromOperatorCRDManager) DeletePrometheusRule ¶
func (c *PromOperatorCRDManager) DeletePrometheusRule(namespace, name string) error
func (*PromOperatorCRDManager) GetDefaultPrometheusRule ¶
func (c *PromOperatorCRDManager) GetDefaultPrometheusRule(namespace, name string) *monitoringv1.PrometheusRule
func (*PromOperatorCRDManager) GetRuleGroup ¶
func (c *PromOperatorCRDManager) GetRuleGroup(name string) *monitoringv1.RuleGroup
func (*PromOperatorCRDManager) SyncPrometheusRule ¶
func (c *PromOperatorCRDManager) SyncPrometheusRule(promRule *monitoringv1.PrometheusRule) error
type Silence ¶
type Silence struct { ID string `json:"id"` Matchers Matchers `json:"matchers"` StartsAt time.Time `json:"startsAt"` EndsAt time.Time `json:"endsAt"` UpdatedAt time.Time `json:"updatedAt"` CreatedBy string `json:"createdBy"` Comment string `json:"comment,omitempty"` Status SilenceStatus `json:"status"` // contains filtered or unexported fields }
type SilenceState ¶
type SilenceState string
const ( SilenceStateExpired SilenceState = "expired" SilenceStateActive SilenceState = "active" SilenceStatePending SilenceState = "pending" )
type SilenceStatus ¶
type SilenceStatus struct {
State SilenceState `json:"state"`
}
Click to show internal directories.
Click to hide internal directories.