-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(discover): remove transactions and surface errors #119062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,20 +8,53 @@ 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 <Redirect to={redirectPath} />; | ||
| } | ||
|
|
||
| // 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 discoverPath = location.pathname | ||
| .replace('/explore/discover/', '') | ||
| .replaceAll('/', ''); | ||
| const targetPath = makeDiscoverPathname({ | ||
| path: `/${discoverPath}/`, | ||
| organization, | ||
| }); | ||
| return <Redirect to={targetPath + location.search} />; | ||
|
cursor[bot] marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discover redirect mangles pathnameHigh Severity For orgs with Reviewed by Cursor Bugbot for commit 50ff58a. Configure here. |
||
| } | ||
| // transactions dataset redirects to traces url as we don't support transactions anymore | ||
| return <Redirect to={normalizeUrl('/explore/traces/')} />; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Transaction redirect drops queryMedium Severity The transactions-dataset deprecation redirect sends users to traces with only Reviewed by Cursor Bugbot for commit 1c34048. Configure here. |
||
| } | ||
|
|
||
| function renderNoAccess() { | ||
| return ( | ||
| <Stack flex={1} padding="2xl 3xl"> | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.