Skip to content

Commit

Permalink
Merge pull request kubernetes#808 from mm4tt/not-ready-targets
Browse files Browse the repository at this point in the history
Prometheus: log example not ready target
  • Loading branch information
k8s-ci-robot authored Sep 23, 2019
2 parents 86234ca + 91d6c49 commit 29291e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clusterloader2/pkg/prometheus/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ func CheckTargetsReady(k8sClient kubernetes.Interface, selector func(Target) boo
return false, err // This shouldn't happen, return error.
}
nReady, nTotal := 0, 0
var exampleNotReadyTarget Target
for _, t := range response.Data.ActiveTargets {
if !selector(t) {
continue
}
nTotal++
if t.Health == "up" {
nReady++
continue
}
exampleNotReadyTarget = t
}
if nTotal < minActiveTargets {
klog.Infof("Not enough active targets (%d), expected at least (%d), waiting for more to become active...",
Expand All @@ -82,7 +85,7 @@ func CheckTargetsReady(k8sClient kubernetes.Interface, selector func(Target) boo
minReadyTargets = nTotal
}
if nReady < minReadyTargets {
klog.Infof("%d/%d targets are ready", nReady, minReadyTargets)
klog.Infof("%d/%d targets are ready, example not ready target: %v", nReady, minReadyTargets, exampleNotReadyTarget)
return false, nil
}
klog.Infof("All %d expected targets are ready", minReadyTargets)
Expand Down

0 comments on commit 29291e8

Please sign in to comment.