Skip to content

Commit

Permalink
add better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrennz committed Dec 4, 2024
1 parent 59de324 commit 6ab217a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/diagnostic/kms/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ func (c *checker) Check(_ context.Context, client *http.Client, accessor status.
metrics := string(body)
allMetricsFound := true
for _, metric := range c.cfg.Prometheus.KubeMetrics {
if !strings.Contains(metrics, metric) {
if strings.Contains(metrics, metric) {
c.logger.Infof("Found required metric %s on attempt %d", metric, attempt)
} else {
c.logger.Errorf("Required metric %s not found on attempt %d", metric, attempt)
accessor.AddCheck(&status.StatusCheck{Name: DiagnosticKMS, Passing: false, Error: fmt.Sprintf("Required metric %s not found", metric)})
allMetricsFound = false
Expand Down

0 comments on commit 6ab217a

Please sign in to comment.