landing.tsx 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import {Fragment} from 'react';
  2. import {Breadcrumbs} from 'sentry/components/breadcrumbs';
  3. import * as Layout from 'sentry/components/layouts/thirds';
  4. import NoProjectMessage from 'sentry/components/noProjectMessage';
  5. import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
  6. import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
  7. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  8. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  9. import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionTooltip';
  10. import {t} from 'sentry/locale';
  11. import useOrganization from 'sentry/utils/useOrganization';
  12. import {
  13. NumberOfPipelinesChart,
  14. PipelineDurationChart,
  15. TotalTokensUsedChart,
  16. } from 'sentry/views/aiMonitoring/aiMonitoringCharts';
  17. import {AIMonitoringOnboarding} from 'sentry/views/aiMonitoring/onboarding';
  18. import {PipelinesTable} from 'sentry/views/aiMonitoring/PipelinesTable';
  19. import {BASE_URL} from 'sentry/views/aiMonitoring/settings';
  20. import {useOnboardingProject} from 'sentry/views/performance/browser/webVitals/utils/useOnboardingProject';
  21. import * as ModuleLayout from 'sentry/views/performance/moduleLayout';
  22. import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
  23. export function AiMonitoringPage() {
  24. const organization = useOrganization();
  25. const onboardingProject = useOnboardingProject();
  26. const isOnboarding = !!onboardingProject;
  27. return (
  28. <Layout.Page>
  29. <NoProjectMessage organization={organization}>
  30. <Layout.Header>
  31. <Layout.HeaderContent>
  32. <Breadcrumbs
  33. crumbs={[
  34. {
  35. label: t('Dashboard'),
  36. },
  37. {
  38. label: t('AI Monitoring'),
  39. },
  40. ]}
  41. />
  42. <Layout.Title>
  43. {t('AI Monitoring')}
  44. <PageHeadingQuestionTooltip
  45. title={t('View analytics and information about your AI pipelines')}
  46. docsUrl="https://docs.sentry.io/product/ai-monitoring/"
  47. />
  48. </Layout.Title>
  49. </Layout.HeaderContent>
  50. </Layout.Header>
  51. <Layout.Body>
  52. <Layout.Main fullWidth>
  53. <ModuleLayout.Layout>
  54. <ModuleLayout.Full>
  55. <PageFilterBar condensed>
  56. <ProjectPageFilter />
  57. <EnvironmentPageFilter />
  58. <DatePageFilter />
  59. </PageFilterBar>
  60. </ModuleLayout.Full>
  61. {isOnboarding ? (
  62. <ModuleLayout.Full>
  63. <AIMonitoringOnboarding />
  64. </ModuleLayout.Full>
  65. ) : (
  66. <Fragment>
  67. <ModuleLayout.Third>
  68. <TotalTokensUsedChart />
  69. </ModuleLayout.Third>
  70. <ModuleLayout.Third>
  71. <NumberOfPipelinesChart />
  72. </ModuleLayout.Third>
  73. <ModuleLayout.Third>
  74. <PipelineDurationChart />
  75. </ModuleLayout.Third>
  76. <ModuleLayout.Full>
  77. <PipelinesTable />
  78. </ModuleLayout.Full>
  79. </Fragment>
  80. )}
  81. </ModuleLayout.Layout>
  82. </Layout.Main>
  83. </Layout.Body>
  84. </NoProjectMessage>
  85. </Layout.Page>
  86. );
  87. }
  88. function PageWithProviders() {
  89. return (
  90. <ModulePageProviders
  91. title={t('AI Monitoring')}
  92. baseURL={BASE_URL}
  93. features="ai-analytics"
  94. >
  95. <AiMonitoringPage />
  96. </ModulePageProviders>
  97. );
  98. }
  99. export default PageWithProviders;