Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,25 @@ function DBQueryInjectionVulnerabilityEvidence({
);
}

function AIDetectedSpanEvidence({
event,
organization,
location,
projectSlug,
}: SpanEvidenceKeyValueListProps) {
const evidenceData = event?.occurrence?.evidenceData ?? {};
return (
<PresortedKeyValueList
data={[
makeTransactionNameRow(event, organization, location, projectSlug),
makeRow(t('Explanation'), evidenceData.explanation),
makeRow(t('Impact'), evidenceData.impact),
makeRow(t('Evidence'), evidenceData.evidence),
]}
/>
);
}

const PREVIEW_COMPONENTS: Partial<
Record<IssueType, (p: SpanEvidenceKeyValueListProps) => React.ReactElement | null>
> = {
Expand All @@ -368,6 +387,7 @@ const PREVIEW_COMPONENTS: Partial<
[IssueType.PROFILE_FUNCTION_REGRESSION]: RegressionEvidence,
[IssueType.QUERY_INJECTION_VULNERABILITY]: DBQueryInjectionVulnerabilityEvidence,
[IssueType.WEB_VITALS]: WebVitalsEvidence,
[IssueType.LLM_DETECTED_EXPERIMENTAL]: AIDetectedSpanEvidence,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we generally be consistent with AI detected vs LLM detected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion - AI Detected is what we are calling the issue category,LLM detected so far is what we are calling the type. so for now if we can stay consistent with that, i think we are fine (changing these later isn't too difficult)

};

export function SpanEvidenceKeyValueList({
Expand Down Expand Up @@ -401,7 +421,6 @@ export function SpanEvidenceKeyValueList({
/>
);
}

const Component = PREVIEW_COMPONENTS[issueType] ?? DefaultSpanEvidence;

return (
Expand Down
14 changes: 13 additions & 1 deletion static/app/types/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ export enum IssueCategory {
HTTP_CLIENT = 'http_client',
DB_QUERY = 'db_query',
MOBILE = 'mobile',

AI_DETECTED = 'ai_detected',
}

/**
Expand Down Expand Up @@ -133,6 +135,7 @@ export const ISSUE_CATEGORY_TO_DESCRIPTION: Record<IssueCategory, string> = {
[IssueCategory.CRON]: '',
[IssueCategory.REPLAY]: '',
[IssueCategory.UPTIME]: '',
[IssueCategory.AI_DETECTED]: t('AI detected issues.'),
};

export enum IssueType {
Expand Down Expand Up @@ -179,10 +182,14 @@ export enum IssueType {

// Insights Web Vitals
WEB_VITALS = 'web_vitals',

LLM_DETECTED_EXPERIMENTAL = 'llm_detected_experimental',
}

// Update this if adding an issue type that you don't want to show up in search!
export const VISIBLE_ISSUE_TYPES = Object.values(IssueType);
export const VISIBLE_ISSUE_TYPES = Object.values(IssueType).filter(
type => ![IssueType.LLM_DETECTED_EXPERIMENTAL].includes(type)
);

export enum IssueTitle {
ERROR = 'Error',
Expand Down Expand Up @@ -226,6 +233,8 @@ export enum IssueTitle {

// Insights Web Vitals
WEB_VITALS = 'Web Vitals',

LLM_DETECTED_EXPERIMENTAL = 'LLM Detected Issue',
}

export const ISSUE_TYPE_TO_ISSUE_TITLE = {
Expand Down Expand Up @@ -263,6 +272,8 @@ export const ISSUE_TYPE_TO_ISSUE_TITLE = {
uptime_domain_failure: IssueTitle.UPTIME_DOMAIN_FAILURE,

web_vitals: IssueTitle.WEB_VITALS,

llm_detected_experimental: IssueTitle.LLM_DETECTED_EXPERIMENTAL,
};

export function getIssueTitleFromType(issueType: string): IssueTitle | undefined {
Expand Down Expand Up @@ -295,6 +306,7 @@ const OCCURRENCE_TYPE_TO_ISSUE_TYPE = {
2007: IssueType.PROFILE_REGEX_MAIN_THREAD,
2008: IssueType.PROFILE_FRAME_DROP,
2010: IssueType.PROFILE_FUNCTION_REGRESSION,
3501: IssueType.LLM_DETECTED_EXPERIMENTAL,
10001: IssueType.WEB_VITALS,
};

Expand Down
47 changes: 47 additions & 0 deletions static/app/utils/issueTypeConfig/aiDetectedConfig.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import {t} from 'sentry/locale';
import type {IssueCategoryConfigMapping} from 'sentry/utils/issueTypeConfig/types';
import {Tab} from 'sentry/views/issueDetails/types';

const aiDetectedConfig: IssueCategoryConfigMapping = {
_categoryDefaults: {
actions: {
archiveUntilOccurrence: {enabled: true},
delete: {
enabled: true,
},
deleteAndDiscard: {
enabled: false,
disabledReason: t('Not yet supported for performance issues'),
},
merge: {
enabled: false,
disabledReason: t('Not yet supported for performance issues'),
},
ignore: {enabled: true},
resolve: {enabled: true},
resolveInRelease: {enabled: true},
share: {enabled: true},
},
pages: {
landingPage: Tab.DETAILS,
events: {enabled: true},
openPeriods: {enabled: false},
checkIns: {enabled: false},
uptimeChecks: {enabled: false},
attachments: {enabled: false},
userFeedback: {enabled: false},
replays: {enabled: false},
tagsTab: {enabled: false},
},
autofix: false,
mergedIssues: {enabled: false},
similarIssues: {enabled: false},
stacktrace: {enabled: false},
spanEvidence: {enabled: true},
evidence: null,
usesIssuePlatform: true,
issueSummary: {enabled: false},
},
};

export default aiDetectedConfig;
2 changes: 2 additions & 0 deletions static/app/utils/issueTypeConfig/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {t} from 'sentry/locale';
import {IssueCategory, IssueType} from 'sentry/types/group';
import type {Project} from 'sentry/types/project';
import aiDetectedConfig from 'sentry/utils/issueTypeConfig/aiDetectedConfig';
import cronConfig from 'sentry/utils/issueTypeConfig/cronConfig';
import dbQueryConfig from 'sentry/utils/issueTypeConfig/dbQueryConfig';
import {
Expand Down Expand Up @@ -102,6 +103,7 @@ const issueTypeConfig: Config = {
[IssueCategory.DB_QUERY]: dbQueryConfig,
[IssueCategory.MOBILE]: mobileConfig,
[IssueCategory.METRIC]: metricConfig,
[IssueCategory.AI_DETECTED]: aiDetectedConfig,
};

/**
Expand Down
Loading