import {Fragment, lazy, useRef} from 'react'; import styled from '@emotion/styled'; 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 {EventEntry} from 'sentry/components/events/eventEntry'; import {EventEvidence} from 'sentry/components/events/eventEvidence'; import {EventExtraData} from 'sentry/components/events/eventExtraData'; import EventHydrationDiff from 'sentry/components/events/eventHydrationDiff'; 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 {EventViewHierarchy} from 'sentry/components/events/eventViewHierarchy'; import {EventGroupingInfo} from 'sentry/components/events/groupingInfo'; import HighlightsDataSection from 'sentry/components/events/highlights/highlightsDataSection'; 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 {AnrRootCause} from 'sentry/components/events/interfaces/performance/anrRootCause'; import {SpanEvidenceSection} from 'sentry/components/events/interfaces/performance/spanEvidence'; 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 {useHasNewTimelineUI} from 'sentry/components/timeline/utils'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import { type EntryException, type Event, EventOrGroupType, type Group, IssueCategory, IssueType, type Project, } from 'sentry/types'; import type {EventTransaction} from 'sentry/types/event'; import {EntryType} from 'sentry/types/event'; import {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'; const LLMMonitoringSection = lazy( () => import('sentry/components/events/interfaces/llm-monitoring/llmMonitoringSection') ); type GroupEventDetailsContentProps = { group: Group; project: Project; event?: Event; }; type GroupEventEntryProps = { entryType: EntryType; event: Event; group: Group; project: Project; }; function GroupEventEntry({event, entryType, group, project}: GroupEventEntryProps) { const organization = useOrganization(); const matchingEntry = event.entries.find(entry => entry.type === entryType); if (!matchingEntry) { return null; } return ( ); } function DefaultGroupEventDetailsContent({ group, event, project, }: Required) { const organization = useOrganization(); const location = useLocation(); const hasNewTimelineUI = useHasNewTimelineUI(); const tagsRef = useRef(null); 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 hasAnrImprovementsFeature = organization.features.includes('anr-improvements'); const showPossibleSolutionsHigher = shouldShowCustomErrorResourceConfig(group, project); const eventEntryProps = {group, event, project}; const hasActionableItems = actionableItemsEnabled({ eventId: event.id, organization, projectSlug, }); return ( {hasActionableItems && ( )} {event.userReport && ( )} {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.CRON && ( )} {showPossibleSolutionsHigher && ( )} {hasAnrImprovementsFeature && isANR && ( {results => { return ( ); }} )} {group.issueCategory === IssueCategory.PERFORMANCE && ( )} {hasNewTimelineUI ? ( ) : ( )} {!showPossibleSolutionsHigher && ( )}
{event.groupID && ( )} {!hasReplay && ( )}
); } function ResourcesAndPossibleSolutionsIssueDetailsContent({ event, project, group, }: Required) { return ( ); } function PerformanceDurationRegressionIssueDetailsContent({ group, event, project, }: Required) { return ( ); } function ProfilingDurationRegressionIssueDetailsContent({ group, event, project, }: Required) { return ( {t('Largest Changes in Call Stack Frequency')}

{t(`See which functions changed the most before and after the regression. The frame with the largest increase in call stack population likely contributed to the cause for the duration regression.`)}

); } function GroupEventDetailsContent({ group, event, project, }: GroupEventDetailsContentProps) { if (!event) { return (

{t('Latest event not available')}

); } switch (group.issueType) { case IssueType.PERFORMANCE_DURATION_REGRESSION: case IssueType.PERFORMANCE_ENDPOINT_REGRESSION: { return ( ); } case IssueType.PROFILE_FUNCTION_REGRESSION_EXPERIMENTAL: case IssueType.PROFILE_FUNCTION_REGRESSION: { return ( ); } default: { return ( ); } } } const NotFoundMessage = styled('div')` padding: ${space(2)} ${space(4)}; `; const StyledDataSection = styled(DataSection)` padding: ${space(0.5)} ${space(2)}; @media (min-width: ${p => p.theme.breakpoints.medium}) { padding: ${space(1)} ${space(4)}; } &:empty { display: none; } `; export default GroupEventDetailsContent;