Reduce noise in info log

This commit is contained in:
2026-03-04 15:14:35 +01:00
parent 75591eb034
commit 67a17b5306
3 changed files with 10 additions and 13 deletions

View File

@@ -309,7 +309,7 @@ func (t *JobClassTagger) Register() error {
func (t *JobClassTagger) Match(job *schema.Job) { func (t *JobClassTagger) Match(job *schema.Job) {
jobStats, err := t.getStatistics(job) jobStats, err := t.getStatistics(job)
metricsList := t.getMetricConfig(job.Cluster, job.SubCluster) 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 { if err != nil {
cclog.Errorf("job classification failed for job %d: %#v", job.JobID, err) cclog.Errorf("job classification failed for job %d: %#v", job.JobID, err)
return return
@@ -321,7 +321,7 @@ func (t *JobClassTagger) Match(job *schema.Job) {
for tag, ri := range t.rules { for tag, ri := range t.rules {
env := make(map[string]any) env := make(map[string]any)
maps.Copy(env, ri.env) 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 // Initialize environment
env["job"] = map[string]any{ env["job"] = map[string]any{
@@ -369,7 +369,7 @@ func (t *JobClassTagger) Match(job *schema.Job) {
break break
} }
if !ok.(bool) { if !ok.(bool) {
cclog.Infof("requirement for rule %s not met", tag) cclog.Debugf("requirement for rule %s not met", tag)
requirementsMet = false requirementsMet = false
break break
} }
@@ -399,7 +399,6 @@ func (t *JobClassTagger) Match(job *schema.Job) {
continue continue
} }
if match.(bool) { if match.(bool) {
cclog.Info("Rule matches!")
if !t.repo.HasTag(id, t.tagType, tag) { if !t.repo.HasTag(id, t.tagType, tag) {
if _, err := t.repo.AddTagOrCreateDirect(id, t.tagType, tag); err != nil { 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) 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 continue
} }
messages = append(messages, msg.String()) messages = append(messages, msg.String())
} else {
cclog.Info("Rule does not match!")
} }
} }

View File

@@ -178,24 +178,24 @@ func (t *AppTagger) Match(job *schema.Job) {
metadata, err := r.FetchMetadata(job) metadata, err := r.FetchMetadata(job)
if err != nil { 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 return
} }
if metadata == nil { 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 return
} }
jobscript, ok := metadata["jobScript"] jobscript, ok := metadata["jobScript"]
if !ok { 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)) job.JobID, job.Cluster, metadataKeys(metadata))
return return
} }
if len(jobscript) == 0 { 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 return
} }
@@ -210,7 +210,7 @@ func (t *AppTagger) Match(job *schema.Job) {
if r.HasTag(id, t.tagType, a.tag) { if r.HasTag(id, t.tagType, a.tag) {
cclog.Debugf("AppTagger: job %d already has tag %s:%s, skipping", id, t.tagType, a.tag) cclog.Debugf("AppTagger: job %d already has tag %s:%s, skipping", id, t.tagType, a.tag)
} else { } 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 { 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) cclog.Errorf("AppTagger: failed to add tag '%s' to job %d: %v", a.tag, id, err)
} }

View File

@@ -166,10 +166,10 @@ func (m *MemoryStore) HealthCheck(cluster string,
healthyCount := len(expectedMetrics) - degradedCount - missingCount healthyCount := len(expectedMetrics) - degradedCount - missingCount
if degradedCount > 0 { if degradedCount > 0 {
cclog.ComponentInfo("metricstore", "HealthCheck: node ", hostname, "degraded metrics:", degradedList) cclog.ComponentDebug("metricstore", "HealthCheck: node ", hostname, "degraded metrics:", degradedList)
} }
if missingCount > 0 { 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 var state schema.MonitoringState