diff --git a/static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx b/static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx
index 0a4eff2610ac..106b5b37493a 100644
--- a/static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx
+++ b/static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx
@@ -108,6 +108,7 @@ export function isNavItemVisible(
return typeof item.show === 'function' ? item.show(context) : item.show;
}
import {useNotificationPermission} from 'sentry/serviceWorker/client/useNotificationPermission';
+import {getTransactionsDeprecation} from 'sentry/views/discover/utils';
import {CMDKAction} from './cmdk';
import {CommandPaletteSlot} from './commandPaletteSlot';
@@ -386,12 +387,24 @@ export function GlobalCommandPaletteActions() {
to={`${prefix}/explore/metrics/`}
/>
)}
- {organization.features.includes('explore-errors') && (
-
- )}
+ {organization.features.includes('explore-errors') &&
+ !getTransactionsDeprecation(organization) && (
+
+ )}
{organization.features.includes('profiling') && (
import('sentry/views/discover/eventDetails')),
},
];
- const discoverRoutes: SentryRouteObject = {
+ const discoverErrorsRoutes: SentryRouteObject = {
path: '/discover/',
component: make(() => import('sentry/views/discover')),
withOrgPath: true,
- children: discoverChildren,
+ children: discoverErrorsChildren,
};
const errorsChildren: SentryRouteObject[] = [
@@ -1711,7 +1711,7 @@ function buildRoutes(): RouteObject[] {
},
];
const errorsRoutes: SentryRouteObject = {
- path: '/errors/',
+ path: '/errors-v2/',
component: make(() => import('sentry/views/explore/errors')),
withOrgPath: true,
children: errorsChildren,
@@ -2260,10 +2260,15 @@ function buildRoutes(): RouteObject[] {
component: make(() => import('sentry/views/explore/replays/index')),
children: replayChildren,
},
+ {
+ path: 'errors/',
+ component: make(() => import('sentry/views/discover')),
+ children: discoverErrorsChildren,
+ },
{
path: 'discover/',
component: make(() => import('sentry/views/discover')),
- children: discoverChildren,
+ children: discoverErrorsChildren,
},
{
path: 'releases/',
@@ -2299,7 +2304,7 @@ function buildRoutes(): RouteObject[] {
],
},
{
- path: 'errors/',
+ path: 'errors-v2/',
component: make(() => import('sentry/views/explore/errors')),
children: errorsChildren,
},
@@ -2772,7 +2777,7 @@ function buildRoutes(): RouteObject[] {
releasesRoutes,
snapshotsRedirect,
statsRoutes,
- discoverRoutes,
+ discoverErrorsRoutes,
errorsRoutes,
performanceRoutes,
domainViewRoutes,
diff --git a/static/app/views/discover/index.tsx b/static/app/views/discover/index.tsx
index 4d3065696913..ffd9e5814539 100644
--- a/static/app/views/discover/index.tsx
+++ b/static/app/views/discover/index.tsx
@@ -8,20 +8,52 @@ import {AnalyticsArea} from 'sentry/components/analyticsArea';
import {NoProjectMessage} from 'sentry/components/noProjectMessage';
import {Redirect} from 'sentry/components/redirect';
import {t} from 'sentry/locale';
+import {SavedQueryDatasets} from 'sentry/utils/discover/types';
+import {normalizeUrl} from 'sentry/utils/url/normalizeUrl';
+import {useLocation} from 'sentry/utils/useLocation';
import {useOrganization} from 'sentry/utils/useOrganization';
+import {Dataset} from 'sentry/views/alerts/rules/metric/types';
+import {makeDiscoverPathname} from 'sentry/views/discover/pathnames';
+import {getTransactionsDeprecation} from 'sentry/views/discover/utils';
import {useRedirectNavigationV2Routes} from 'sentry/views/navigation/useRedirectNavigationV2Routes';
function DiscoverContainer() {
const organization = useOrganization();
+ const location = useLocation();
+ const discoverTransactionsDeprecation = getTransactionsDeprecation(organization);
const redirectPath = useRedirectNavigationV2Routes({
oldPathPrefix: '/discover/',
- newPathPrefix: '/explore/discover/',
+ newPathPrefix: discoverTransactionsDeprecation
+ ? '/explore/errors/'
+ : '/explore/discover/',
});
if (redirectPath) {
return ;
}
+ // Tranasctions deprecation redirects
+ if (
+ discoverTransactionsDeprecation &&
+ location.pathname.includes('/explore/discover/')
+ ) {
+ // errors dataset (or no dataset specified) redirects to errors url and keeps the same query params
+ if (
+ location.query.queryDataset !== SavedQueryDatasets.TRANSACTIONS &&
+ location.query.dataset !== Dataset.TRANSACTIONS
+ ) {
+ const match = location.pathname.match(/\/explore\/discover\/([^/]+)\//);
+ const discoverPath = match?.[1] ?? 'homepage';
+ const targetPath = makeDiscoverPathname({
+ path: `/${discoverPath}/`,
+ organization,
+ });
+ return ;
+ }
+ // transactions dataset redirects to traces url as we don't support transactions anymore
+ return ;
+ }
+
function renderNoAccess() {
return (
diff --git a/static/app/views/discover/pathnames.tsx b/static/app/views/discover/pathnames.tsx
index 17a92a91489b..c7f7770c6a20 100644
--- a/static/app/views/discover/pathnames.tsx
+++ b/static/app/views/discover/pathnames.tsx
@@ -1,7 +1,9 @@
import type {Organization} from 'sentry/types/organization';
import {normalizeUrl} from 'sentry/utils/url/normalizeUrl';
+import {getTransactionsDeprecation} from 'sentry/views/discover/utils';
const DISCOVER_BASE_PATHNAME = 'explore/discover';
+const ERRORS_BASE_PATHNAME = 'explore/errors';
export function makeDiscoverPathname({
path,
@@ -11,6 +13,8 @@ export function makeDiscoverPathname({
path: '/' | `/${string}/`;
}) {
return normalizeUrl(
- `/organizations/${organization.slug}/${DISCOVER_BASE_PATHNAME}${path}`
+ getTransactionsDeprecation(organization)
+ ? `/organizations/${organization.slug}/${ERRORS_BASE_PATHNAME}${path}`
+ : `/organizations/${organization.slug}/${DISCOVER_BASE_PATHNAME}${path}`
);
}
diff --git a/static/app/views/discover/results/resultsHeader.tsx b/static/app/views/discover/results/resultsHeader.tsx
index e6951daf8028..dd977c102ec6 100644
--- a/static/app/views/discover/results/resultsHeader.tsx
+++ b/static/app/views/discover/results/resultsHeader.tsx
@@ -1,6 +1,8 @@
import {Fragment, useCallback, useEffect, useState} from 'react';
import type {Location} from 'history';
+import type {ContainerProps} from '@sentry/scraps/layout';
+
import {fetchHomepageQuery} from 'sentry/actionCreators/discoverHomepageQueries';
import {fetchSavedQuery} from 'sentry/actionCreators/discoverSavedQueries';
import type {Client} from 'sentry/api';
@@ -16,6 +18,7 @@ import {DiscoverBreadcrumb} from 'sentry/views/discover/breadcrumb';
import SavedQueryButtonGroup from 'sentry/views/discover/savedQuery';
import {DatasetSelectorTabs} from 'sentry/views/discover/savedQuery/datasetSelectorTabs';
import {getSavedQueryWithDataset} from 'sentry/views/discover/savedQuery/utils';
+import {getTransactionsDeprecation} from 'sentry/views/discover/utils';
import {TopBar} from 'sentry/views/navigation/topBar';
type Props = {
@@ -103,7 +106,7 @@ function ResultsHeaderBase({
const title = (
- {t('Discover')}
+ {getTransactionsDeprecation(organization) ? t('Errors') : t('Discover')}
);
+ // there's some styling that gets messed up when choosing to not render the
+ // dataset selector tabs so i'm injecting some styles fix it. This should be removed
+ // when the dataset selector tabs are removed.
+ const deprecationHeaderStyles: ContainerProps<'header'> = {
+ padding: {
+ 'screen:sm': '0',
+ 'screen:md': '0',
+ },
+ borderBottom: {
+ '2xs': 'none',
+ xs: 'none',
+ sm: 'none',
+ md: 'none',
+ },
+ };
+
return (
-
+
{isHomepage ? (
{title}
@@ -133,12 +154,14 @@ function ResultsHeaderBase({
)}
{savedQueryButton}
-
+ {!getTransactionsDeprecation(organization) && (
+
+ )}
);
}
diff --git a/static/app/views/discover/utils.tsx b/static/app/views/discover/utils.tsx
index 761bcb69dcf1..c391dbdc9881 100644
--- a/static/app/views/discover/utils.tsx
+++ b/static/app/views/discover/utils.tsx
@@ -903,3 +903,7 @@ export const SAVED_QUERY_DATASET_TO_WIDGET_TYPE = {
[SavedQueryDatasets.ERRORS]: WidgetType.ERRORS,
[SavedQueryDatasets.TRANSACTIONS]: WidgetType.TRANSACTIONS,
};
+
+export function getTransactionsDeprecation(organization: Organization) {
+ return organization.features.includes('discover-saved-queries-deprecation');
+}
diff --git a/static/app/views/navigation/secondary/sections/explore/exploreSecondaryNavigation.tsx b/static/app/views/navigation/secondary/sections/explore/exploreSecondaryNavigation.tsx
index c62ba0d0f14d..9fcde4e255b3 100644
--- a/static/app/views/navigation/secondary/sections/explore/exploreSecondaryNavigation.tsx
+++ b/static/app/views/navigation/secondary/sections/explore/exploreSecondaryNavigation.tsx
@@ -5,6 +5,7 @@ import {FeatureBadge} from '@sentry/scraps/badge';
import Feature from 'sentry/components/acl/feature';
import {t} from 'sentry/locale';
import {useOrganization} from 'sentry/utils/useOrganization';
+import {getTransactionsDeprecation} from 'sentry/views/discover/utils';
import {CONVERSATIONS_LANDING_SUB_PATH} from 'sentry/views/explore/conversations/settings';
import {
MAX_STARRED_SAVED_QUERIES_IN_NAV,
@@ -23,6 +24,8 @@ export function ExploreSecondaryNavigation() {
perPage: MAX_STARRED_SAVED_QUERIES_IN_NAV,
});
+ const discoverTransactionsDeprecation = getTransactionsDeprecation(organization);
+
return (
{t('Explore')}
@@ -65,8 +68,8 @@ export function ExploreSecondaryNavigation() {
}
>
@@ -80,11 +83,19 @@ export function ExploreSecondaryNavigation() {
>
- {t('Discover')}
+ {discoverTransactionsDeprecation ? t('Errors') : t('Discover')}
diff --git a/tests/acceptance/test_organization_events_v2.py b/tests/acceptance/test_organization_events_v2.py
index 82353da48dfe..63bc390372fe 100644
--- a/tests/acceptance/test_organization_events_v2.py
+++ b/tests/acceptance/test_organization_events_v2.py
@@ -165,8 +165,8 @@ def setUp(self) -> None:
self.create_member(user=self.user, organization=self.org, role="owner", teams=[self.team])
self.login_as(self.user)
- self.landing_path = f"/organizations/{self.org.slug}/discover/queries/"
- self.result_path = f"/organizations/{self.org.slug}/discover/results/"
+ self.landing_path = f"/organizations/{self.org.slug}/explore/errors/queries/"
+ self.result_path = f"/organizations/{self.org.slug}/explore/errors/results/"
def wait_until_loaded(self) -> None:
self.browser.wait_until_not('[data-test-id="loading-indicator"]')