profilingOnboarding.tsx 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import {useEffect} from 'react';
  2. import styled from '@emotion/styled';
  3. import Alert from 'sentry/components/alert';
  4. import Button from 'sentry/components/button';
  5. import FeatureBadge from 'sentry/components/featureBadge';
  6. import * as Layout from 'sentry/components/layouts/thirds';
  7. import ExternalLink from 'sentry/components/links/externalLink';
  8. import List from 'sentry/components/list';
  9. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  10. import {t} from 'sentry/locale';
  11. import {PageContent} from 'sentry/styles/organization';
  12. import space from 'sentry/styles/space';
  13. import {Organization} from 'sentry/types/organization';
  14. import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent';
  15. interface Props {
  16. onDismissClick: () => void;
  17. onDoneClick: () => void;
  18. organization: Organization;
  19. }
  20. export default function ProfilingOnboarding(props: Props) {
  21. useEffect(() => {
  22. trackAdvancedAnalyticsEvent('profiling_views.onboarding', {
  23. organization: props.organization,
  24. });
  25. }, [props.organization]);
  26. return (
  27. <SentryDocumentTitle title={t('Profiling')} orgSlug={props.organization.slug}>
  28. <StyledPageContent>
  29. <Main>
  30. <Layout.Title>
  31. {t('Welcome to Sentry Profiling')}
  32. <FeatureBadge type="alpha" />
  33. </Layout.Title>
  34. <Content>
  35. <p>
  36. {t(`With Sentry Profiling you can instrument your native iOS and Android apps to
  37. collect profiles for your transactions. This gives you a unique insight into what
  38. is on the execution stack at any point during the duration of the transaction.
  39. Data is collected in production, on real devices with real users.`)}
  40. </p>
  41. <Alert>
  42. {t(
  43. `Profiling is only possible with sentry-cocoa and sentry-java SDKs right now. We don’t support React Native or Flutter yet.`
  44. )}
  45. </Alert>
  46. <ProfilingSteps symbol="colored-numeric">
  47. <li>
  48. {t(
  49. 'Make sure your SDKs are upgraded to 6.0.0 (sentry-java) or 7.13.0 (sentry-cocoa).'
  50. )}
  51. </li>
  52. <li>
  53. {t(
  54. `Setup performance transactions in your app if you haven’t already → `
  55. )}{' '}
  56. <ExternalLink
  57. openInNewTab
  58. href="https://docs.sentry.io/product/performance/"
  59. >
  60. {t('https://docs.sentry.io/product/performance/')}
  61. </ExternalLink>
  62. </li>
  63. <li>
  64. {t('Enable profiling in your app by configuring the SDKs like below:')}
  65. <pre>
  66. <code>{`SentrySDK.start { options in
  67. options.dsn = "..."
  68. options.tracesSampleRate = 1.0 // Make sure transactions are enabled
  69. options.enableProfiling = true
  70. }`}</code>
  71. </pre>
  72. <pre>
  73. <code>
  74. {`<application>
  75. <meta-data android:name="io.sentry.dsn" android:value="..." />
  76. <meta-data android:name="io.sentry.traces.sample-rate" android:value="1.0" />
  77. <meta-data android:name="io.sentry.traces.profiling.enable" android:value="true" />
  78. </application>`}
  79. </code>
  80. </pre>
  81. </li>
  82. <li>
  83. {t('Join the discussion on')}{' '}
  84. <ExternalLink openInNewTab href="https://discord.gg/FvQuVVCD">
  85. Discord
  86. </ExternalLink>{' '}
  87. {t(
  88. 'or email us at profiling@sentry.io with any questions or if you need help setting it all up! There’s also a page with some more details and a troubleshooting section at'
  89. )}{' '}
  90. <ExternalLink
  91. openInNewTab
  92. href="https://sentry.notion.site/Profiling-Beta-Testing-Instructions-413ecdd9fcb34b3a8b57806280bf2ecb"
  93. >
  94. {t('our notion page')}
  95. </ExternalLink>
  96. </li>
  97. <Actions>
  98. <Button priority="primary" onClick={props.onDoneClick}>
  99. {t("I'm done")}
  100. </Button>
  101. <Button onClick={props.onDismissClick}>{t('Dismiss')}</Button>
  102. </Actions>
  103. </ProfilingSteps>
  104. </Content>
  105. </Main>
  106. </StyledPageContent>
  107. </SentryDocumentTitle>
  108. );
  109. }
  110. const Content = styled('div')`
  111. margin: ${space(2)} 0 ${space(3)} 0;
  112. `;
  113. const Actions = styled('div')`
  114. margin-top: ${space(4)};
  115. > button:not(:first-child) {
  116. margin-left: ${space(2)};
  117. }
  118. `;
  119. const StyledPageContent = styled(PageContent)`
  120. background-color: ${p => p.theme.background};
  121. `;
  122. const ProfilingSteps = styled(List)`
  123. li {
  124. margin-bottom: ${space(1)};
  125. position: relative;
  126. }
  127. `;
  128. const Main = styled('div')`
  129. width: 100%;
  130. pre:not(:last-child) {
  131. margin-top: ${space(2)};
  132. }
  133. `;