Skip to content

Commit

Permalink
Merge pull request #66 from Cloudzero/cp-23740-4
Browse files Browse the repository at this point in the history
CP-23740: Log Each Required KSM Metric
  • Loading branch information
bdrennz authored Dec 4, 2024
2 parents 035a29b + 6ab217a commit a42e5a8
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 a42e5a8

Please sign in to comment.