Skip to content

Commit

Permalink
feat(store): force a new Sentry trace id for job
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkdev98 committed May 2, 2024
1 parent 6ca6806 commit f4de6a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/store/src/queue-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
isNil,
newEvent,
newLogger,
uuid,
} from "@compas/stdlib";
import cron from "cron-parser";
import { jobWhere } from "./generated/database/job.js";
Expand Down Expand Up @@ -511,10 +512,14 @@ async function queueWorkerExecuteJob(logger, sql, options, job) {
if (_compasSentryExport) {
await _compasSentryExport.startSpan(
{
// Force a new trace for every request. This keeps the traces view usable.
traceId: uuid().replace(/-/g, ""),
spanId: uuid().replace(/-/g, "").slice(16),
forceTransaction: true,

op: "queue.task",
name: job.name,
description: job.name,
forceTransaction: true,
},
async () => {
return await exec();
Expand Down

0 comments on commit f4de6a0

Please sign in to comment.