Skip to content

Commit

Permalink
Change job_name log fields to job for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
sysadmind committed Apr 28, 2020
1 parent 92d8371 commit 90f2708
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions dkron/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func (a *Agent) RunQuery(jobName string, ex *Execution) (*Job, error) {
return nil, fmt.Errorf("agent: RunQuery error processing filtered nodes: %w", err)
}
log.WithFields(logrus.Fields{
"job_name": job.Name,
"job": job.Name,
}).Debug("agent: Filtered nodes to run: ", filterNodes)
log.WithFields(logrus.Fields{
"job_name": job.Name,
"job": job.Name,
}).Debug("agent: Filtered tags to run: ", filterTags)

//serf match regexp but we want only match full tag
Expand Down Expand Up @@ -90,14 +90,14 @@ func (a *Agent) RunQuery(jobName string, ex *Execution) (*Job, error) {
rqpJSON, _ := json.Marshal(rqp)

log.WithFields(logrus.Fields{
"query": QueryRunJob,
"job_name": job.Name,
"query": QueryRunJob,
"job": job.Name,
}).Info("agent: Sending query")

log.WithFields(logrus.Fields{
"query": QueryRunJob,
"job_name": job.Name,
"json": string(rqpJSON),
"query": QueryRunJob,
"job": job.Name,
"json": string(rqpJSON),
}).Debug("agent: Sending query")

qr, err := a.serf.Query(QueryRunJob, rqpJSON, params)
Expand All @@ -114,26 +114,26 @@ func (a *Agent) RunQuery(jobName string, ex *Execution) (*Job, error) {
case ack, ok := <-ackCh:
if ok {
log.WithFields(logrus.Fields{
"query": QueryRunJob,
"job_name": job.Name,
"from": ack,
"query": QueryRunJob,
"job": job.Name,
"from": ack,
}).Debug("agent: Received ack")
}
case resp, ok := <-respCh:
if ok {
log.WithFields(logrus.Fields{
"query": QueryRunJob,
"job_name": job.Name,
"job": job.Name,
"from": resp.From,
"response": string(resp.Payload),
}).Debug("agent: Received response")
}
}
}
log.WithFields(logrus.Fields{
"time": time.Since(start),
"job_name": job.Name,
"query": QueryRunJob,
"time": time.Since(start),
"job": job.Name,
"query": QueryRunJob,
}).Debug("agent: Done receiving acks and responses")

return job, nil
Expand Down

0 comments on commit 90f2708

Please sign in to comment.