Skip to content

Commit a511151

Browse files
committed
fix(otel): increase getSpan start time buffer to 60s for scheduled runs
The schedule engine pre-queues runs ~25s before exactScheduleTime so they're ready to execute on the dot, but overrideCreatedAt stamps the TaskRun's createdAt with the future scheduled time. The getSpan query used createdAt as the window start with only a 1s buffer, causing spans to fall outside the query window for scheduled runs. The same issue was fixed for getTraceSummary in df4ab97 but getSpan was missed. Applying the same 60s buffer.
1 parent 3a5bc57 commit a511151

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ export class ClickhouseEventRepository implements IEventRepository {
12291229
endCreatedAt?: Date,
12301230
options?: { includeDebugLogs?: boolean }
12311231
): Promise<SpanDetail | undefined> {
1232-
const startCreatedAtWithBuffer = new Date(startCreatedAt.getTime() - 1000);
1232+
const startCreatedAtWithBuffer = new Date(startCreatedAt.getTime() - 60_000);
12331233

12341234
const queryBuilder =
12351235
this._version === "v2"

0 commit comments

Comments
 (0)