Skip to content

Commit df4ab97

Browse files
authored
fix(otel): fix broken schedule run spans (#2727)
schedule spans can sometimes show as generic spans when using the task_events_v2 table because of the inserted_at filter. Increasing the buffer for the start time does the trick and doesn’t cause any perf Issues (and is in general just more robust)
1 parent 9f27422 commit df4ab97

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

apps/webapp/app/presenters/v3/SpanPresenter.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ export class SpanPresenter extends BasePresenter {
273273
spanId: run.spanId,
274274
isCached: !!originalRunId,
275275
machinePreset: machine?.name,
276+
taskEventStore: run.taskEventStore,
276277
externalTraceId,
277278
};
278279
}

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,10 @@ function RunBody({
815815
<Property.Label>Span ID</Property.Label>
816816
<Property.Value>{run.spanId}</Property.Value>
817817
</Property.Item>
818+
<Property.Item>
819+
<Property.Label>Task event store</Property.Label>
820+
<Property.Value>{run.taskEventStore}</Property.Value>
821+
</Property.Item>
818822
</div>
819823
)}
820824
</Property.Table>

apps/webapp/app/v3/eventRepository/clickhouseEventRepository.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ export class ClickhouseEventRepository implements IEventRepository {
10391039
endCreatedAt?: Date,
10401040
options?: { includeDebugLogs?: boolean }
10411041
): Promise<TraceSummary | undefined> {
1042-
const startCreatedAtWithBuffer = new Date(startCreatedAt.getTime() - 1000);
1042+
const startCreatedAtWithBuffer = new Date(startCreatedAt.getTime() - 60_000);
10431043
const endCreatedAtWithBuffer = endCreatedAt
10441044
? new Date(endCreatedAt.getTime() + 60_000)
10451045
: undefined;

0 commit comments

Comments
 (0)