settings.ts 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. import {t} from 'sentry/locale';
  2. import {
  3. DATA_TYPE as RESOURCE_DATA_TYPE,
  4. DATA_TYPE_PLURAL as RESOURCE_DATA_TYPE_PLURAL,
  5. MODULE_DOC_LINK as RESOURCES_MODULE_DOC_LINK,
  6. MODULE_FEATURES as RESOURCE_MODULE_FEATURES,
  7. MODULE_TITLE as RESOURCES_MODULE_TITLE,
  8. } from 'sentry/views/insights/browser/resources/settings';
  9. import {
  10. DATA_TYPE as WEB_VITALS_DATA_TYPE,
  11. DATA_TYPE_PLURAL as WEB_VITALS_DATA_TYPE_PLURAL,
  12. MODULE_DOC_LINK as VITALS_MODULE_DOC_LINK,
  13. MODULE_FEATURES as VITALS_MODULE_FEATURES,
  14. MODULE_TITLE as VITALS_MODULE_TITLE,
  15. } from 'sentry/views/insights/browser/webVitals/settings';
  16. import {
  17. DATA_TYPE as CACHE_DATA_TYPE,
  18. DATA_TYPE_PLURAL as CACHE_DATA_TYPE_PLURAL,
  19. MODULE_DOC_LINK as CACHE_MODULE_DOC_LINK,
  20. MODULE_FEATURES as CACHE_MODULE_FEATURES,
  21. MODULE_TITLE as CACHE_MODULE_TITLE,
  22. } from 'sentry/views/insights/cache/settings';
  23. import {
  24. DATA_TYPE as DB_DATA_TYPE,
  25. DATA_TYPE_PLURAL as DB_DATA_TYPE_PLURAL,
  26. MODULE_DOC_LINK as DB_MODULE_DOC_LINK,
  27. MODULE_FEATURES as DB_MODULE_FEATURES,
  28. MODULE_TITLE as DB_MODULE_TITLE,
  29. } from 'sentry/views/insights/database/settings';
  30. import {
  31. DATA_TYPE as HTTP_DATA_TYPE,
  32. DATA_TYPE_PLURAL as HTTP_DATA_TYPE_PLURAL,
  33. MODULE_DOC_LINK as HTTP_MODULE_DOC_LINK,
  34. MODULE_FEATURES as HTTP_MODULE_FEATURES,
  35. MODULE_TITLE as HTTP_MODULE_TITLE,
  36. } from 'sentry/views/insights/http/settings';
  37. import {
  38. DATA_TYPE as AI_DATA_TYPE,
  39. DATA_TYPE_PLURAL as AI_DATA_TYPE_PLURAL,
  40. MODULE_DOC_LINK as AI_MODULE_DOC_LINK,
  41. MODULE_FEATURES as AI_MODULE_FEATURES,
  42. MODULE_TITLE as AI_MODULE_TITLE,
  43. } from 'sentry/views/insights/llmMonitoring/settings';
  44. import {
  45. DATA_TYPE as APP_STARTS_DATA_TYPE,
  46. DATA_TYPE_PLURAL as APP_STARTS_DATA_TYPE_PLURAL,
  47. MODULE_DOC_LINK as APP_STARTS_MODULE_DOC_LINK,
  48. MODULE_FEATURES as APP_STARTS_MODULE_FEATURES,
  49. MODULE_TITLE as APP_STARTS_MODULE_TITLE,
  50. } from 'sentry/views/insights/mobile/appStarts/settings';
  51. import {
  52. DATA_TYPE as SCREEN_LOAD_DATA_TYPE,
  53. DATA_TYPE_PLURAL as SCREEN_LOAD_DATA_TYPE_PLURAL,
  54. MODULE_DOC_LINK as SCREEN_LOADS_MODULE_DOC_LINK,
  55. MODULE_FEATURES as SCREEN_LOADS_MODULE_FEATURES,
  56. MODULE_TITLE as SCREEN_LOADS_MODULE_TITLE,
  57. } from 'sentry/views/insights/mobile/screenload/settings';
  58. import {
  59. DATA_TYPE as SCREEN_RENDERING_DATA_TYPE,
  60. DATA_TYPE_PLURAL as SCREEN_RENDERING_DATA_TYPE_PLURAL,
  61. MODULE_DOC_LINK as SCREEN_RENDERING_MODULE_DOC_LINK,
  62. MODULE_FEATURES as SCREEN_RENDERING_MODULE_FEATURES,
  63. MODULE_TITLE as SCREEN_RENDERING_MODULE_TITLE,
  64. } from 'sentry/views/insights/mobile/screenRendering/settings';
  65. import {
  66. DATA_TYPE as MOBILE_SCREENS_DATA_TYPE,
  67. DATA_TYPE_PLURAL as MOBILE_SCREENS_DATA_TYPE_PLURAL,
  68. MODULE_DOC_LINK as MODULE_SCREENS_DOC_LINK,
  69. MODULE_FEATURE as MOBILE_SCREENS_MODULE_FEATURE,
  70. MODULE_TITLE as MOBILE_SCREENS_MODULE_TITLE,
  71. } from 'sentry/views/insights/mobile/screens/settings';
  72. import {
  73. MODULE_DOC_LINK as MODULE_UI_DOC_LINK,
  74. MODULE_FEATURES as MOBILE_UI_MODULE_FEATURES,
  75. MODULE_TITLE as MOBILE_UI_MODULE_TITLE,
  76. } from 'sentry/views/insights/mobile/ui/settings';
  77. import {
  78. DATA_TYPE as QUEUE_DATA_TYPE,
  79. DATA_TYPE_PLURAL as QUEUE_DATA_TYPE_PLURAL,
  80. MODULE_DOC_LINK as QUEUE_MODULE_DOC_LINK,
  81. MODULE_FEATURES as QUEUE_MODULE_FEATURES,
  82. MODULE_TITLE as QUEUE_MODULE_TITLE,
  83. } from 'sentry/views/insights/queues/settings';
  84. import {ModuleName} from 'sentry/views/insights/types';
  85. export const INSIGHTS_TITLE = t('Insights');
  86. export const INSIGHTS_BASE_URL = 'insights';
  87. export const DEFAULT_INTERVAL = '10m';
  88. export const QUERY_DATE_RANGE_LIMIT = 7; // Maximum number of days that can be queried for, enabled by the `insights-query-date-range-limit` feature flag
  89. export const MODULE_TITLES: Record<ModuleName, string> = {
  90. [ModuleName.DB]: DB_MODULE_TITLE,
  91. [ModuleName.HTTP]: HTTP_MODULE_TITLE,
  92. [ModuleName.CACHE]: CACHE_MODULE_TITLE,
  93. [ModuleName.QUEUE]: QUEUE_MODULE_TITLE,
  94. [ModuleName.SCREEN_LOAD]: SCREEN_LOADS_MODULE_TITLE,
  95. [ModuleName.APP_START]: APP_STARTS_MODULE_TITLE,
  96. [ModuleName.VITAL]: VITALS_MODULE_TITLE,
  97. [ModuleName.RESOURCE]: RESOURCES_MODULE_TITLE,
  98. [ModuleName.AI]: AI_MODULE_TITLE,
  99. [ModuleName.MOBILE_UI]: MOBILE_UI_MODULE_TITLE,
  100. [ModuleName.MOBILE_SCREENS]: MOBILE_SCREENS_MODULE_TITLE,
  101. [ModuleName.SCREEN_RENDERING]: SCREEN_RENDERING_MODULE_TITLE,
  102. [ModuleName.OTHER]: '',
  103. };
  104. export const MODULE_DATA_TYPES: Record<ModuleName, string> = {
  105. [ModuleName.DB]: DB_DATA_TYPE,
  106. [ModuleName.HTTP]: HTTP_DATA_TYPE,
  107. [ModuleName.CACHE]: CACHE_DATA_TYPE,
  108. [ModuleName.QUEUE]: QUEUE_DATA_TYPE,
  109. [ModuleName.SCREEN_LOAD]: SCREEN_LOAD_DATA_TYPE,
  110. [ModuleName.APP_START]: APP_STARTS_DATA_TYPE,
  111. [ModuleName.VITAL]: WEB_VITALS_DATA_TYPE,
  112. [ModuleName.RESOURCE]: RESOURCE_DATA_TYPE,
  113. [ModuleName.AI]: AI_DATA_TYPE,
  114. [ModuleName.MOBILE_UI]: t('Mobile UI'),
  115. [ModuleName.MOBILE_SCREENS]: MOBILE_SCREENS_DATA_TYPE,
  116. [ModuleName.SCREEN_RENDERING]: SCREEN_RENDERING_DATA_TYPE,
  117. [ModuleName.OTHER]: '',
  118. };
  119. export const MODULE_DATA_TYPES_PLURAL: Record<ModuleName, string> = {
  120. [ModuleName.DB]: DB_DATA_TYPE_PLURAL,
  121. [ModuleName.HTTP]: HTTP_DATA_TYPE_PLURAL,
  122. [ModuleName.CACHE]: CACHE_DATA_TYPE_PLURAL,
  123. [ModuleName.QUEUE]: QUEUE_DATA_TYPE_PLURAL,
  124. [ModuleName.SCREEN_LOAD]: SCREEN_LOAD_DATA_TYPE_PLURAL,
  125. [ModuleName.APP_START]: APP_STARTS_DATA_TYPE_PLURAL,
  126. [ModuleName.VITAL]: WEB_VITALS_DATA_TYPE_PLURAL,
  127. [ModuleName.RESOURCE]: RESOURCE_DATA_TYPE_PLURAL,
  128. [ModuleName.AI]: AI_DATA_TYPE_PLURAL,
  129. [ModuleName.MOBILE_UI]: t('Mobile UI'),
  130. [ModuleName.MOBILE_SCREENS]: MOBILE_SCREENS_DATA_TYPE_PLURAL,
  131. [ModuleName.SCREEN_RENDERING]: SCREEN_RENDERING_DATA_TYPE_PLURAL,
  132. [ModuleName.OTHER]: '',
  133. };
  134. export const MODULE_PRODUCT_DOC_LINKS: Record<ModuleName, string> = {
  135. [ModuleName.DB]: DB_MODULE_DOC_LINK,
  136. [ModuleName.HTTP]: HTTP_MODULE_DOC_LINK,
  137. [ModuleName.CACHE]: CACHE_MODULE_DOC_LINK,
  138. [ModuleName.QUEUE]: QUEUE_MODULE_DOC_LINK,
  139. [ModuleName.SCREEN_LOAD]: SCREEN_LOADS_MODULE_DOC_LINK,
  140. [ModuleName.APP_START]: APP_STARTS_MODULE_DOC_LINK,
  141. [ModuleName.VITAL]: VITALS_MODULE_DOC_LINK,
  142. [ModuleName.RESOURCE]: RESOURCES_MODULE_DOC_LINK,
  143. [ModuleName.AI]: AI_MODULE_DOC_LINK,
  144. [ModuleName.MOBILE_UI]: MODULE_UI_DOC_LINK,
  145. [ModuleName.MOBILE_SCREENS]: MODULE_SCREENS_DOC_LINK,
  146. [ModuleName.SCREEN_RENDERING]: SCREEN_RENDERING_MODULE_DOC_LINK,
  147. [ModuleName.OTHER]: '',
  148. };
  149. export const MODULE_FEATURE_MAP: Record<ModuleName, string[]> = {
  150. [ModuleName.DB]: DB_MODULE_FEATURES,
  151. [ModuleName.APP_START]: APP_STARTS_MODULE_FEATURES,
  152. [ModuleName.HTTP]: HTTP_MODULE_FEATURES,
  153. [ModuleName.RESOURCE]: RESOURCE_MODULE_FEATURES,
  154. [ModuleName.VITAL]: VITALS_MODULE_FEATURES,
  155. [ModuleName.CACHE]: CACHE_MODULE_FEATURES,
  156. [ModuleName.QUEUE]: QUEUE_MODULE_FEATURES,
  157. [ModuleName.AI]: AI_MODULE_FEATURES,
  158. [ModuleName.SCREEN_LOAD]: SCREEN_LOADS_MODULE_FEATURES,
  159. [ModuleName.MOBILE_UI]: MOBILE_UI_MODULE_FEATURES,
  160. [ModuleName.MOBILE_SCREENS]: [MOBILE_SCREENS_MODULE_FEATURE],
  161. [ModuleName.SCREEN_RENDERING]: SCREEN_RENDERING_MODULE_FEATURES,
  162. [ModuleName.OTHER]: [],
  163. };