Skip to content

Commit

Permalink
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/worker/src/app/workflow/usecases/run-job/run-job.usecase.ts
Original file line number Diff line number Diff line change
@@ -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', LOG_CONTEXT);
}

0 comments on commit da3d9c2

Please sign in to comment.