Documentation
¶
Index ¶
- func BuildMatchers(alertEvent *model.MonitorAlertEvent, l *zap.Logger, useName int8) ([]*labels.Matcher, error)
- func CalculateAlertHash(pool *model.MonitorAlertManagerPool) string
- func CalculatePromHash(pool *model.MonitorScrapePool) string
- func CloneMap(original map[string]string) map[string]string
- func CopyMap[K comparable, V any](src map[K]V) map[K]V
- 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) promModel.Duration
- 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 ValidateScrapeTiming(interval, timeout int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMatchers ¶
func CalculateAlertHash ¶
func CalculateAlertHash(pool *model.MonitorAlertManagerPool) string
func CalculatePromHash ¶
func CalculatePromHash(pool *model.MonitorScrapePool) string
CalculatePromHash 计算哈希值(不修改入参数据)
func DeepCopyScrapeConfig ¶
func DeepCopyScrapeConfig(sc *pc.ScrapeConfig) *pc.ScrapeConfig
DeepCopyScrapeConfig 深度拷贝 ScrapeConfig
func FromSliceTuMap ¶
func GenPromDuration ¶
GenPromDuration 转换秒为Prometheus Duration
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 ¶
func ValidateScrapeTiming ¶
ValidateScrapeTiming 校验采集间隔与超时时间
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.