Fix missing logs on child runs by using the root task run createdAt if it exists (#1697)

This commit is contained in:
Eric Allam
2025-02-12 14:03:48 +00:00
committed by GitHub
parent d214aa9093
commit d622aba86d
2 changed files with 4 additions and 2 deletions
@@ -47,6 +47,7 @@ export class RunPresenter {
friendlyId: true,
taskIdentifier: true,
spanId: true,
createdAt: true,
},
},
runtimeEnvironment: {
@@ -111,7 +112,7 @@ export class RunPresenter {
const traceSummary = await eventRepository.getTraceSummary(
getTaskEventStoreTableForRun(run),
run.traceId,
run.createdAt,
run.rootTaskRun?.createdAt ?? run.createdAt,
run.completedAt ?? undefined
);
if (!traceSummary) {
@@ -135,6 +135,7 @@ export class SpanPresenter extends BasePresenter {
taskIdentifier: true,
friendlyId: true,
spanId: true,
createdAt: true,
},
},
parentTaskRun: {
@@ -211,7 +212,7 @@ export class SpanPresenter extends BasePresenter {
getTaskEventStoreTableForRun(run),
spanId,
run.traceId,
run.createdAt,
run.rootTaskRun?.createdAt ?? run.createdAt,
run.completedAt ?? undefined
);