manager

package
v2.2.9-ent2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

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

func (*AlertManager) SendAlert

func (m *AlertManager) SendAlert(labels map[string]string) error

type AlertStatus

type AlertStatus struct {
	State       State    `json:"state"`
	SilencedBy  []string `json:"silencedBy"`
	InhibitedBy []string `json:"inhibitedBy"`
}

type Matcher

type Matcher struct {
	Name    string `json:"name"`
	Value   string `json:"value"`
	IsRegex bool   `json:"isRegex"`
	// contains filtered or unexported fields
}

type Matchers

type Matchers []*Matcher

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"`
}

type State

type State string

Jump to

Keyboard shortcuts

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