diff --git a/dkron/queries.go b/dkron/queries.go index 0f14d5d0e..02b7b874d 100644 --- a/dkron/queries.go +++ b/dkron/queries.go @@ -54,8 +54,12 @@ func (a *Agent) RunQuery(jobName string, ex *Execution) (*Job, error) { if err != nil { return nil, fmt.Errorf("agent: RunQuery error processing filtered nodes: %w", err) } - log.Debug("agent: Filtered nodes to run: ", filterNodes) - log.Debug("agent: Filtered tags to run: ", filterTags) + log.WithFields(logrus.Fields{ + "job": job.Name, + }).Debug("agent: Filtered nodes to run: ", filterNodes) + log.WithFields(logrus.Fields{ + "job": job.Name, + }).Debug("agent: Filtered tags to run: ", filterTags) //serf match regexp but we want only match full tag serfFilterTags := make(map[string]string) @@ -86,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) @@ -111,6 +115,7 @@ func (a *Agent) RunQuery(jobName string, ex *Execution) (*Job, error) { if ok { log.WithFields(logrus.Fields{ "query": QueryRunJob, + "job": job.Name, "from": ack, }).Debug("agent: Received ack") } @@ -118,6 +123,7 @@ func (a *Agent) RunQuery(jobName string, ex *Execution) (*Job, error) { if ok { log.WithFields(logrus.Fields{ "query": QueryRunJob, + "job": job.Name, "from": resp.From, "response": string(resp.Payload), }).Debug("agent: Received response") @@ -126,6 +132,7 @@ func (a *Agent) RunQuery(jobName string, ex *Execution) (*Job, error) { } log.WithFields(logrus.Fields{ "time": time.Since(start), + "job": job.Name, "query": QueryRunJob, }).Debug("agent: Done receiving acks and responses")