diff --git a/static/app/views/replays/detail/ai/useReplaySummary.tsx b/static/app/views/replays/detail/ai/useReplaySummary.tsx index 1d1f14ad042c7f..cf617afc263d35 100644 --- a/static/app/views/replays/detail/ai/useReplaySummary.tsx +++ b/static/app/views/replays/detail/ai/useReplaySummary.tsx @@ -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'; @@ -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}) { + Sentry.logger.info('Replay summary poll timed out', extra); +} export interface UseReplaySummaryResult { /** * Whether there was an error with the initial query or summary generation, @@ -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(), + }, + }); }, }); @@ -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(), + }, + }); }, });