platformCategories.tsx 12 KB

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