|
@@ -1,4 +1,4 @@
|
|
|
-import {Fragment, useRef} from 'react';
|
|
|
+import {Fragment, lazy, useRef} from 'react';
|
|
|
import styled from '@emotion/styled';
|
|
|
|
|
|
import {CommitRow} from 'sentry/components/commitRow';
|
|
@@ -36,10 +36,18 @@ 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 {t} from 'sentry/locale';
|
|
|
import {space} from 'sentry/styles/space';
|
|
|
-import type {Event, Group, Project} from 'sentry/types';
|
|
|
-import {IssueCategory, IssueType} from 'sentry/types';
|
|
|
+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';
|
|
@@ -47,6 +55,10 @@ import {getReplayIdFromEvent} from 'sentry/utils/replays/getReplayIdFromEvent';
|
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
import {ResourcesAndMaybeSolutions} from 'sentry/views/issueDetails/resourcesAndMaybeSolutions';
|
|
|
|
|
|
+const AIMonitoringSection = lazy(
|
|
|
+ () => import('sentry/components/events/interfaces/ai-monitoring/aiMonitoringSection')
|
|
|
+);
|
|
|
+
|
|
|
type GroupEventDetailsContentProps = {
|
|
|
group: Group;
|
|
|
project: Project;
|
|
@@ -124,6 +136,27 @@ function DefaultGroupEventDetailsContent({
|
|
|
/>
|
|
|
</EventDataSection>
|
|
|
)}
|
|
|
+ {event.type === EventOrGroupType.ERROR &&
|
|
|
+ organization.features.includes('ai-analytics') &&
|
|
|
+ event?.entries
|
|
|
+ ?.filter((x): x is EntryException => x.type === EntryType.EXCEPTION)
|
|
|
+ .flatMap(x => x.data.values ?? [])
|
|
|
+ .some(({value}) => {
|
|
|
+ const lowerText = value.toLowerCase();
|
|
|
+ return (
|
|
|
+ (lowerText.includes('api key') || lowerText.includes('429')) &&
|
|
|
+ (lowerText.includes('openai') ||
|
|
|
+ lowerText.includes('anthropic') ||
|
|
|
+ lowerText.includes('cohere') ||
|
|
|
+ lowerText.includes('langchain'))
|
|
|
+ );
|
|
|
+ }) ? (
|
|
|
+ <LazyLoad
|
|
|
+ LazyComponent={AIMonitoringSection}
|
|
|
+ event={event}
|
|
|
+ organization={organization}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
{group.issueCategory === IssueCategory.CRON && (
|
|
|
<CronTimelineSection
|
|
|
event={event}
|