processingErrorItem.tsx 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import ExternalLink from 'sentry/components/links/externalLink';
  2. import Link from 'sentry/components/links/link';
  3. import {tct} from 'sentry/locale';
  4. import {type ProcessingError, ProcessingErrorType} from 'sentry/views/monitors/types';
  5. interface Props {
  6. checkinTooltip: React.ReactNode;
  7. error: ProcessingError;
  8. }
  9. export function ProcessingErrorItem({error, checkinTooltip}: Props) {
  10. switch (error.type) {
  11. case ProcessingErrorType.CHECKIN_ENVIRONMENT_MISMATCH:
  12. return tct(
  13. 'The environment of the second [checkinTooltip:check-in] does not match the original "[env]" environment. Ensure both check-ins have the same environment.',
  14. {checkinTooltip, env: error.existingEnvironment}
  15. );
  16. case ProcessingErrorType.CHECKIN_FINISHED:
  17. return tct(
  18. 'A [checkinTooltip:check-in] update was sent to a check-in that has already succeeded or failed. Only in-progress check-ins can be updated.',
  19. {checkinTooltip}
  20. );
  21. case ProcessingErrorType.CHECKIN_GUID_PROJECT_MISMATCH:
  22. return tct(
  23. 'The [checkinTooltip:check-in] GUID provided matched to an existing check-in for a project that is different than the associated project DSN. Use the correct DSN to successfully update your check-in.',
  24. {checkinTooltip}
  25. );
  26. case ProcessingErrorType.CHECKIN_INVALID_DURATION:
  27. return tct(
  28. 'A [checkinTooltip:check-in] was sent with an invalid duration of "[duration]".',
  29. {
  30. checkinTooltip,
  31. duration: error.duration,
  32. }
  33. );
  34. case ProcessingErrorType.CHECKIN_INVALID_GUID:
  35. return tct('A [checkinTooltip:check-in] was sent with an invalid GUID.', {
  36. checkinTooltip,
  37. });
  38. case ProcessingErrorType.CHECKIN_VALIDATION_FAILED:
  39. return tct(
  40. 'A [checkinTooltip:check-in] was sent with an invalid payload. Learn more about the check-in payload in our [link:documentation]',
  41. {
  42. checkinTooltip,
  43. link: (
  44. <ExternalLink href="https://docs.sentry.io/product/crons/getting-started/http/" />
  45. ),
  46. }
  47. );
  48. case ProcessingErrorType.MONITOR_DISABLED:
  49. return tct(
  50. 'A [checkinTooltip:check-in] was sent but was discarded because the monitor is disabled.',
  51. {checkinTooltip}
  52. );
  53. case ProcessingErrorType.MONITOR_DISABLED_NO_QUOTA:
  54. return tct(
  55. 'A [checkinTooltip:check-in] upsert was sent but dropped due to insufficient quota. To create new monitors, increase your Crons on-demand budget in your [link: subscription settings].',
  56. {checkinTooltip, link: <Link to="/settings/billing/overview/" />}
  57. );
  58. case ProcessingErrorType.MONITOR_INVALID_CONFIG:
  59. return tct(
  60. 'A monitor failed to upsert due to an invalid [checkinTooltip:check-in] payload provided. Learn more about the check-in payload in our [link:documentation].',
  61. {
  62. checkinTooltip,
  63. link: (
  64. <ExternalLink href="https://docs.sentry.io/product/crons/getting-started/http/" />
  65. ),
  66. }
  67. );
  68. case ProcessingErrorType.MONITOR_INVALID_ENVIRONMENT:
  69. return tct(
  70. 'A [checkinTooltip:check-in] was sent with an invalid environment due to: [reason].',
  71. {
  72. checkinTooltip,
  73. reason: error.reason,
  74. }
  75. );
  76. case ProcessingErrorType.MONITOR_LIMIT_EXCEEDED:
  77. return tct(
  78. 'The maximum monitor limit for this project has been reached. Please reach out to our [link:sales team] to create additional monitors.',
  79. {link: <ExternalLink href="https://sentry.io/contact/enterprise/" />}
  80. );
  81. case ProcessingErrorType.MONITOR_NOT_FOUND:
  82. return tct(
  83. 'A [checkinTooltip:check-in] was sent for a monitor that does not exist. If you meant to create a new monitor via upsert, please provide a valid monitor configuration in the check-in payload.',
  84. {checkinTooltip}
  85. );
  86. case ProcessingErrorType.MONITOR_OVER_QUOTA:
  87. return tct(
  88. 'A [checkinTooltip:check-in] was sent but dropped due to the monitor being over quota. Please increase your on-demand budget in your [link:subscription settings] to resume processing check-ins.',
  89. {
  90. checkinTooltip,
  91. link: <Link to="/settings/billing/overview/" />,
  92. }
  93. );
  94. case ProcessingErrorType.MONITOR_ENVIRONMENT_LIMIT_EXCEEDED:
  95. return tct(
  96. 'A [checkinTooltip:check-in] was sent but dropped because the monitor has already reached the limit of allowed environments. Remove an existing environment to create new ones.',
  97. {checkinTooltip}
  98. );
  99. case ProcessingErrorType.MONITOR_ENVIRONMENT_RATELIMITED:
  100. return tct(
  101. 'A sent [checkinTooltip:check-in] was dropped due to being rate limited. Reivew our rate limits for more information.',
  102. {checkinTooltip}
  103. );
  104. case ProcessingErrorType.ORGANIZATION_KILLSWITCH_ENABLED:
  105. return tct(
  106. 'We have detected a problem with your organization and disabled check-in ingestion. Contact [link:support] for details.',
  107. {link: <ExternalLink href="https://sentry.zendesk.com/hc/en-us/requests/new/" />}
  108. );
  109. default:
  110. return tct(
  111. 'Unknown problem occurred while processing this [checkinTooltip:check-in]',
  112. {checkinTooltip}
  113. );
  114. }
  115. }