diff --git a/apps/worker/src/app/workflow/usecases/run-job/run-job.usecase.ts b/apps/worker/src/app/workflow/usecases/run-job/run-job.usecase.ts index f7b1f2b4e5b..39849b1979c 100644 --- a/apps/worker/src/app/workflow/usecases/run-job/run-job.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/run-job/run-job.usecase.ts @@ -1,3 +1,5 @@ +const nr = require('newrelic'); + import { Injectable, Logger } from '@nestjs/common'; import { JobEntity, JobRepository, JobStatusEnum } from '@novu/dal'; import { StepTypeEnum } from '@novu/shared'; @@ -33,12 +35,17 @@ export class RunJob { if (!job) throw new PlatformException(`Job with id ${command.jobId} not found`); try { - this.logger?.assign({ + const contextData = { transactionId: job.transactionId, environmentId: job._environmentId, organizationId: job._organizationId, jobId: job._id, - }); + jobType: job.type, + }; + + nr.addCustomAttributes(contextData); + + this.logger?.assign(contextData); } catch (e) { Logger.error(e, 'RunJob'); }