landing.tsx 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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/llmMonitoring/llmMonitoringCharts';
  17. import {LLMMonitoringOnboarding} from 'sentry/views/llmMonitoring/onboarding';
  18. import {PipelinesTable} from 'sentry/views/llmMonitoring/pipelinesTable';
  19. import {useOnboardingProject} from 'sentry/views/performance/browser/webVitals/utils/useOnboardingProject';
  20. import * as ModuleLayout from 'sentry/views/performance/moduleLayout';
  21. import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
  22. export function LLMMonitoringPage() {
  23. const organization = useOrganization();
  24. const onboardingProject = useOnboardingProject();
  25. const isOnboarding = !!onboardingProject;
  26. return (
  27. <Layout.Page>
  28. <NoProjectMessage organization={organization}>
  29. <Layout.Header>
  30. <Layout.HeaderContent>
  31. <Breadcrumbs
  32. crumbs={[
  33. {
  34. label: t('Dashboard'),
  35. },
  36. {
  37. label: t('LLM Monitoring'),
  38. },
  39. ]}
  40. />
  41. <Layout.Title>
  42. {t('LLM Monitoring')}
  43. <PageHeadingQuestionTooltip
  44. title={t('View analytics and information about your AI pipelines')}
  45. docsUrl="https://docs.sentry.io/product/llm-monitoring/"
  46. />
  47. </Layout.Title>
  48. </Layout.HeaderContent>
  49. </Layout.Header>
  50. <Layout.Body>
  51. <Layout.Main fullWidth>
  52. <ModuleLayout.Layout>
  53. <ModuleLayout.Full>
  54. <PageFilterBar condensed>
  55. <ProjectPageFilter />
  56. <EnvironmentPageFilter />
  57. <DatePageFilter />
  58. </PageFilterBar>
  59. </ModuleLayout.Full>
  60. {isOnboarding ? (
  61. <ModuleLayout.Full>
  62. <LLMMonitoringOnboarding />
  63. </ModuleLayout.Full>
  64. ) : (
  65. <Fragment>
  66. <ModuleLayout.Third>
  67. <TotalTokensUsedChart />
  68. </ModuleLayout.Third>
  69. <ModuleLayout.Third>
  70. <NumberOfPipelinesChart />
  71. </ModuleLayout.Third>
  72. <ModuleLayout.Third>
  73. <PipelineDurationChart />
  74. </ModuleLayout.Third>
  75. <ModuleLayout.Full>
  76. <PipelinesTable />
  77. </ModuleLayout.Full>
  78. </Fragment>
  79. )}
  80. </ModuleLayout.Layout>
  81. </Layout.Main>
  82. </Layout.Body>
  83. </NoProjectMessage>
  84. </Layout.Page>
  85. );
  86. }
  87. function PageWithProviders() {
  88. return (
  89. <ModulePageProviders title={t('LLM Monitoring')} features="ai-analytics">
  90. <LLMMonitoringPage />
  91. </ModulePageProviders>
  92. );
  93. }
  94. export default PageWithProviders;