Skip to content

Commit

Permalink
fix: update root span only if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
NeuralFlux committed Oct 10, 2024
1 parent 677886c commit daac52b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/threading/threadHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export async function runTask(req: Request, res: Response, route: string, useBul
// add req dest to root span name as HTTP instrumentation doesn't do it automatically
const activeContext = context.active();
const rootSpan = trace.getSpan(activeContext);
rootSpan.updateName(`${req.method} ${req.originalUrl}`);
if (rootSpan != undefined) rootSpan.updateName(`${req.method} ${req.originalUrl}`);

const taskInfo: TaskInfo = {
data: {
Expand Down

0 comments on commit daac52b

Please sign in to comment.