Skip to content

Commit

Permalink
Merge pull request #88 from stickeeuk/fix/job-duration
Browse files Browse the repository at this point in the history
Fix job duration
  • Loading branch information
stickeegreg authored Nov 8, 2024
2 parents 79cd7e0 + 5f6e734 commit a6be74a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Laravel/Providers/InstrumentationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private function instrumentJobs(): void
}
});

Event::listen(JobProcessed::class, function ($event) use ($startTime): void {
Event::listen(JobProcessed::class, function ($event) use (&$startTime): void {
Instrument::counter(SemConv::JOBS_PROCESSED_NAME, [
SemConv::JOB_NAME => $event->job->resolveName(),
SemConv::JOB_QUEUE => $event->job->getQueue(),
Expand All @@ -215,7 +215,7 @@ private function instrumentJobs(): void
);
});

Event::listen(JobFailed::class, function ($event) use ($startTime): void {
Event::listen(JobFailed::class, function ($event) use (&$startTime): void {
Instrument::counter(SemConv::JOBS_PROCESSED_NAME, [
SemConv::JOB_NAME => $event->job->resolveName(),
SemConv::JOB_QUEUE => $event->job->getQueue(),
Expand Down

0 comments on commit a6be74a

Please sign in to comment.