Skip to content

Commit 1ee2c19

Browse files
evanpurkhiserandrewshie-sentry
authored andcommitted
feat(crons/uptime): Move to insights top-level nav (#92459)
Before this change both Crons and Uptime were hidden under Backend and Frontend inisghts. These are now directly available in the insights secondary nav <img alt="clipboard.png" width="301" src="https://i.imgur.com/0OcoryB.png" />
1 parent 3a56151 commit 1ee2c19

File tree

23 files changed

+119
-236
lines changed

23 files changed

+119
-236
lines changed

static/app/components/assistant/getGuidesContent.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -190,24 +190,6 @@ export default function getGuidesContent(
190190
},
191191
],
192192
},
193-
{
194-
guide: 'crons_backend_insights',
195-
requiredTargets: ['crons_backend_insights'],
196-
steps: [
197-
{
198-
title: t('Crons are now Alerts'),
199-
target: 'crons_backend_insights',
200-
description: tct(
201-
'Crons are now a type of Sentry Alert and can be managed there. The detailed timeline is now here under Insights\u00A0→\u00A0Backend. [link:Learn more].',
202-
{
203-
link: (
204-
<ExternalLink href="https://docs.sentry.io/product/crons/alerts-backend-insights-migration/" />
205-
),
206-
}
207-
),
208-
},
209-
],
210-
},
211193
{
212194
guide: 'issue_views_page_filters_persistence',
213195
requiredTargets: ['issue_views_page_filters_persistence'],

static/app/components/sidebar/index.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ describe('Sidebar', function () {
377377
'Backend',
378378
'Mobile',
379379
'AI',
380-
'User Feedback',
381380
'Crons',
381+
'User Feedback',
382382
'Alerts',
383383
'Dashboards',
384384
'Releases',

static/app/components/sidebar/index.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
IconSiren,
3636
IconStats,
3737
IconTelescope,
38-
IconTimer,
3938
} from 'sentry/icons';
4039
import {t} from 'sentry/locale';
4140
import ConfigStore from 'sentry/stores/configStore';
@@ -269,16 +268,6 @@ function Sidebar() {
269268
/>
270269
);
271270

272-
const monitors = hasOrganization && (
273-
<SidebarItem
274-
{...sidebarItemProps}
275-
icon={<IconTimer />}
276-
label={t('Crons')}
277-
to={`/organizations/${organization.slug}/crons/`}
278-
id="crons"
279-
/>
280-
);
281-
282271
const replays = hasOrganization && (
283272
<Feature
284273
hookName="feature-disabled:replay-sidebar-item"
@@ -404,6 +393,22 @@ function Sidebar() {
404393
icon={<SubitemDot collapsed />}
405394
/>
406395
</AgentInsightsFeature>
396+
<SidebarItem
397+
{...sidebarItemProps}
398+
label={t('Crons')}
399+
to={`/organizations/${organization.slug}/${DOMAIN_VIEW_BASE_URL}/crons/`}
400+
id="performance-crons"
401+
icon={<SubitemDot collapsed />}
402+
/>
403+
<Feature features={['uptime']} organization={organization}>
404+
<SidebarItem
405+
{...sidebarItemProps}
406+
label={t('Uptime')}
407+
to={`/organizations/${organization.slug}/${DOMAIN_VIEW_BASE_URL}/uptime/`}
408+
id="performance-uptime"
409+
icon={<SubitemDot collapsed />}
410+
/>
411+
</Feature>
407412
</SidebarAccordion>
408413
</Feature>
409414
);
@@ -458,7 +463,6 @@ function Sidebar() {
458463

459464
<SidebarSection>
460465
{feedback}
461-
{monitors}
462466
{alerts}
463467
{dashboards}
464468
{releases}

static/app/routes.tsx

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,15 +1434,6 @@ function buildRoutes() {
14341434
</Fragment>
14351435
);
14361436

1437-
// XXX(epurkhiser): This is legacy until we remove crons from the sidebar
1438-
const cronsRoutes = (
1439-
<Route
1440-
path="/crons/"
1441-
component={make(() => import('sentry/views/monitors'))}
1442-
withOrgPath
1443-
/>
1444-
);
1445-
14461437
const replayChildRoutes = (
14471438
<Fragment>
14481439
<IndexRoute component={make(() => import('sentry/views/replays/list'))} />
@@ -1728,11 +1719,6 @@ function buildRoutes() {
17281719
)}
17291720
/>
17301721
</Route>
1731-
<Route path={`${MODULE_BASE_URLS[ModuleName.UPTIME]}/`}>
1732-
<IndexRoute
1733-
component={make(() => import('sentry/views/insights/uptime/views/overview'))}
1734-
/>
1735-
</Route>
17361722
<Route path={`${MODULE_BASE_URLS[ModuleName.AI]}/`}>
17371723
<IndexRoute
17381724
component={make(
@@ -1748,11 +1734,6 @@ function buildRoutes() {
17481734
)}
17491735
/>
17501736
</Route>
1751-
<Route path={`${MODULE_BASE_URLS[ModuleName.CRONS]}/`}>
1752-
<IndexRoute
1753-
component={make(() => import('sentry/views/insights/crons/views/overview'))}
1754-
/>
1755-
</Route>
17561737
<Route path={`${MODULE_BASE_URLS[ModuleName.SESSIONS]}/`}>
17571738
<IndexRoute
17581739
component={make(() => import('sentry/views/insights/sessions/views/overview'))}
@@ -1811,6 +1792,19 @@ function buildRoutes() {
18111792
<Route path="projects/" component={make(() => import('sentry/views/projects/'))}>
18121793
{projectsChildRoutes}
18131794
</Route>
1795+
<Redirect from={`${BACKEND_LANDING_SUB_PATH}/uptime/`} to="/insights/uptime/" />
1796+
<Redirect from={`${BACKEND_LANDING_SUB_PATH}/crons/`} to="/insights/crons/" />
1797+
<Redirect from={`${FRONTEND_LANDING_SUB_PATH}/crons/`} to="/insights/crons/" />
1798+
<Route path="uptime/">
1799+
<IndexRoute
1800+
component={make(() => import('sentry/views/insights/uptime/views/overview'))}
1801+
/>
1802+
</Route>
1803+
<Route path="crons/">
1804+
<IndexRoute
1805+
component={make(() => import('sentry/views/insights/crons/views/overview'))}
1806+
/>
1807+
</Route>
18141808
</Route>
18151809
);
18161810

@@ -2454,7 +2448,6 @@ function buildRoutes() {
24542448
{issueRoutes}
24552449
{alertRoutes}
24562450
{codecovRoutes}
2457-
{cronsRoutes}
24582451
{replayRoutes}
24592452
{releasesRoutes}
24602453
{statsRoutes}

static/app/views/alerts/filterBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ function FilterBar({
5151
}}
5252
menuFooter={
5353
<ButtonBar gap={1}>
54-
<LinkButton size="xs" icon={<IconOpen />} to="/insights/backend/crons/">
54+
<LinkButton size="xs" icon={<IconOpen />} to="/insights/crons/">
5555
{t('Crons Overview')}
5656
</LinkButton>
57-
<LinkButton size="xs" icon={<IconOpen />} to="/insights/backend/uptime/">
57+
<LinkButton size="xs" icon={<IconOpen />} to="/insights/uptime/">
5858
{t('Uptime Overview')}
5959
</LinkButton>
6060
</ButtonBar>

static/app/views/insights/common/components/modulesOnboarding.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -497,22 +497,6 @@ const EMPTY_STATE_CONTENT: Record<TitleableModuleNames, EmptyStateContent> = {
497497
],
498498
supportedSdks: ['android', 'flutter', 'apple-ios', 'react-native'],
499499
},
500-
// XXX(epurkhiser): Crons does not use the insights onboarding component.
501-
crons: {
502-
description: null,
503-
heading: null,
504-
imageSrc: null,
505-
valuePropDescription: null,
506-
valuePropPoints: [],
507-
},
508-
// XXX(epurkhiser): Uptime does not use the insights onboarding component.
509-
uptime: {
510-
description: null,
511-
heading: null,
512-
imageSrc: null,
513-
valuePropDescription: null,
514-
valuePropPoints: [],
515-
},
516500
sessions: {
517501
heading: t(`Get insights about your application's session health`),
518502
description: tct(

static/app/views/insights/common/queries/useHasFirstSpan.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const excludedModuleNames = [
88
ModuleName.OTHER,
99
ModuleName.MOBILE_UI,
1010
ModuleName.MOBILE_VITALS,
11-
ModuleName.CRONS,
12-
ModuleName.UPTIME,
1311
ModuleName.SESSIONS,
1412
ModuleName.AGENTS,
1513
] as const;

static/app/views/insights/common/utils/useModuleURL.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {BASE_URL as AGENTS_BASE_URL} from 'sentry/views/insights/agentMonitoring
44
import {BASE_URL as RESOURCES_BASE_URL} from 'sentry/views/insights/browser/resources/settings';
55
import {BASE_URL as VITALS_BASE_URL} from 'sentry/views/insights/browser/webVitals/settings';
66
import {BASE_URL as CACHE_BASE_URL} from 'sentry/views/insights/cache/settings';
7-
import {BASE_URL as CRONS_BASE_URL} from 'sentry/views/insights/crons/settings';
87
import {BASE_URL as DB_BASE_URL} from 'sentry/views/insights/database/settings';
98
import {BASE_URL as HTTP_BASE_URL} from 'sentry/views/insights/http/settings';
109
import {BASE_URL as AI_BASE_URL} from 'sentry/views/insights/llmMonitoring/settings';
@@ -22,7 +21,6 @@ import {getModuleView} from 'sentry/views/insights/pages/utils';
2221
import {BASE_URL as QUEUE_BASE_URL} from 'sentry/views/insights/queues/settings';
2322
import {BASE_URL as SESSIONS_BASE_URL} from 'sentry/views/insights/sessions/settings';
2423
import {ModuleName} from 'sentry/views/insights/types';
25-
import {BASE_URL as UPTIME_BASE_URL} from 'sentry/views/insights/uptime/settings';
2624

2725
export const MODULE_BASE_URLS: Record<ModuleName, string> = {
2826
[ModuleName.DB]: DB_BASE_URL,
@@ -38,8 +36,6 @@ export const MODULE_BASE_URLS: Record<ModuleName, string> = {
3836
[ModuleName.MOBILE_UI]: MOBILE_UI_BASE_URL,
3937
[ModuleName.MOBILE_VITALS]: MOBILE_SCREENS_BASE_URL,
4038
[ModuleName.SCREEN_RENDERING]: SCREEN_RENDERING_BASE_URL,
41-
[ModuleName.CRONS]: CRONS_BASE_URL,
42-
[ModuleName.UPTIME]: UPTIME_BASE_URL,
4339
[ModuleName.SESSIONS]: SESSIONS_BASE_URL,
4440
[ModuleName.OTHER]: '',
4541
};

static/app/views/insights/common/views/spans/selectors/actionSelector.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ const LABEL_FOR_MODULE_NAME: Record<ModuleName, ReactNode> = {
125125
screen_load: t('Action'),
126126
app_start: t('Action'),
127127
resource: t('Resource'),
128-
crons: t('Action'),
129-
uptime: t('Action'),
130128
other: t('Action'),
131129
'mobile-ui': t('Action'),
132130
'mobile-vitals': t('Action'),

static/app/views/insights/crons/components/monitorHeaderActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function MonitorHeaderActions({monitor, orgSlug, onUpdate}: Props) {
4040
await deleteMonitor(api, orgSlug, monitor);
4141
browserHistory.push(
4242
normalizeUrl({
43-
pathname: `/organizations/${orgSlug}/insights/backend/crons/`,
43+
pathname: `/organizations/${orgSlug}/insights/crons/`,
4444
query: endpointOptions.query,
4545
})
4646
);
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
import {t} from 'sentry/locale';
22

3-
export const MODULE_TITLE = t('Cron Monitors');
4-
export const DATA_TYPE = t('Cron Check-In');
5-
export const DATA_TYPE_PLURAL = t('Cron Check-Ins');
6-
export const BASE_URL = 'crons';
7-
83
export const MODULE_DESCRIPTION = t(
94
'Scheduled monitors that check in on recurring jobs and tell you if they’re running on schedule, failing, or succeeding.'
105
);
116
export const MODULE_DOC_LINK = 'https://docs.sentry.io/product/crons/';
12-
13-
export const MODULE_FEATURES = [];
14-
export const MODULE_VISIBLE_FEATURES = [];

static/app/views/insights/crons/views/overview.tsx

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ import * as qs from 'query-string';
44

55
import {openBulkEditMonitorsModal} from 'sentry/actionCreators/modal';
66
import {deleteProjectProcessingErrorByType} from 'sentry/actionCreators/monitors';
7-
import GuideAnchor from 'sentry/components/assistant/guideAnchor';
87
import {Button} from 'sentry/components/core/button';
98
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
9+
import FeedbackWidgetButton from 'sentry/components/feedback/widget/feedbackWidgetButton';
1010
import HookOrDefault from 'sentry/components/hookOrDefault';
1111
import * as Layout from 'sentry/components/layouts/thirds';
1212
import LoadingIndicator from 'sentry/components/loadingIndicator';
13+
import NoProjectMessage from 'sentry/components/noProjectMessage';
1314
import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
1415
import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
1516
import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
17+
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
1618
import {normalizeDateTimeParams} from 'sentry/components/organizations/pageFilters/parse';
1719
import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
1820
import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionTooltip';
1921
import Pagination from 'sentry/components/pagination';
2022
import SearchBar from 'sentry/components/searchBar';
23+
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
2124
import {IconAdd, IconList} from 'sentry/icons';
2225
import {t} from 'sentry/locale';
2326
import {space} from 'sentry/styles/space';
@@ -29,7 +32,6 @@ import useApi from 'sentry/utils/useApi';
2932
import {useLocation} from 'sentry/utils/useLocation';
3033
import {useNavigate} from 'sentry/utils/useNavigate';
3134
import useOrganization from 'sentry/utils/useOrganization';
32-
import {ModulePageProviders} from 'sentry/views/insights/common/components/modulePageProviders';
3335
import {
3436
CronsLandingPanel,
3537
isValidGuide,
@@ -40,19 +42,13 @@ import {OverviewTimeline} from 'sentry/views/insights/crons/components/overviewT
4042
import {OwnerFilter} from 'sentry/views/insights/crons/components/ownerFilter';
4143
import {MonitorProcessingErrors} from 'sentry/views/insights/crons/components/processingErrors/monitorProcessingErrors';
4244
import {makeMonitorListErrorsQueryKey} from 'sentry/views/insights/crons/components/processingErrors/utils';
43-
import {
44-
MODULE_DESCRIPTION,
45-
MODULE_DOC_LINK,
46-
MODULE_TITLE,
47-
} from 'sentry/views/insights/crons/settings';
45+
import {MODULE_DESCRIPTION, MODULE_DOC_LINK} from 'sentry/views/insights/crons/settings';
4846
import type {
4947
CheckinProcessingError,
5048
Monitor,
5149
ProcessingErrorType,
5250
} from 'sentry/views/insights/crons/types';
5351
import {makeMonitorListQueryKey} from 'sentry/views/insights/crons/utils';
54-
import {BackendHeader} from 'sentry/views/insights/pages/backend/backendPageHeader';
55-
import {ModuleName} from 'sentry/views/insights/types';
5652

5753
const CronsListPageHeader = HookOrDefault({
5854
hookName: 'component:crons-list-page-header',
@@ -105,22 +101,22 @@ function CronsOverview() {
105101

106102
const showAddMonitor = !isValidPlatform(platform) || !isValidGuide(guide);
107103

108-
return (
104+
const page = (
109105
<Fragment>
110106
<CronsListPageHeader organization={organization} />
111-
<BackendHeader
112-
headerTitle={
113-
<Fragment>
114-
<GuideAnchor target="crons_backend_insights">{MODULE_TITLE}</GuideAnchor>
107+
<Layout.Header unified>
108+
<Layout.HeaderContent>
109+
<Layout.Title>
110+
{t('Cron Monitors')}
115111
<PageHeadingQuestionTooltip
116112
docsUrl={MODULE_DOC_LINK}
117113
title={MODULE_DESCRIPTION}
118114
/>
119-
</Fragment>
120-
}
121-
module={ModuleName.CRONS}
122-
headerActions={
115+
</Layout.Title>
116+
</Layout.HeaderContent>
117+
<Layout.HeaderActions>
123118
<ButtonBar gap={1}>
119+
<FeedbackWidgetButton />
124120
<Button
125121
icon={<IconList />}
126122
size="sm"
@@ -140,8 +136,8 @@ function CronsOverview() {
140136
</NewMonitorButton>
141137
)}
142138
</ButtonBar>
143-
}
144-
/>
139+
</Layout.HeaderActions>
140+
</Layout.Header>
145141
<Layout.Body>
146142
<Layout.Main fullWidth>
147143
<Filters>
@@ -192,17 +188,17 @@ function CronsOverview() {
192188
</Layout.Body>
193189
</Fragment>
194190
);
195-
}
196191

197-
function PageWithProviders() {
198192
return (
199-
<ModulePageProviders moduleName="crons" pageTitle={t('Overview')}>
200-
<CronsOverview />
201-
</ModulePageProviders>
193+
<NoProjectMessage organization={organization}>
194+
<SentryDocumentTitle title={t('Cron Monitors')} orgSlug={organization.slug}>
195+
<PageFiltersContainer>{page}</PageFiltersContainer>
196+
</SentryDocumentTitle>
197+
</NoProjectMessage>
202198
);
203199
}
204200

205-
export default PageWithProviders;
201+
export default CronsOverview;
206202

207203
const Filters = styled('div')`
208204
display: flex;

static/app/views/insights/pages/backend/settings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export const MODULES = [
1313
ModuleName.HTTP,
1414
ModuleName.CACHE,
1515
ModuleName.QUEUE,
16-
ModuleName.CRONS,
17-
ModuleName.UPTIME,
1816
];
1917

2018
export const OVERVIEW_PAGE_ALLOWED_OPS = ['http.server'];

static/app/views/insights/pages/frontend/settings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export const MODULES = [
3434
ModuleName.HTTP,
3535
ModuleName.RESOURCE,
3636
ModuleName.SESSIONS,
37-
ModuleName.UPTIME,
3837
];
3938

4039
// Mirrors `FRONTEND` in src/sentry/utils/platform_categories.py, except shared platforms are removed

0 commit comments

Comments
 (0)