Documentation ¶
Index ¶
- Constants
- func DeletePrometheusRuleAndReload(ids []string) error
- func GetMysqlInstance() *gorm.DB
- func GetPrometheusMetricValue(metric string) (interface{}, error)
- func ModifyPrometheusRuleAndReload(alertRules []*models.AlertRules) error
- func NewMysqlInstanceByConn(conf *mysql.MysqlConfig) (*gorm.DB, error)
- func PostPrometheusReload() error
- func ReadRule() ([]byte, error)
- func StrArrayIsContain(arr []string, str string) bool
- func WriteRule(ruleBytes []byte) error
- type GroupsYml
- type PrometheusYml
- type RuleYml
Constants ¶
View Source
const ( RuleStatusDisabled = 0 RuleStatusEnable = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetMysqlInstance ¶
func ModifyPrometheusRuleAndReload ¶
func ModifyPrometheusRuleAndReload(alertRules []*models.AlertRules) error
func NewMysqlInstanceByConn ¶
func NewMysqlInstanceByConn(conf *mysql.MysqlConfig) (*gorm.DB, error)
func PostPrometheusReload ¶
func PostPrometheusReload() error
func StrArrayIsContain ¶
Types ¶
type PrometheusYml ¶
type PrometheusYml struct {
Groups []*GroupsYml `yaml:"groups"`
}
type RuleYml ¶
type RuleYml struct { Alert string `yaml:"alert"` Annotations map[string]string `yaml:"annotations"` Expr string `yaml:"expr"` For string `yaml:"for"` Labels map[string]string `yaml:"labels"` }
func CreatAndUpdateRule ¶
func CreatAndUpdateRule(ruleYml *RuleYml, alertRule *models.AlertRules) *RuleYml
Click to show internal directories.
Click to hide internal directories.