-
-
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 all commits
9416ed4
a4bb70f
50ff58a
1c34048
93e3565
50bcb85
dde9d50
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,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 <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 match = location.pathname.match(/\/explore\/discover\/([^/]+)\//); | ||
| const discoverPath = match?.[1] ?? 'homepage'; | ||
| const targetPath = makeDiscoverPathname({ | ||
| path: `/${discoverPath}/`, | ||
| organization, | ||
| }); | ||
| return <Redirect to={targetPath + location.search} />; | ||
|
cursor[bot] marked this conversation as resolved.
cursor[bot] marked this conversation as resolved.
|
||
| } | ||
| // transactions dataset redirects to traces url as we don't support transactions anymore | ||
| return <Redirect to={normalizeUrl('/explore/traces/')} />; | ||
|
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. Transaction redirect skips errors pathMedium Severity With Reviewed by Cursor Bugbot for commit dde9d50. Configure here. |
||
|
|
||
| function renderNoAccess() { | ||
| return ( | ||
| <Stack flex={1} padding="2xl 3xl"> | ||
|
|
||


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