mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
nomad: only lookup job is disable_dispatched_job_summary_metrics is set
This commit is contained in:
@@ -624,12 +624,15 @@ func (s *Server) publishJobSummaryMetrics(stopCh chan struct{}) {
|
||||
break
|
||||
}
|
||||
summary := raw.(*structs.JobSummary)
|
||||
job, err := state.JobByID(ws, summary.Namespace, summary.JobID)
|
||||
if err != nil {
|
||||
s.logger.Printf("[ERR] nomad: failed to lookup job for summary: %v", err)
|
||||
}
|
||||
if s.config.DisableDispatchedJobSummaryMetrics && job.Dispatched {
|
||||
continue
|
||||
if s.config.DisableDispatchedJobSummaryMetrics {
|
||||
job, err := state.JobByID(ws, summary.Namespace, summary.JobID)
|
||||
if err != nil {
|
||||
s.logger.Printf("[ERR] nomad: failed to lookup job for summary: %v", err)
|
||||
continue
|
||||
}
|
||||
if job.Dispatched {
|
||||
continue
|
||||
}
|
||||
}
|
||||
s.iterateJobSummaryMetrics(summary)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user