platformCategories.tsx 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. import type {PlatformKey} from 'sentry/types/project';
  2. export enum PlatformCategory {
  3. FRONTEND = 0,
  4. MOBILE = 1,
  5. BACKEND = 2,
  6. SERVERLESS = 3,
  7. DESKTOP = 4,
  8. OTHER = 5,
  9. }
  10. // Mirrors `FRONTEND` in src/sentry/utils/platform_categories.py
  11. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  12. export const frontend: PlatformKey[] = [
  13. 'dart',
  14. 'javascript',
  15. 'javascript-angular',
  16. 'javascript-angularjs',
  17. 'javascript-astro',
  18. 'javascript-backbone',
  19. 'javascript-ember',
  20. 'javascript-gatsby',
  21. 'javascript-nextjs',
  22. 'javascript-react',
  23. 'javascript-remix',
  24. 'javascript-svelte',
  25. 'javascript-sveltekit',
  26. 'javascript-vue',
  27. 'unity',
  28. ];
  29. // Mirrors `MOBILE` in src/sentry/utils/platform_categories.py
  30. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  31. export const mobile: PlatformKey[] = [
  32. 'android',
  33. 'apple-ios',
  34. 'capacitor',
  35. 'cordova',
  36. 'dart-flutter',
  37. 'dotnet-maui',
  38. 'dotnet-xamarin',
  39. 'flutter',
  40. 'ionic',
  41. 'javascript-capacitor',
  42. 'javascript-cordova',
  43. 'react-native',
  44. 'unity',
  45. 'unreal',
  46. // Old platforms
  47. 'java-android',
  48. 'cocoa-objc',
  49. 'cocoa-swift',
  50. ];
  51. // Mirrors `BACKEND` in src/sentry/utils/platform_categories.py
  52. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  53. export const backend: PlatformKey[] = [
  54. 'bun',
  55. 'dotnet',
  56. 'dotnet-aspnetcore',
  57. 'dotnet-aspnet',
  58. 'elixir',
  59. 'go',
  60. 'go-echo',
  61. 'go-fasthttp',
  62. 'go-gin',
  63. 'go-http',
  64. 'go-iris',
  65. 'go-martini',
  66. 'go-negroni',
  67. 'java',
  68. 'java-appengine',
  69. 'java-log4j',
  70. 'java-log4j2',
  71. 'java-logback',
  72. 'java-logging',
  73. 'java-spring',
  74. 'java-spring-boot',
  75. 'kotlin',
  76. 'native',
  77. 'node',
  78. 'node-express',
  79. 'node-koa',
  80. 'node-connect',
  81. 'perl',
  82. 'php',
  83. 'php-laravel',
  84. 'php-monolog',
  85. 'php-symfony',
  86. 'python',
  87. 'python-aiohttp',
  88. 'python-asgi',
  89. 'python-bottle',
  90. 'python-celery',
  91. 'python-chalice',
  92. 'python-django',
  93. 'python-falcon',
  94. 'python-fastapi',
  95. 'python-flask',
  96. 'python-pylons',
  97. 'python-pymongo',
  98. 'python-pyramid',
  99. 'python-quart',
  100. 'python-rq',
  101. 'python-sanic',
  102. 'python-starlette',
  103. 'python-tornado',
  104. 'python-tryton',
  105. 'python-wsgi',
  106. 'ruby',
  107. 'ruby-rails',
  108. 'ruby-rack',
  109. 'rust',
  110. ];
  111. // Mirrors `SERVERLESS` in src/sentry/utils/platform_categories.py
  112. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  113. export const serverless: PlatformKey[] = [
  114. 'dotnet-awslambda',
  115. 'dotnet-gcpfunctions',
  116. 'node-awslambda',
  117. 'node-azurefunctions',
  118. 'node-gcpfunctions',
  119. 'python-awslambda',
  120. 'python-azurefunctions',
  121. 'python-gcpfunctions',
  122. 'python-serverless',
  123. ];
  124. // Mirrors `DESKTOP` in src/sentry/utils/platform_categories.py
  125. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  126. export const desktop: PlatformKey[] = [
  127. 'apple-macos',
  128. 'dotnet-maui',
  129. 'dotnet-winforms',
  130. 'dotnet-wpf',
  131. 'dotnet',
  132. 'electron',
  133. 'flutter',
  134. 'java',
  135. 'javascript-electron',
  136. 'kotlin',
  137. 'minidump',
  138. 'native',
  139. 'native-breakpad',
  140. 'native-crashpad',
  141. 'native-minidump',
  142. 'native-qt',
  143. 'unity',
  144. 'unreal',
  145. ];
  146. export const sourceMaps: PlatformKey[] = [
  147. ...frontend,
  148. 'react-native',
  149. 'cordova',
  150. 'electron',
  151. ];
  152. export const performance: PlatformKey[] = [
  153. 'bun',
  154. 'javascript',
  155. 'javascript-ember',
  156. 'javascript-react',
  157. 'javascript-vue',
  158. 'php',
  159. 'php-laravel',
  160. 'python',
  161. 'python-django',
  162. 'python-flask',
  163. 'python-fastapi',
  164. 'python-starlette',
  165. 'python-sanic',
  166. 'python-celery',
  167. 'python-bottle',
  168. 'python-pylons',
  169. 'python-pyramid',
  170. 'python-tornado',
  171. 'python-rq',
  172. 'node',
  173. 'node-express',
  174. 'node-koa',
  175. 'node-connect',
  176. ];
  177. // List of platforms that have performance onboarding checklist content
  178. export const withPerformanceOnboarding: Set<PlatformKey> = new Set([
  179. 'javascript',
  180. 'javascript-react',
  181. ]);
  182. // List of platforms that do not have performance support. We make use of this list in the product to not provide any Performance
  183. // views such as Performance onboarding checklist.
  184. export const withoutPerformanceSupport: Set<PlatformKey> = new Set([
  185. 'elixir',
  186. 'minidump',
  187. 'nintendo-switch',
  188. ]);
  189. export const profiling: PlatformKey[] = [
  190. // mobile
  191. 'android',
  192. 'apple-ios',
  193. // go
  194. 'go',
  195. // nodejs
  196. 'node',
  197. 'node-express',
  198. 'node-koa',
  199. 'node-connect',
  200. 'javascript-nextjs',
  201. 'javascript-remix',
  202. 'javascript-sveltekit',
  203. 'javascript',
  204. 'javascript-react',
  205. // react-native
  206. 'react-native',
  207. // python
  208. 'python',
  209. 'python-django',
  210. 'python-flask',
  211. 'python-fastapi',
  212. 'python-starlette',
  213. 'python-sanic',
  214. 'python-celery',
  215. 'python-bottle',
  216. 'python-pylons',
  217. 'python-pyramid',
  218. 'python-tornado',
  219. 'python-rq',
  220. 'python-aiohttp',
  221. 'python-chalice',
  222. 'python-falcon',
  223. 'python-quart',
  224. 'python-tryton',
  225. 'python-wsgi',
  226. 'python-serverless',
  227. // rust
  228. 'rust',
  229. // php
  230. 'php',
  231. 'php-laravel',
  232. 'php-symfony',
  233. // ruby
  234. 'ruby',
  235. 'ruby-rails',
  236. 'ruby-rack',
  237. ];
  238. export const releaseHealth: PlatformKey[] = [
  239. // frontend
  240. 'javascript',
  241. 'javascript-react',
  242. 'javascript-angular',
  243. 'javascript-angularjs',
  244. 'javascript-astro',
  245. 'javascript-backbone',
  246. 'javascript-ember',
  247. 'javascript-gatsby',
  248. 'javascript-vue',
  249. 'javascript-nextjs',
  250. 'javascript-remix',
  251. 'javascript-svelte',
  252. 'javascript-sveltekit',
  253. // mobile
  254. 'android',
  255. 'apple-ios',
  256. 'cordova',
  257. 'javascript-cordova',
  258. 'react-native',
  259. 'flutter',
  260. 'dart-flutter',
  261. // backend
  262. 'bun',
  263. 'native',
  264. 'node',
  265. 'node-express',
  266. 'node-koa',
  267. 'node-connect',
  268. 'python',
  269. 'python-django',
  270. 'python-flask',
  271. 'python-fastapi',
  272. 'python-starlette',
  273. 'python-sanic',
  274. 'python-celery',
  275. 'python-bottle',
  276. 'python-pylons',
  277. 'python-pyramid',
  278. 'python-tornado',
  279. 'python-rq',
  280. 'python-pymongo',
  281. 'rust',
  282. // serverless
  283. // desktop
  284. 'apple-macos',
  285. 'native',
  286. 'native-crashpad',
  287. 'native-breakpad',
  288. 'native-qt',
  289. 'electron',
  290. 'javascript-electron',
  291. ];
  292. // These are the backend platforms that can set up replay -- e.g. they can be set up via a linked JS framework or via JS loader.
  293. export const replayBackendPlatforms: readonly PlatformKey[] = [
  294. 'bun',
  295. 'dotnet-aspnetcore',
  296. 'dotnet-aspnet',
  297. 'elixir',
  298. 'go-echo',
  299. 'go-fasthttp',
  300. 'go',
  301. 'go-gin',
  302. 'go-http',
  303. 'go-iris',
  304. 'go-martini',
  305. 'go-negroni',
  306. 'java-spring',
  307. 'java-spring-boot',
  308. 'node',
  309. 'node-express',
  310. 'php',
  311. 'php-laravel',
  312. 'php-symfony',
  313. 'python-aiohttp',
  314. 'python-bottle',
  315. 'python-django',
  316. 'python-falcon',
  317. 'python-fastapi',
  318. 'python-flask',
  319. 'python-pyramid',
  320. 'python-quart',
  321. 'python-sanic',
  322. 'python-starlette',
  323. 'python-tornado',
  324. 'ruby-rails',
  325. ];
  326. // These are the frontend platforms that can set up replay.
  327. export const replayFrontendPlatforms: readonly PlatformKey[] = [
  328. 'capacitor',
  329. 'electron',
  330. 'javascript-angular',
  331. 'javascript-astro',
  332. 'javascript-backbone',
  333. 'javascript-capacitor',
  334. 'javascript-electron',
  335. 'javascript-ember',
  336. 'javascript-gatsby',
  337. 'javascript-nextjs',
  338. 'javascript-react',
  339. 'javascript-remix',
  340. 'javascript-svelte',
  341. 'javascript-sveltekit',
  342. 'javascript-vue',
  343. 'javascript',
  344. ];
  345. // These are all the platforms that can set up replay.
  346. export const replayPlatforms: readonly PlatformKey[] = [
  347. ...replayFrontendPlatforms,
  348. ...replayBackendPlatforms,
  349. ];
  350. /**
  351. * The list of platforms for which we have created onboarding instructions.
  352. * Should be a subset of the list of `replayPlatforms`.
  353. * This should match sentry-docs: `/src/wizard/${platform}/replay-onboarding/${subPlatform}/`.
  354. * See: https://github.com/getsentry/sentry-docs/tree/master/src/wizard/javascript/replay-onboarding
  355. */
  356. export const replayOnboardingPlatforms: readonly PlatformKey[] = [
  357. ...replayFrontendPlatforms.filter(p => !['javascript-backbone'].includes(p)),
  358. ...replayBackendPlatforms,
  359. ];
  360. // These are the supported replay platforms that can also be set up using the JS loader.
  361. export const replayJsLoaderInstructionsPlatformList: readonly PlatformKey[] = [
  362. 'javascript',
  363. ...replayBackendPlatforms,
  364. ];
  365. // Feedback platforms that show only NPM widget setup instructions (no loader)
  366. export const feedbackNpmPlatforms: readonly PlatformKey[] = [
  367. 'ionic',
  368. ...replayFrontendPlatforms,
  369. ];
  370. // Feedback platforms that show widget instructions (both NPM & loader)
  371. export const feedbackWidgetPlatforms: readonly PlatformKey[] = [
  372. ...feedbackNpmPlatforms,
  373. ...replayBackendPlatforms,
  374. ];
  375. // Feedback platforms that only show crash API instructions
  376. export const feedbackCrashApiPlatforms: readonly PlatformKey[] = [
  377. 'android',
  378. 'apple-macos',
  379. 'apple-ios',
  380. 'dart',
  381. 'dotnet',
  382. 'dotnet-awslambda',
  383. 'dotnet-gcpfunctions',
  384. 'dotnet-maui',
  385. 'dotnet-uwp',
  386. 'dotnet-wpf',
  387. 'dotnet-winforms',
  388. 'dotnet-xamarin',
  389. 'flutter',
  390. 'java',
  391. 'java-log4j2',
  392. 'java-logback',
  393. 'kotlin',
  394. 'node-koa',
  395. 'react-native',
  396. 'unity',
  397. 'unreal',
  398. ];
  399. // Feedback platforms that default to the web API
  400. export const feedbackWebApiPlatforms: readonly PlatformKey[] = [
  401. 'cordova',
  402. 'ruby-rack',
  403. 'ruby',
  404. 'rust',
  405. 'native',
  406. 'native-qt',
  407. 'node-awslambda',
  408. 'node-azurefunctions',
  409. 'node-connect',
  410. 'node-gcpfunctions',
  411. 'node-serverlesscloud',
  412. 'minidump',
  413. 'python-asgi',
  414. 'python-awslambda',
  415. 'python-celery',
  416. 'python-chalice',
  417. 'python-gcpfunctions',
  418. 'python-pymongo',
  419. 'python-pylons',
  420. 'python',
  421. 'python-rq',
  422. 'python-serverless',
  423. 'python-tryton',
  424. 'python-wsgi',
  425. ];
  426. // All feedback onboarding platforms
  427. export const feedbackOnboardingPlatforms: readonly PlatformKey[] = [
  428. ...feedbackWebApiPlatforms,
  429. ...feedbackWidgetPlatforms,
  430. ...feedbackCrashApiPlatforms,
  431. ];
  432. const customMetricBackendPlatforms: readonly PlatformKey[] = [
  433. 'bun',
  434. 'dart',
  435. 'dotnet',
  436. 'dotnet-aspnetcore',
  437. 'dotnet-awslambda',
  438. 'dotnet-gcpfunctions',
  439. 'dotnet-maui',
  440. 'dotnet-uwp',
  441. 'dotnet-winforms',
  442. 'dotnet-wpf',
  443. 'java',
  444. 'java-appengine',
  445. 'java-log4j',
  446. 'java-log4j2',
  447. 'java-logback',
  448. 'java-logging',
  449. 'java-spring',
  450. 'java-spring-boot',
  451. 'php',
  452. 'php-laravel',
  453. // TODO: Enable once metrics are available for Symfony
  454. // 'php-symfony',
  455. 'python',
  456. 'python-aiohttp',
  457. 'python-asgi',
  458. 'python-awslambda',
  459. 'python-bottle',
  460. 'python-celery',
  461. 'python-chalice',
  462. 'python-django',
  463. 'python-falcon',
  464. 'python-fastapi',
  465. 'python-flask',
  466. 'python-gcpfunctions',
  467. 'python-pymongo',
  468. 'python-pylons',
  469. 'python-pyramid',
  470. 'python-quart',
  471. 'python-rq',
  472. 'python-sanic',
  473. 'python-serverless',
  474. 'python-starlette',
  475. 'python-tornado',
  476. 'python-tryton',
  477. 'python-wsgi',
  478. 'rust',
  479. 'node',
  480. 'node-awslambda',
  481. 'node-azurefunctions',
  482. 'node-connect',
  483. 'node-express',
  484. 'node-gcpfunctions',
  485. 'node-koa',
  486. 'ruby',
  487. 'ruby-rails',
  488. 'ruby-rack',
  489. ];
  490. const customMetricFrontendPlatforms: readonly PlatformKey[] = [
  491. 'android',
  492. 'apple-ios',
  493. 'electron',
  494. 'flutter',
  495. 'java-android',
  496. 'javascript-angular',
  497. 'javascript-astro',
  498. 'javascript-backbone',
  499. 'javascript-capacitor',
  500. 'javascript-electron',
  501. 'javascript-ember',
  502. 'javascript-gatsby',
  503. 'javascript-nextjs',
  504. 'javascript-react',
  505. 'javascript-remix',
  506. 'javascript-svelte',
  507. 'javascript-sveltekit',
  508. 'javascript-vue',
  509. 'javascript',
  510. 'react-native',
  511. 'unity',
  512. ];
  513. // These are all the platforms that can set up custom metrics.
  514. export const customMetricPlatforms: readonly PlatformKey[] = [
  515. ...customMetricFrontendPlatforms,
  516. ...customMetricBackendPlatforms,
  517. ];
  518. /**
  519. * The list of platforms for which we have created onboarding instructions.
  520. * Should be a subset of the list of `customMetricPlatforms`.
  521. */
  522. export const customMetricOnboardingPlatforms: readonly PlatformKey[] =
  523. customMetricPlatforms.filter(
  524. p =>
  525. // Legacy platforms that do not have in-product docs
  526. ![
  527. 'javascript-backbone',
  528. 'javascript-capacitor',
  529. 'javascript-electron',
  530. 'python-pylons',
  531. 'python-tryton',
  532. ].includes(p)
  533. );