mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
Ensure that we fail if there are no upstreams
This commit is contained in:
5
main.go
5
main.go
@@ -57,6 +57,7 @@ func setupUpstreams() {
|
||||
z := strings.SplitN(s, ":", 2)
|
||||
if len(z) != 2 {
|
||||
log.Fatalf("Invalid Alertmanager URI '%s', expected format 'name:uri'", s)
|
||||
continue
|
||||
}
|
||||
name := z[0]
|
||||
uri := z[1]
|
||||
@@ -75,6 +76,10 @@ func main() {
|
||||
|
||||
setupUpstreams()
|
||||
|
||||
if len(alertmanager.GetAlertmanagers()) == 0 {
|
||||
log.Fatal("No valid Alertmanager URIs defined")
|
||||
}
|
||||
|
||||
// before we start try to fetch data from Alertmanager
|
||||
log.Infof("Initial Alertmanager query, this can delay startup up to %s", 3*config.Config.AlertmanagerTimeout)
|
||||
pullFromAlertmanager()
|
||||
|
||||
Reference in New Issue
Block a user