From 0ecbcfdd8602b6e3a35739372fc466db46041a62 Mon Sep 17 00:00:00 2001 From: nicktrn <55853254+nicktrn@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:49:11 +0100 Subject: [PATCH] Only pass trace context if request is from a worker --- apps/webapp/app/routes/api.v1.tasks.$taskId.batch.ts | 2 +- apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/webapp/app/routes/api.v1.tasks.$taskId.batch.ts b/apps/webapp/app/routes/api.v1.tasks.$taskId.batch.ts index 088b3227a..04f452d61 100644 --- a/apps/webapp/app/routes/api.v1.tasks.$taskId.batch.ts +++ b/apps/webapp/app/routes/api.v1.tasks.$taskId.batch.ts @@ -88,7 +88,7 @@ export async function action({ request, params }: ActionFunctionArgs) { const service = new BatchTriggerTaskService(); const traceContext = - traceparent ?? isFromWorker // If the request is from a worker, we should pass the trace context + traceparent && isFromWorker // If the request is from a worker, we should pass the trace context ? { traceparent, tracestate } : undefined; diff --git a/apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.ts b/apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.ts index 7a1a590bc..18f09560a 100644 --- a/apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.ts +++ b/apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.ts @@ -80,7 +80,7 @@ export async function action({ request, params }: ActionFunctionArgs) { try { const traceContext = - traceparent ?? isFromWorker /// If the request is from a worker, we should pass the trace context + traceparent && isFromWorker /// If the request is from a worker, we should pass the trace context ? { traceparent, tracestate } : undefined;