diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx index 349bad884c..94bbe3cd85 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx @@ -420,7 +420,6 @@ function NoLogsView({ run, resizable }: LoaderData) { min={resizableSettings.parent.inspector.min} isStaticAtRest > - {" "} 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 34e84d7076..088b3227a5 100644 --- a/apps/webapp/app/routes/api.v1.tasks.$taskId.batch.ts +++ b/apps/webapp/app/routes/api.v1.tasks.$taskId.batch.ts @@ -39,6 +39,7 @@ export async function action({ request, params }: ActionFunctionArgs) { "idempotency-key": idempotencyKey, "trigger-version": triggerVersion, "x-trigger-span-parent-as-link": spanParentAsLink, + "x-trigger-worker": isFromWorker, traceparent, tracestate, } = headers.data; @@ -86,11 +87,16 @@ 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, tracestate } + : undefined; + try { const result = await service.call(taskId, authenticationResult.environment, body.data, { idempotencyKey: idempotencyKey ?? undefined, triggerVersion: triggerVersion ?? undefined, - traceContext: traceparent ? { traceparent, tracestate } : undefined, + traceContext, spanParentAsLink: spanParentAsLink === 1, }); 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 08b9d1756c..7a1a590bca 100644 --- a/apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.ts +++ b/apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.ts @@ -79,13 +79,10 @@ export async function action({ request, params }: ActionFunctionArgs) { const service = new TriggerTaskService(); try { - const traceContext = traceparent - ? !triggerVersion // If the trigger version is NOT set, we are in an older version of the SDK + const traceContext = + traceparent ?? isFromWorker /// If the request is from a worker, we should pass the trace context ? { traceparent, tracestate } - : isFromWorker // If the trigger version is set, and the request is from a worker, we should pass the trace context - ? { traceparent, tracestate } - : undefined - : undefined; + : undefined; logger.debug("Triggering task", { taskId,