Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions static/app/views/replays/detail/ai/useReplaySummary.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {useCallback, useEffect, useRef, useState} from 'react';
import * as Sentry from '@sentry/react';

import type {ApiQueryKey, UseApiQueryOptions} from 'sentry/utils/queryClient';
import {useApiQuery, useMutation, useQueryClient} from 'sentry/utils/queryClient';
Expand All @@ -18,6 +19,9 @@ const ERROR_POLL_INTERVAL_MS = 5000;
const START_TIMEOUT_MS = 15_000; // Max time to wait for processing to start after a start request.
const TOTAL_TIMEOUT_MS = 100_000; // Max time to wait for results after a start request. Task timeout in Seer (90s) + 10s buffer.

function logReplaySummaryTimeout({extra}: {extra: Record<string, string>}) {
Sentry.logger.info('Replay summary poll timed out', extra);
}
export interface UseReplaySummaryResult {
/**
* Whether there was an error with the initial query or summary generation,
Expand Down Expand Up @@ -97,6 +101,14 @@ export function useReplaySummary(
timeMs: TOTAL_TIMEOUT_MS,
onTimeout: () => {
setDidTimeout(true);
logReplaySummaryTimeout({
extra: {
reason: 'Total timeout',
orgSlug: organization.slug,
replayId: replayRecord?.id ?? '',
segmentCount: segmentCount.toString(),
},
});
},
});

Expand All @@ -105,6 +117,14 @@ export function useReplaySummary(
onTimeout: () => {
setDidTimeout(true);
cancelTotalTimeout();
logReplaySummaryTimeout({
extra: {
reason: 'Start timeout',
orgSlug: organization.slug,
replayId: replayRecord?.id ?? '',
segmentCount: segmentCount.toString(),
},
});
},
});

Expand Down
Loading