diff --git a/pkg/describe/schedulers/query-validator/publisher.go b/pkg/describe/schedulers/query-validator/publisher.go index be0b38b33..81605c1c6 100644 --- a/pkg/describe/schedulers/query-validator/publisher.go +++ b/pkg/describe/schedulers/query-validator/publisher.go @@ -46,6 +46,7 @@ func (s *JobScheduler) runPublisher(ctx context.Context) error { } if job.QueryType == queryvalidator.QueryTypeNamedQuery { jobMsg.QueryType = queryvalidator.QueryTypeNamedQuery + jobMsg.QueryId = job.QueryId namedQuery, err := s.inventoryClient.GetQuery(ctx2, job.QueryId) if err != nil { s.logger.Error("Get Query Error", zap.Error(err)) @@ -56,6 +57,8 @@ func (s *JobScheduler) runPublisher(ctx context.Context) error { jobMsg.PrimaryTable = namedQuery.Query.PrimaryTable jobMsg.IntegrationType = namedQuery.IntegrationTypes } else if job.QueryType == queryvalidator.QueryTypeComplianceControl { + jobMsg.QueryType = queryvalidator.QueryTypeComplianceControl + jobMsg.QueryId = job.QueryId controlQuery, err := s.complianceClient.GetControlDetails(ctx2, job.QueryId) if err != nil { s.logger.Error("Get Control Error", zap.Error(err)) diff --git a/pkg/query-validator/service.go b/pkg/query-validator/service.go index fc9bdf24c..658cd193f 100644 --- a/pkg/query-validator/service.go +++ b/pkg/query-validator/service.go @@ -201,7 +201,7 @@ func (w *Worker) ProcessMessage(ctx context.Context, msg jetstream.Msg) (err err w.logger.Error("failed to publish job in progress", zap.String("jobInProgress", string(resultJson)), zap.Error(err)) } - w.logger.Info("running job", zap.ByteString("job", msg.Data())) + w.logger.Info("running job", zap.ByteString("job", msg.Data()), zap.Any("job object", job)) err = w.RunJob(ctx, job) if err != nil {