Documentation ¶
Index ¶
- func BuildMatchers(alertEvent *model.MonitorAlertEvent, l *zap.Logger, useName bool) ([]*labels.Matcher, error)
- func CheckAlertIpExists(req *model.MonitorAlertManagerPool, rules []*model.MonitorAlertManagerPool) bool
- func CheckPoolIpExists(req *model.MonitorScrapePool, pools []*model.MonitorScrapePool) bool
- func CloneMap(original map[string]string) map[string]string
- func DeepCopyScrapeConfig(sc *pc.ScrapeConfig) *pc.ScrapeConfig
- func FormatMap(m map[string]string) string
- func FromSliceTuMap(kvs []string) map[string]string
- func GenPromDuration(seconds int) pm.Duration
- func HandleList[T any](ctx context.Context, search *string, ...) ([]*T, error)
- func ParseExternalLabels(labelsList []string) []string
- func ParseTags(tags []string) (map[promModel.LabelName]promModel.LabelValue, error)
- func ParseURL(u string) (*pcc.URL, error)
- func PostWithJson(ctx context.Context, client *http.Client, l *zap.Logger, url string, ...) ([]byte, error)
- func PromqlExprCheck(expr string) (bool, error)
- func SendSilenceRequest(ctx context.Context, l *zap.Logger, url string, data []byte) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMatchers ¶
func CheckAlertIpExists ¶
func CheckAlertIpExists(req *model.MonitorAlertManagerPool, rules []*model.MonitorAlertManagerPool) bool
func CheckPoolIpExists ¶
func CheckPoolIpExists(req *model.MonitorScrapePool, pools []*model.MonitorScrapePool) bool
func DeepCopyScrapeConfig ¶
func DeepCopyScrapeConfig(sc *pc.ScrapeConfig) *pc.ScrapeConfig
DeepCopyScrapeConfig 深度拷贝 ScrapeConfig
func FromSliceTuMap ¶
func GenPromDuration ¶
GenPromDuration 转换秒为Prometheus Duration
func HandleList ¶
func HandleList[T any](ctx context.Context, search *string, searchFunc func(ctx context.Context, name string) ([]*T, error), listFunc func(ctx context.Context) ([]*T, error)) ([]*T, error)
HandleList 处理搜索或获取所有记录
func ParseExternalLabels ¶
ParseExternalLabels 解析外部标签
func PostWithJson ¶
func PostWithJson(ctx context.Context, client *http.Client, l *zap.Logger, url string, jsonStr string, params map[string]string, headers map[string]string) ([]byte, error)
PostWithJson 发送带有JSON字符串的POST请求
func PromqlExprCheck ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.