Documentation
¶
Index ¶
- Variables
- func DebugNotifyFunc(logger log.Logger) rules.NotifyFunc
- func HTTPNotifyFunc(logger log.Logger, token string, url string, retries int) rules.NotifyFunc
- func HTTPQueryFunc(logger log.Logger, url string) rules.QueryFunc
- func NewMockStorage() (storage.Storage, error)
- type Alert
- type Config
- type M
- type Manager
- type MockStorage
- type NotifyAlert
- type Prom
- type PromRules
- type PromsResp
- type Reloader
- type Rule
- type Rules
- type RulesResp
- type S
Constants ¶
This section is empty.
Variables ¶
View Source
var RuleDir = "/tmp"
Functions ¶
func HTTPNotifyFunc ¶
HTTPNotifyFunc whit resolved;
func HTTPQueryFunc ¶
HTTPQueryFunc TODO: use http keep-alive
func NewMockStorage ¶
NewMockStorage create temporary storage
Types ¶
type Config ¶
type Config struct {
NotifyReties int
AlertManagerUrl string
GatewayURL string
GatewayPathRule string
GatewayPathProm string
GatewayPathNotify string
EvaluationInterval model.Duration
ReloadInterval model.Duration
AuthToken string
PromlogConfig promlog.Config
}
Config ...
type Manager ¶
type Manager struct {
Config Config
Prom Prom
Options *rules.ManagerOptions
Manager *rules.Manager
Rules Rules
// contains filtered or unexported fields
}
Manager ...
func NewManager ¶
NewManager ...
type MockStorage ¶
MockStorage temporary storage
func (MockStorage) Close ¶
func (s MockStorage) Close() error
Close delete temporary files when closed
type NotifyAlert ¶
type NotifyAlert struct {
// Label value pairs for purpose of aggregation, matching, and disposition
// dispatching. This must minimally include an "alertname" label.
Labels labels.Labels `json:"labels"`
// Extra key/value information which does not define alert identity.
Annotations labels.Labels `json:"annotations"`
// The known time range for this alert. Both ends are optional.
StartsAt time.Time `json:"startsAt,omitempty"`
EndsAt time.Time `json:"endsAt,omitempty"`
GeneratorURL string `json:"generatorURL,omitempty"`
}
type Rule ¶
type Rule struct {
ID int64 `json:"id"`
AlertN string `json:"alertn"`
Cluster string `json:"cluster"`
Severity string `json:"severity"`
Type string `json:"type"`
ProjectName string `json:"project_name"`
AppName string `json:"app_name"`
Env string `json:"env"`
PromID int64 `json:"prom_id"`
Expr string `json:"expr"`
Op string `json:"op"`
Value string `json:"value"`
For string `json:"for"`
Labels map[string]string `json:"labels"`
//Labels Labels
Summary string `json:"summary"`
Description string `json:"description"`
}
Rule ...
Click to show internal directories.
Click to hide internal directories.