traceWarnings.tsx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import * as Sentry from '@sentry/react';
  2. import Alert from 'sentry/components/alert';
  3. import ExternalLink from 'sentry/components/links/externalLink';
  4. import {t, tct} from 'sentry/locale';
  5. import {TraceType} from '../traceDetails/newTraceDetailsContent';
  6. type TraceWarningsProps = {
  7. type: TraceType;
  8. };
  9. export function TraceWarnings({type}: TraceWarningsProps) {
  10. switch (type) {
  11. case TraceType.NO_ROOT:
  12. return (
  13. <Alert type="info" showIcon>
  14. <ExternalLink href="https://docs.sentry.io/product/performance/trace-view/#orphan-traces-and-broken-subtraces">
  15. {t(
  16. 'A root transaction is missing. Transactions linked by a dashed line have been orphaned and cannot be directly linked to the root.'
  17. )}
  18. </ExternalLink>
  19. </Alert>
  20. );
  21. case TraceType.BROKEN_SUBTRACES:
  22. return (
  23. <Alert type="info" showIcon>
  24. <ExternalLink href="https://docs.sentry.io/product/performance/trace-view/#orphan-traces-and-broken-subtraces">
  25. {t(
  26. 'This trace has broken subtraces. Transactions linked by a dashed line have been orphaned and cannot be directly linked to the root.'
  27. )}
  28. </ExternalLink>
  29. </Alert>
  30. );
  31. case TraceType.MULTIPLE_ROOTS:
  32. return (
  33. <Alert type="info" showIcon>
  34. <ExternalLink href="https://docs.sentry.io/product/sentry-basics/tracing/trace-view/#multiple-roots">
  35. {t('Multiple root transactions have been found with this trace ID.')}
  36. </ExternalLink>
  37. </Alert>
  38. );
  39. case TraceType.ONLY_ERRORS:
  40. return (
  41. <Alert type="info" showIcon>
  42. {tct(
  43. "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.",
  44. {
  45. tracingLink: (
  46. <ExternalLink href="https://docs.sentry.io/product/performance/getting-started/" />
  47. ),
  48. }
  49. )}
  50. </Alert>
  51. );
  52. case TraceType.ONE_ROOT:
  53. case TraceType.EMPTY_TRACE:
  54. return null;
  55. default:
  56. Sentry.captureMessage(`Unhandled trace type - ${type}`);
  57. return null;
  58. }
  59. }