traceWarnings.tsx 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import Alert from 'sentry/components/alert';
  2. import ExternalLink from 'sentry/components/links/externalLink';
  3. import {t, tct} from 'sentry/locale';
  4. import {TraceType} from '../traceDetails/newTraceDetailsContent';
  5. type TraceWarningsProps = {
  6. type: TraceType;
  7. };
  8. export default function TraceWarnings({type}: TraceWarningsProps) {
  9. switch (type) {
  10. case TraceType.NO_ROOT:
  11. return (
  12. <Alert type="info" showIcon>
  13. <ExternalLink href="https://docs.sentry.io/product/performance/trace-view/#orphan-traces-and-broken-subtraces">
  14. {t(
  15. 'A root transaction is missing. Transactions linked by a dashed line have been orphaned and cannot be directly linked to the root.'
  16. )}
  17. </ExternalLink>
  18. </Alert>
  19. );
  20. case TraceType.BROKEN_SUBTRACES:
  21. return (
  22. <Alert type="info" showIcon>
  23. <ExternalLink href="https://docs.sentry.io/product/performance/trace-view/#orphan-traces-and-broken-subtraces">
  24. {t(
  25. 'This trace has broken subtraces. Transactions linked by a dashed line have been orphaned and cannot be directly linked to the root.'
  26. )}
  27. </ExternalLink>
  28. </Alert>
  29. );
  30. case TraceType.MULTIPLE_ROOTS:
  31. return (
  32. <Alert type="info" showIcon>
  33. <ExternalLink href="https://docs.sentry.io/product/sentry-basics/tracing/trace-view/#multiple-roots">
  34. {t('Multiple root transactions have been found with this trace ID.')}
  35. </ExternalLink>
  36. </Alert>
  37. );
  38. case TraceType.ONLY_ERRORS:
  39. return (
  40. <Alert type="info" showIcon>
  41. {tct(
  42. "The good news is we know these errors are related to each other. The bad news is that we can't tell you more than that. If you haven't already, [tracingLink: configure performance monitoring for your SDKs] to learn more about service interactions.",
  43. {
  44. tracingLink: (
  45. <ExternalLink href="https://docs.sentry.io/product/performance/getting-started/" />
  46. ),
  47. }
  48. )}
  49. </Alert>
  50. );
  51. case TraceType.ONE_ROOT:
  52. case TraceType.EMPTY_TRACE:
  53. return null;
  54. default:
  55. throw new TypeError('Invalid trace type');
  56. }
  57. }