2020-02-16 18:59:02 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
// Annotations basic annotation for alert rule
|
|
|
|
type Annotations struct {
|
|
|
|
Summary string
|
|
|
|
Description string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Alert basic alert entity rule
|
|
|
|
type Alert struct {
|
|
|
|
Name string
|
|
|
|
Expr string
|
|
|
|
For time.Duration
|
2020-02-21 21:15:05 +00:00
|
|
|
Labels map[string]string
|
2020-02-16 18:59:02 +00:00
|
|
|
Annotations Annotations
|
2020-02-21 21:15:05 +00:00
|
|
|
|
|
|
|
Start time.Time
|
|
|
|
End time.Time
|
2020-02-16 18:59:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Group grouping array of alert
|
|
|
|
type Group struct {
|
|
|
|
Name string
|
|
|
|
Rules []Alert
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parse parses config from given file
|
|
|
|
func Parse(filepath string) ([]Group, error) {
|
|
|
|
return []Group{}, nil
|
|
|
|
}
|