mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-05 07:37:30 +01:00
Reduce noise in info log
This commit is contained in:
@@ -309,7 +309,7 @@ func (t *JobClassTagger) Register() error {
|
||||
func (t *JobClassTagger) Match(job *schema.Job) {
|
||||
jobStats, err := t.getStatistics(job)
|
||||
metricsList := t.getMetricConfig(job.Cluster, job.SubCluster)
|
||||
cclog.Infof("Enter match rule with %d rules for job %d", len(t.rules), job.JobID)
|
||||
cclog.Debugf("Enter match rule with %d rules for job %d", len(t.rules), job.JobID)
|
||||
if err != nil {
|
||||
cclog.Errorf("job classification failed for job %d: %#v", job.JobID, err)
|
||||
return
|
||||
@@ -321,7 +321,7 @@ func (t *JobClassTagger) Match(job *schema.Job) {
|
||||
for tag, ri := range t.rules {
|
||||
env := make(map[string]any)
|
||||
maps.Copy(env, ri.env)
|
||||
cclog.Infof("Try to match rule %s for job %d", tag, job.JobID)
|
||||
cclog.Debugf("Try to match rule %s for job %d", tag, job.JobID)
|
||||
|
||||
// Initialize environment
|
||||
env["job"] = map[string]any{
|
||||
@@ -369,7 +369,7 @@ func (t *JobClassTagger) Match(job *schema.Job) {
|
||||
break
|
||||
}
|
||||
if !ok.(bool) {
|
||||
cclog.Infof("requirement for rule %s not met", tag)
|
||||
cclog.Debugf("requirement for rule %s not met", tag)
|
||||
requirementsMet = false
|
||||
break
|
||||
}
|
||||
@@ -399,7 +399,6 @@ func (t *JobClassTagger) Match(job *schema.Job) {
|
||||
continue
|
||||
}
|
||||
if match.(bool) {
|
||||
cclog.Info("Rule matches!")
|
||||
if !t.repo.HasTag(id, t.tagType, tag) {
|
||||
if _, err := t.repo.AddTagOrCreateDirect(id, t.tagType, tag); err != nil {
|
||||
cclog.Errorf("failed to add tag '%s' to job %d: %v", tag, id, err)
|
||||
@@ -414,8 +413,6 @@ func (t *JobClassTagger) Match(job *schema.Job) {
|
||||
continue
|
||||
}
|
||||
messages = append(messages, msg.String())
|
||||
} else {
|
||||
cclog.Info("Rule does not match!")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -178,24 +178,24 @@ func (t *AppTagger) Match(job *schema.Job) {
|
||||
|
||||
metadata, err := r.FetchMetadata(job)
|
||||
if err != nil {
|
||||
cclog.Infof("AppTagger: cannot fetch metadata for job %d on %s: %v", job.JobID, job.Cluster, err)
|
||||
cclog.Debugf("AppTagger: cannot fetch metadata for job %d on %s: %v", job.JobID, job.Cluster, err)
|
||||
return
|
||||
}
|
||||
|
||||
if metadata == nil {
|
||||
cclog.Infof("AppTagger: metadata is nil for job %d on %s", job.JobID, job.Cluster)
|
||||
cclog.Debugf("AppTagger: metadata is nil for job %d on %s", job.JobID, job.Cluster)
|
||||
return
|
||||
}
|
||||
|
||||
jobscript, ok := metadata["jobScript"]
|
||||
if !ok {
|
||||
cclog.Infof("AppTagger: no 'jobScript' key in metadata for job %d on %s (keys: %v)",
|
||||
cclog.Debugf("AppTagger: no 'jobScript' key in metadata for job %d on %s (keys: %v)",
|
||||
job.JobID, job.Cluster, metadataKeys(metadata))
|
||||
return
|
||||
}
|
||||
|
||||
if len(jobscript) == 0 {
|
||||
cclog.Infof("AppTagger: empty jobScript for job %d on %s", job.JobID, job.Cluster)
|
||||
cclog.Debugf("AppTagger: empty jobScript for job %d on %s", job.JobID, job.Cluster)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ func (t *AppTagger) Match(job *schema.Job) {
|
||||
if r.HasTag(id, t.tagType, a.tag) {
|
||||
cclog.Debugf("AppTagger: job %d already has tag %s:%s, skipping", id, t.tagType, a.tag)
|
||||
} else {
|
||||
cclog.Infof("AppTagger: pattern '%s' matched for app '%s' on job %d", re.String(), a.tag, id)
|
||||
cclog.Debugf("AppTagger: pattern '%s' matched for app '%s' on job %d", re.String(), a.tag, id)
|
||||
if _, err := r.AddTagOrCreateDirect(id, t.tagType, a.tag); err != nil {
|
||||
cclog.Errorf("AppTagger: failed to add tag '%s' to job %d: %v", a.tag, id, err)
|
||||
}
|
||||
|
||||
@@ -166,10 +166,10 @@ func (m *MemoryStore) HealthCheck(cluster string,
|
||||
healthyCount := len(expectedMetrics) - degradedCount - missingCount
|
||||
|
||||
if degradedCount > 0 {
|
||||
cclog.ComponentInfo("metricstore", "HealthCheck: node ", hostname, "degraded metrics:", degradedList)
|
||||
cclog.ComponentDebug("metricstore", "HealthCheck: node ", hostname, "degraded metrics:", degradedList)
|
||||
}
|
||||
if missingCount > 0 {
|
||||
cclog.ComponentInfo("metricstore", "HealthCheck: node ", hostname, "missing metrics:", missingList)
|
||||
cclog.ComponentDebug("metricstore", "HealthCheck: node ", hostname, "missing metrics:", missingList)
|
||||
}
|
||||
|
||||
var state schema.MonitoringState
|
||||
|
||||
Reference in New Issue
Block a user