Skip to content

Commit 629be90

Browse files
Abdkhan14Abdullah Khan
andauthored
feat(source-map-config-issues): Implementing problem, diagnosis and troubleshooting section designs (#112393)
dev-ui link for testing: [issue in dev org](https://instrument-gc.dev.getsentry.net:7999/issues/7389912885/?project=4511172452286464&query=&referrer=issue-stream) A little context on the endpoint used for the diagnosis section. - `GET /api/0/projects/{org}/{project}/events/{event_id}/source-map-debug-blue-thunder-edition/` — given an event, checks whether source maps can be resolved for each frame across three paths. - - Debug ID — whether the bundle has a debug ID injected and the corresponding artifacts are uploaded - - Release artifacts — whether the minified file and source map resolve correctly for the event's release/dist - - Scraping — whether Sentry attempted to fetch source maps from the deployed URL and the outcome (success, not found, disabled, timeout, etc.) <img width="1185" height="825" alt="Screenshot 2026-04-08 at 12 21 20 AM" src="https://github.com/user-attachments/assets/9b41cf59-16c8-40ff-babf-7e36d9893826" /> --------- Co-authored-by: Abdullah Khan <abdullahkhan@PG9Y57YDXQ.local>
1 parent 3d74761 commit 629be90

19 files changed

Lines changed: 474 additions & 24 deletions

File tree

static/app/components/events/interfaces/crashContent/exception/content.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {StacktraceBanners} from 'sentry/components/events/interfaces/crashConten
1010
import {useLineCoverageContext} from 'sentry/components/events/interfaces/crashContent/exception/lineCoverageContext';
1111
import {
1212
prepareSourceMapDebuggerFrameInformation,
13-
useSourceMapDebuggerData,
13+
useSourceMapDebugQuery,
14+
type SourceMapDebugBlueThunderResponse,
1415
} from 'sentry/components/events/interfaces/crashContent/exception/useSourceMapDebuggerData';
1516
import {renderLinksInText} from 'sentry/components/events/interfaces/crashContent/exception/utils';
1617
import {getStacktracePlatform} from 'sentry/components/events/interfaces/utils';
@@ -164,7 +165,7 @@ function InnerContent({
164165
hasChainedExceptions: boolean;
165166
hiddenExceptions: ExceptionRenderStateMap;
166167
isSampleError: boolean;
167-
sourceMapDebuggerData: ReturnType<typeof useSourceMapDebuggerData>;
168+
sourceMapDebuggerData: SourceMapDebugBlueThunderResponse | undefined;
168169
toggleRelatedExceptions: (exceptionId: number) => void;
169170
values: ExceptionValue[];
170171
project?: Project;
@@ -265,7 +266,11 @@ export function Content({
265266
}: Props) {
266267
const {projects} = useProjects({slugs: [projectSlug]});
267268

268-
const sourceMapDebuggerData = useSourceMapDebuggerData(event, projectSlug);
269+
const {data: sourceMapDebuggerData} = useSourceMapDebugQuery(
270+
projectSlug,
271+
event.id,
272+
event.sdk?.name ?? null
273+
);
269274
const {hiddenExceptions, toggleRelatedExceptions, expandException} =
270275
useHiddenExceptions(values);
271276

static/app/components/events/interfaces/crashContent/exception/useSourceMapDebuggerData.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import type {FrameSourceMapDebuggerData} from 'sentry/components/events/interfac
22
import type {Event} from 'sentry/types/event';
33
import type {PlatformKey} from 'sentry/types/project';
44
import {getApiUrl} from 'sentry/utils/api/getApiUrl';
5-
import {useApiQuery} from 'sentry/utils/queryClient';
5+
import {useApiQuery, type UseApiQueryResult} from 'sentry/utils/queryClient';
6+
import type {RequestError} from 'sentry/utils/requestError/requestError';
67
import {useOrganization} from 'sentry/utils/useOrganization';
78

89
interface SourceMapDebugBlueThunderResponseFrame {
@@ -33,7 +34,7 @@ interface SourceMapDebugBlueThunderResponseFrame {
3334
};
3435
}
3536

36-
interface SourceMapDebugBlueThunderResponse {
37+
export interface SourceMapDebugBlueThunderResponse {
3738
dist: string | null;
3839
exceptions: Array<{
3940
frames: SourceMapDebugBlueThunderResponseFrame[];
@@ -49,31 +50,43 @@ interface SourceMapDebugBlueThunderResponse {
4950
min_debug_id_sdk_version?: string | null;
5051
}
5152

52-
export function useSourceMapDebuggerData(event: Event, projectSlug: string) {
53-
const isSdkThatShouldShowSourceMapsDebugger =
54-
!!event.sdk?.name?.startsWith('sentry.javascript.');
53+
export type SourceMapDebugQueryResult = UseApiQueryResult<
54+
SourceMapDebugBlueThunderResponse,
55+
RequestError
56+
>;
57+
58+
export function useSourceMapDebugQuery(
59+
projectSlug: string,
60+
eventId: string,
61+
sdkName: string | null = null
62+
): SourceMapDebugQueryResult {
5563
const organization = useOrganization({allowNull: true});
56-
const {data: sourceMapDebuggerData} = useApiQuery<SourceMapDebugBlueThunderResponse>(
64+
const isSdkThatShouldShowSourceMapsDebugger =
65+
sdkName?.startsWith('sentry.javascript.') ?? false;
66+
return useApiQuery<SourceMapDebugBlueThunderResponse>(
5767
[
5868
getApiUrl(
5969
'/projects/$organizationIdOrSlug/$projectIdOrSlug/events/$eventId/source-map-debug-blue-thunder-edition/',
6070
{
6171
path: {
6272
organizationIdOrSlug: organization!.slug,
6373
projectIdOrSlug: projectSlug,
64-
eventId: event.id,
74+
eventId,
6575
},
6676
}
6777
),
6878
],
6979
{
70-
enabled: isSdkThatShouldShowSourceMapsDebugger && organization !== null,
80+
enabled:
81+
isSdkThatShouldShowSourceMapsDebugger &&
82+
!!organization &&
83+
!!projectSlug &&
84+
!!eventId,
7185
staleTime: Infinity,
7286
retry: false,
7387
refetchOnWindowFocus: false,
7488
}
7589
);
76-
return sourceMapDebuggerData;
7790
}
7891

7992
function getDebugIdProgress(

static/app/components/stackTrace/issueStackTrace/issueSourceMapsDebuggerAction.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {Button} from '@sentry/scraps/button';
66
import {openModal} from 'sentry/actionCreators/modal';
77
import {
88
prepareSourceMapDebuggerFrameInformation,
9-
useSourceMapDebuggerData,
9+
useSourceMapDebugQuery,
1010
} from 'sentry/components/events/interfaces/crashContent/exception/useSourceMapDebuggerData';
1111
import {SourceMapsDebuggerModal} from 'sentry/components/events/interfaces/sourceMapsDebuggerModal';
1212
import {VALID_SOURCE_MAP_DEBUGGER_FILE_EXTENSIONS} from 'sentry/components/stackTrace/frame/actions/utils';
@@ -24,7 +24,11 @@ export function IssueSourceMapsDebuggerAction() {
2424
const {exceptionIndex, hideSourceMapDebugger, project} = useStackTraceContext();
2525
const organization = useOrganization({allowNull: true});
2626

27-
const sourceMapDebuggerData = useSourceMapDebuggerData(event, project?.slug ?? '');
27+
const {data: sourceMapDebuggerData} = useSourceMapDebugQuery(
28+
project?.slug ?? '',
29+
event.id,
30+
event.sdk?.name ?? null
31+
);
2832
const debuggerFrame =
2933
exceptionIndex === undefined
3034
? undefined

static/app/utils/issueTypeConfig/configurationIssuesConfig.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {t} from 'sentry/locale';
2+
import {IssueType} from 'sentry/types/group';
23
import type {IssueCategoryConfigMapping} from 'sentry/utils/issueTypeConfig/types';
34
import {Tab} from 'sentry/views/issueDetails/types';
45

@@ -34,6 +35,7 @@ export const configurationIssuesConfig: IssueCategoryConfigMapping = {
3435
header: {
3536
filterBar: {enabled: true, fixedEnvironment: true, searchBar: {enabled: false}},
3637
graph: {enabled: true, type: 'discover-events'},
38+
eventNavigation: {enabled: true},
3739
tagDistribution: {enabled: false},
3840
occurrenceSummary: {enabled: false},
3941
},
@@ -51,4 +53,14 @@ export const configurationIssuesConfig: IssueCategoryConfigMapping = {
5153
discover: {enabled: false},
5254
groupingInfo: {enabled: false},
5355
},
56+
[IssueType.SOURCEMAP_CONFIGURATION]: {
57+
evidence: null,
58+
header: {
59+
filterBar: {enabled: false},
60+
graph: {enabled: false},
61+
eventNavigation: {enabled: false},
62+
tagDistribution: {enabled: false},
63+
occurrenceSummary: {enabled: false},
64+
},
65+
},
5466
};

static/app/utils/issueTypeConfig/cronConfig.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const cronConfig: IssueCategoryConfigMapping = {
2626
header: {
2727
filterBar: {enabled: true},
2828
graph: {enabled: true, type: 'cron-checks'},
29+
eventNavigation: {enabled: true},
2930
tagDistribution: {enabled: false},
3031
occurrenceSummary: {enabled: true},
3132
},

static/app/utils/issueTypeConfig/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const BASE_CONFIG: IssueTypeConfig = {
5252
header: {
5353
filterBar: {enabled: true, fixedEnvironment: false, searchBar: {enabled: true}},
5454
graph: {enabled: true, type: 'discover-events'},
55+
eventNavigation: {enabled: true},
5556
tagDistribution: {enabled: true},
5657
occurrenceSummary: {enabled: false},
5758
},

static/app/utils/issueTypeConfig/instrumentationConfig.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const instrumentationConfig: IssueCategoryConfigMapping = {
2020
header: {
2121
filterBar: {enabled: true, fixedEnvironment: true, searchBar: {enabled: false}},
2222
graph: {enabled: true, type: 'discover-events'},
23+
eventNavigation: {enabled: true},
2324
tagDistribution: {enabled: false},
2425
occurrenceSummary: {enabled: false},
2526
},

static/app/utils/issueTypeConfig/metricConfig.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export const metricConfig: IssueCategoryConfigMapping = {
107107
header: {
108108
filterBar: {enabled: true, fixedEnvironment: true, searchBar: {enabled: false}},
109109
graph: {enabled: true, type: 'detector-history'},
110+
eventNavigation: {enabled: true},
110111
tagDistribution: {enabled: false},
111112
occurrenceSummary: {enabled: false},
112113
},

static/app/utils/issueTypeConfig/metricIssueConfig.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const metricIssueConfig: IssueCategoryConfigMapping = {
2727
header: {
2828
filterBar: {enabled: true, fixedEnvironment: true},
2929
graph: {enabled: true, type: 'detector-history'},
30+
eventNavigation: {enabled: true},
3031
tagDistribution: {enabled: false},
3132
occurrenceSummary: {enabled: false},
3233
},

static/app/utils/issueTypeConfig/outageConfig.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const outageConfig: IssueCategoryConfigMapping = {
3535
header: {
3636
filterBar: {enabled: true},
3737
graph: {enabled: true, type: 'cron-checks'},
38+
eventNavigation: {enabled: true},
3839
tagDistribution: {enabled: false},
3940
occurrenceSummary: {enabled: true},
4041
},
@@ -69,6 +70,7 @@ export const outageConfig: IssueCategoryConfigMapping = {
6970
header: {
7071
filterBar: {enabled: true, fixedEnvironment: true},
7172
graph: {enabled: true, type: 'uptime-checks'},
73+
eventNavigation: {enabled: true},
7274
tagDistribution: {enabled: false},
7375
occurrenceSummary: {enabled: true, downtime: true},
7476
},

0 commit comments

Comments
 (0)