alerting

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KVLastNotificationTime = "alert_last_notification_time"
	KVLastTermStartTime    = "alert_last_term_start_time"
	KVLastEscalationTime   = "alert_last_escalation_time"
	KVLastMessageState     = "alert_last_message_state"
)
View Source
const (
	ParamRuleID         = "rule_id"       //规则 UUID
	ParamResourceID     = "resource_id"   // 资源 UUID
	ParamResourceName   = "resource_name" // 资源名称 如集群名称 es-v714
	ParamEventID        = "event_id"      // 检查事件 ID
	ParamResults        = "results"       //
	ParamMessage        = "message"       //检查消息 自定义(模版渲染)
	ParamTitle          = "title"
	ParamThreshold      = "threshold"    //检查预设值 []string
	ParamResultValue    = "result_value" //检查结果 {group_tags:["cluster-xxx", "node-xxx"], check_values:[]}
	Priority            = "priority"     //告警等级
	ParamTimestamp      = "timestamp"    //事件产生时间戳
	ParamGroupValues    = "group_values"
	ParamIssueTimestamp = "issue_timestamp"
	ParamRelationValues = "relation_values"
)

Variables

This section is empty.

Functions

func GetEnvVariables

func GetEnvVariables() (map[string]interface{}, error)

func GetInnerConsoleEndpoint

func GetInnerConsoleEndpoint() (string, error)

func InitTasks

func InitTasks() error

func RegistEngine

func RegistEngine(typ string, engine Engine)

Types

type Engine

type Engine interface {
	GenerateQuery(rule *alerting.Rule, filterParam *alerting.FilterParam) (interface{}, error)
	ExecuteQuery(rule *alerting.Rule, filterParam *alerting.FilterParam) (*alerting.QueryResult, error)
	CheckCondition(rule *alerting.Rule) (*alerting.ConditionResult, error)
	GenerateTask(rule alerting.Rule) func(ctx context.Context)
	Test(rule *alerting.Rule, msgType string) ([]alerting.ActionExecutionResult, error)
	GetTargetMetricData(rule *alerting.Rule, isFilterNaN bool, filterParam *alerting.FilterParam) ([]alerting.MetricData, *alerting.QueryResult, error)
}

func GetEngine

func GetEngine(typ string) Engine

type ParameterMeta

type ParameterMeta struct {
	Name        string          `json:"name"`
	Type        string          `json:"type"` //int, float, string, date, array, object
	Description string          `json:"description"`
	Eg          string          `json:"eg,omitempty"`
	Properties  []ParameterMeta `json:"properties,omitempty"`
}

func GetTemplateParameters

func GetTemplateParameters() []ParameterMeta

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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