import {Fragment, lazy, useMemo, useRef} from 'react'; import styled from '@emotion/styled'; import {usePrompt} from 'sentry/actionCreators/prompts'; import {Button} from 'sentry/components/button'; import {CommitRow} from 'sentry/components/commitRow'; import ErrorBoundary from 'sentry/components/errorBoundary'; import BreadcrumbsDataSection from 'sentry/components/events/breadcrumbs/breadcrumbsDataSection'; import {EventContexts} from 'sentry/components/events/contexts'; import {EventDevice} from 'sentry/components/events/device'; import {EventAttachments} from 'sentry/components/events/eventAttachments'; import {EventDataSection} from 'sentry/components/events/eventDataSection'; import {EventEvidence} from 'sentry/components/events/eventEvidence'; import {EventExtraData} from 'sentry/components/events/eventExtraData'; import EventHydrationDiff from 'sentry/components/events/eventHydrationDiff'; import {EventProcessingErrors} from 'sentry/components/events/eventProcessingErrors'; import EventReplay from 'sentry/components/events/eventReplay'; import {EventSdk} from 'sentry/components/events/eventSdk'; import AggregateSpanDiff from 'sentry/components/events/eventStatisticalDetector/aggregateSpanDiff'; import EventBreakpointChart from 'sentry/components/events/eventStatisticalDetector/breakpointChart'; import {EventAffectedTransactions} from 'sentry/components/events/eventStatisticalDetector/eventAffectedTransactions'; import EventComparison from 'sentry/components/events/eventStatisticalDetector/eventComparison'; import {EventDifferentialFlamegraph} from 'sentry/components/events/eventStatisticalDetector/eventDifferentialFlamegraph'; import {EventFunctionComparisonList} from 'sentry/components/events/eventStatisticalDetector/eventFunctionComparisonList'; import {EventRegressionSummary} from 'sentry/components/events/eventStatisticalDetector/eventRegressionSummary'; import {EventFunctionBreakpointChart} from 'sentry/components/events/eventStatisticalDetector/functionBreakpointChart'; import {TransactionsDeltaProvider} from 'sentry/components/events/eventStatisticalDetector/transactionsDeltaProvider'; import {EventTagsAndScreenshot} from 'sentry/components/events/eventTagsAndScreenshot'; import {ScreenshotDataSection} from 'sentry/components/events/eventTagsAndScreenshot/screenshot/screenshotDataSection'; import EventTagsDataSection from 'sentry/components/events/eventTagsAndScreenshot/tags'; import {EventViewHierarchy} from 'sentry/components/events/eventViewHierarchy'; import {EventGroupingInfo} from 'sentry/components/events/groupingInfo'; import HighlightsDataSection from 'sentry/components/events/highlights/highlightsDataSection'; import {HighlightsIconSummary} from 'sentry/components/events/highlights/highlightsIconSummary'; import {Breadcrumbs} from 'sentry/components/events/interfaces/breadcrumbs'; import {ActionableItems} from 'sentry/components/events/interfaces/crashContent/exception/actionableItems'; import {actionableItemsEnabled} from 'sentry/components/events/interfaces/crashContent/exception/useActionableItems'; import {CronTimelineSection} from 'sentry/components/events/interfaces/crons/cronTimelineSection'; import {Csp} from 'sentry/components/events/interfaces/csp'; import {DebugMeta} from 'sentry/components/events/interfaces/debugMeta'; import {Exception} from 'sentry/components/events/interfaces/exception'; import {Generic} from 'sentry/components/events/interfaces/generic'; import {Message} from 'sentry/components/events/interfaces/message'; import {AnrRootCause} from 'sentry/components/events/interfaces/performance/anrRootCause'; import {SpanEvidenceSection} from 'sentry/components/events/interfaces/performance/spanEvidence'; import {Request} from 'sentry/components/events/interfaces/request'; import {StackTrace} from 'sentry/components/events/interfaces/stackTrace'; import {Template} from 'sentry/components/events/interfaces/template'; import {Threads} from 'sentry/components/events/interfaces/threads'; import {UptimeDataSection} from 'sentry/components/events/interfaces/uptime/uptimeDataSection'; import {EventPackageData} from 'sentry/components/events/packageData'; import {EventRRWebIntegration} from 'sentry/components/events/rrwebIntegration'; import {DataSection} from 'sentry/components/events/styles'; import {SuspectCommits} from 'sentry/components/events/suspectCommits'; import {EventUserFeedback} from 'sentry/components/events/userFeedback'; import LazyLoad from 'sentry/components/lazyLoad'; import Placeholder from 'sentry/components/placeholder'; import {useHasNewTimelineUI} from 'sentry/components/timeline/utils'; import {IconChevron} from 'sentry/icons'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Entry, EntryException, Event, EventTransaction} from 'sentry/types/event'; import {EntryType, EventOrGroupType} from 'sentry/types/event'; import type {Group} from 'sentry/types/group'; import {IssueCategory, IssueType} from 'sentry/types/group'; import type {Project} from 'sentry/types/project'; import {defined} from 'sentry/utils'; import { getConfigForIssueType, shouldShowCustomErrorResourceConfig, } from 'sentry/utils/issueTypeConfig'; import {QuickTraceContext} from 'sentry/utils/performance/quickTrace/quickTraceContext'; import QuickTraceQuery from 'sentry/utils/performance/quickTrace/quickTraceQuery'; import {getReplayIdFromEvent} from 'sentry/utils/replays/getReplayIdFromEvent'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import {ResourcesAndPossibleSolutions} from 'sentry/views/issueDetails/resourcesAndPossibleSolutions'; import {SectionKey} from 'sentry/views/issueDetails/streamline/context'; import {EventDetails} from 'sentry/views/issueDetails/streamline/eventDetails'; import {InterimSection} from 'sentry/views/issueDetails/streamline/interimSection'; import {TraceDataSection} from 'sentry/views/issueDetails/traceDataSection'; import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils'; const LLMMonitoringSection = lazy( () => import('sentry/components/events/interfaces/llm-monitoring/llmMonitoringSection') ); export interface EventDetailsContentProps { group: Group; project: Project; event?: Event; } export function EventDetailsContent({ group, event, project, }: Required) { const organization = useOrganization(); const location = useLocation(); const hasNewTimelineUI = useHasNewTimelineUI(); const hasStreamlinedUI = useHasStreamlinedUI(); const tagsRef = useRef(null); const eventEntries = useMemo(() => { const {entries = []} = event; return entries.reduce<{[key in EntryType]?: Entry}>((entryMap, entry) => { entryMap[entry.type] = entry; return entryMap; }, {}); }, [event]); const projectSlug = project.slug; const hasReplay = Boolean(getReplayIdFromEvent(event)); const mechanism = event.tags?.find(({key}) => key === 'mechanism')?.value; const isANR = mechanism === 'ANR' || mechanism === 'AppExitInfo'; const showPossibleSolutionsHigher = shouldShowCustomErrorResourceConfig(group, project); const groupingCurrentLevel = group?.metadata?.current_level; const hasActionableItems = actionableItemsEnabled({ eventId: event.id, organization, projectSlug, }); const { isLoading: promptLoading, isError: promptError, isPromptDismissed, dismissPrompt, showPrompt, } = usePrompt({ feature: 'issue_feedback_hidden', organization, projectId: project.id, }); // default to show on error or isPromptDismissed === undefined const showFeedback = !isPromptDismissed || promptError || hasStreamlinedUI; const issueTypeConfig = getConfigForIssueType(group, group.project); return ( {hasStreamlinedUI && } {hasActionableItems && !hasStreamlinedUI && ( )} {hasStreamlinedUI && } {!hasStreamlinedUI && } {!hasStreamlinedUI && ( )} {event.userReport && ( ) } > {promptLoading ? ( ) : showFeedback ? ( ) : null} )} {event.type === EventOrGroupType.ERROR && organization.features.includes('insights-addon-modules') && event?.entries ?.filter((x): x is EntryException => x.type === EntryType.EXCEPTION) .flatMap(x => x.data.values ?? []) .some(({value}) => { const lowerText = value?.toLowerCase(); return ( lowerText && (lowerText.includes('api key') || lowerText.includes('429')) && (lowerText.includes('openai') || lowerText.includes('anthropic') || lowerText.includes('cohere') || lowerText.includes('langchain')) ); }) ? ( ) : null} {group.issueCategory === IssueCategory.UPTIME && ( )} {group.issueCategory === IssueCategory.CRON && ( )} {showPossibleSolutionsHigher && ( )} {defined(eventEntries[EntryType.MESSAGE]) && ( )} {defined(eventEntries[EntryType.EXCEPTION]) && ( )} {defined(eventEntries[EntryType.STACKTRACE]) && ( )} {defined(eventEntries[EntryType.THREADS]) && ( )} {isANR && ( {results => { return ( ); }} )} {group.issueCategory === IssueCategory.PERFORMANCE && ( )} {issueTypeConfig.replays.enabled && ( )} {defined(eventEntries[EntryType.HPKP]) && ( )} {defined(eventEntries[EntryType.CSP]) && ( )} {defined(eventEntries[EntryType.EXPECTCT]) && ( )} {defined(eventEntries[EntryType.EXPECTSTAPLE]) && ( )} {defined(eventEntries[EntryType.TEMPLATE]) && (