platformCategories.tsx 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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. ]);
  186. // List of platforms that do not have performance support. We make use of this list in the product to not provide any Performance
  187. // views such as Performance onboarding checklist.
  188. export const withoutPerformanceSupport: Set<PlatformKey> = new Set([
  189. 'elixir',
  190. 'minidump',
  191. 'nintendo-switch',
  192. ]);
  193. export const profiling: PlatformKey[] = [
  194. // mobile
  195. 'android',
  196. 'apple-ios',
  197. // go
  198. 'go',
  199. // nodejs
  200. 'node',
  201. 'node-express',
  202. 'node-koa',
  203. 'node-connect',
  204. 'javascript-nextjs',
  205. 'javascript-remix',
  206. 'javascript-sveltekit',
  207. 'javascript',
  208. 'javascript-react',
  209. // react-native
  210. 'react-native',
  211. // python
  212. 'python',
  213. 'python-django',
  214. 'python-flask',
  215. 'python-fastapi',
  216. 'python-starlette',
  217. 'python-sanic',
  218. 'python-celery',
  219. 'python-bottle',
  220. 'python-pylons',
  221. 'python-pyramid',
  222. 'python-tornado',
  223. 'python-rq',
  224. 'python-aiohttp',
  225. 'python-chalice',
  226. 'python-falcon',
  227. 'python-quart',
  228. 'python-tryton',
  229. 'python-wsgi',
  230. 'python-serverless',
  231. // rust
  232. 'rust',
  233. // php
  234. 'php',
  235. 'php-laravel',
  236. 'php-symfony',
  237. // ruby
  238. 'ruby',
  239. 'ruby-rails',
  240. 'ruby-rack',
  241. ];
  242. export const releaseHealth: PlatformKey[] = [
  243. // frontend
  244. 'javascript',
  245. 'javascript-react',
  246. 'javascript-angular',
  247. 'javascript-angularjs',
  248. 'javascript-astro',
  249. 'javascript-backbone',
  250. 'javascript-ember',
  251. 'javascript-gatsby',
  252. 'javascript-vue',
  253. 'javascript-nextjs',
  254. 'javascript-remix',
  255. 'javascript-svelte',
  256. 'javascript-sveltekit',
  257. // mobile
  258. 'android',
  259. 'apple-ios',
  260. 'cordova',
  261. 'javascript-cordova',
  262. 'react-native',
  263. 'flutter',
  264. 'dart-flutter',
  265. // backend
  266. 'bun',
  267. 'deno',
  268. 'native',
  269. 'node',
  270. 'node-express',
  271. 'node-koa',
  272. 'node-connect',
  273. 'python',
  274. 'python-django',
  275. 'python-flask',
  276. 'python-fastapi',
  277. 'python-starlette',
  278. 'python-sanic',
  279. 'python-celery',
  280. 'python-bottle',
  281. 'python-pylons',
  282. 'python-pyramid',
  283. 'python-tornado',
  284. 'python-rq',
  285. 'python-pymongo',
  286. 'rust',
  287. // serverless
  288. // desktop
  289. 'apple-macos',
  290. 'native',
  291. 'native-crashpad',
  292. 'native-breakpad',
  293. 'native-qt',
  294. 'electron',
  295. 'javascript-electron',
  296. ];
  297. // 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.
  298. export const replayBackendPlatforms: readonly PlatformKey[] = [
  299. 'bun',
  300. 'deno',
  301. 'dotnet-aspnetcore',
  302. 'dotnet-aspnet',
  303. 'elixir',
  304. 'go-echo',
  305. 'go-fasthttp',
  306. 'go-fiber',
  307. 'go',
  308. 'go-gin',
  309. 'go-http',
  310. 'go-iris',
  311. 'go-martini',
  312. 'go-negroni',
  313. 'java-spring',
  314. 'java-spring-boot',
  315. 'node',
  316. 'node-express',
  317. 'php',
  318. 'php-laravel',
  319. 'php-symfony',
  320. 'python-aiohttp',
  321. 'python-bottle',
  322. 'python-django',
  323. 'python-falcon',
  324. 'python-fastapi',
  325. 'python-flask',
  326. 'python-pyramid',
  327. 'python-quart',
  328. 'python-sanic',
  329. 'python-starlette',
  330. 'python-tornado',
  331. 'ruby-rails',
  332. ];
  333. // These are the frontend platforms that can set up replay.
  334. export const replayFrontendPlatforms: readonly PlatformKey[] = [
  335. 'capacitor',
  336. 'electron',
  337. 'javascript-angular',
  338. 'javascript-astro',
  339. 'javascript-backbone',
  340. 'javascript-capacitor',
  341. 'javascript-electron',
  342. 'javascript-ember',
  343. 'javascript-gatsby',
  344. 'javascript-nextjs',
  345. 'javascript-react',
  346. 'javascript-remix',
  347. 'javascript-svelte',
  348. 'javascript-sveltekit',
  349. 'javascript-vue',
  350. 'javascript',
  351. ];
  352. // These are all the platforms that can set up replay.
  353. export const replayPlatforms: readonly PlatformKey[] = [
  354. ...replayFrontendPlatforms,
  355. ...replayBackendPlatforms,
  356. ];
  357. /**
  358. * The list of platforms for which we have created onboarding instructions.
  359. * Should be a subset of the list of `replayPlatforms`.
  360. * This should match sentry-docs: `/src/wizard/${platform}/replay-onboarding/${subPlatform}/`.
  361. * See: https://github.com/getsentry/sentry-docs/tree/master/src/wizard/javascript/replay-onboarding
  362. */
  363. export const replayOnboardingPlatforms: readonly PlatformKey[] = [
  364. ...replayFrontendPlatforms.filter(p => !['javascript-backbone'].includes(p)),
  365. ...replayBackendPlatforms,
  366. ];
  367. // These are the supported replay platforms that can also be set up using the JS loader.
  368. export const replayJsLoaderInstructionsPlatformList: readonly PlatformKey[] = [
  369. 'javascript',
  370. ...replayBackendPlatforms,
  371. ];
  372. // Feedback platforms that show only NPM widget setup instructions (no loader)
  373. export const feedbackNpmPlatforms: readonly PlatformKey[] = [
  374. 'ionic',
  375. ...replayFrontendPlatforms,
  376. ];
  377. // Feedback platforms that show widget instructions (both NPM & loader)
  378. export const feedbackWidgetPlatforms: readonly PlatformKey[] = [
  379. ...feedbackNpmPlatforms,
  380. ...replayBackendPlatforms,
  381. ];
  382. // Feedback platforms that only show crash API instructions
  383. export const feedbackCrashApiPlatforms: readonly PlatformKey[] = [
  384. 'android',
  385. 'apple-macos',
  386. 'apple-ios',
  387. 'dart',
  388. 'dotnet',
  389. 'dotnet-awslambda',
  390. 'dotnet-gcpfunctions',
  391. 'dotnet-maui',
  392. 'dotnet-uwp',
  393. 'dotnet-wpf',
  394. 'dotnet-winforms',
  395. 'dotnet-xamarin',
  396. 'flutter',
  397. 'java',
  398. 'java-log4j2',
  399. 'java-logback',
  400. 'kotlin',
  401. 'node-koa',
  402. 'react-native',
  403. 'unity',
  404. 'unreal',
  405. ];
  406. // Feedback platforms that default to the web API
  407. export const feedbackWebApiPlatforms: readonly PlatformKey[] = [
  408. 'cordova',
  409. 'ruby-rack',
  410. 'ruby',
  411. 'rust',
  412. 'native',
  413. 'native-qt',
  414. 'node-awslambda',
  415. 'node-azurefunctions',
  416. 'node-connect',
  417. 'node-gcpfunctions',
  418. 'minidump',
  419. 'python-asgi',
  420. 'python-awslambda',
  421. 'python-celery',
  422. 'python-chalice',
  423. 'python-gcpfunctions',
  424. 'python-pymongo',
  425. 'python-pylons',
  426. 'python',
  427. 'python-rq',
  428. 'python-serverless',
  429. 'python-tryton',
  430. 'python-wsgi',
  431. ];
  432. // All feedback onboarding platforms
  433. export const feedbackOnboardingPlatforms: readonly PlatformKey[] = [
  434. ...feedbackWebApiPlatforms,
  435. ...feedbackWidgetPlatforms,
  436. ...feedbackCrashApiPlatforms,
  437. ];
  438. const customMetricBackendPlatforms: readonly PlatformKey[] = [
  439. 'bun',
  440. 'dart',
  441. 'deno',
  442. 'dotnet',
  443. 'dotnet-aspnetcore',
  444. 'dotnet-awslambda',
  445. 'dotnet-gcpfunctions',
  446. 'dotnet-maui',
  447. 'dotnet-uwp',
  448. 'dotnet-winforms',
  449. 'dotnet-wpf',
  450. 'java',
  451. 'java-appengine',
  452. 'java-log4j',
  453. 'java-log4j2',
  454. 'java-logback',
  455. 'java-logging',
  456. 'java-spring',
  457. 'java-spring-boot',
  458. 'php',
  459. 'php-laravel',
  460. // TODO: Enable once metrics are available for Symfony
  461. // 'php-symfony',
  462. 'python',
  463. 'python-aiohttp',
  464. 'python-asgi',
  465. 'python-awslambda',
  466. 'python-bottle',
  467. 'python-celery',
  468. 'python-chalice',
  469. 'python-django',
  470. 'python-falcon',
  471. 'python-fastapi',
  472. 'python-flask',
  473. 'python-gcpfunctions',
  474. 'python-pymongo',
  475. 'python-pylons',
  476. 'python-pyramid',
  477. 'python-quart',
  478. 'python-rq',
  479. 'python-sanic',
  480. 'python-serverless',
  481. 'python-starlette',
  482. 'python-tornado',
  483. 'python-tryton',
  484. 'python-wsgi',
  485. 'rust',
  486. 'node',
  487. 'node-awslambda',
  488. 'node-azurefunctions',
  489. 'node-connect',
  490. 'node-express',
  491. 'node-gcpfunctions',
  492. 'node-koa',
  493. 'ruby',
  494. 'ruby-rails',
  495. 'ruby-rack',
  496. ];
  497. const customMetricFrontendPlatforms: readonly PlatformKey[] = [
  498. 'android',
  499. 'apple-ios',
  500. 'electron',
  501. 'flutter',
  502. 'java-android',
  503. 'javascript-angular',
  504. 'javascript-astro',
  505. 'javascript-backbone',
  506. 'javascript-capacitor',
  507. 'javascript-electron',
  508. 'javascript-ember',
  509. 'javascript-gatsby',
  510. 'javascript-nextjs',
  511. 'javascript-react',
  512. 'javascript-remix',
  513. 'javascript-svelte',
  514. 'javascript-sveltekit',
  515. 'javascript-vue',
  516. 'javascript',
  517. 'react-native',
  518. 'unity',
  519. ];
  520. // These are all the platforms that can set up custom metrics.
  521. export const customMetricPlatforms: readonly PlatformKey[] = [
  522. ...customMetricFrontendPlatforms,
  523. ...customMetricBackendPlatforms,
  524. ];
  525. /**
  526. * The list of platforms for which we have created onboarding instructions.
  527. * Should be a subset of the list of `customMetricPlatforms`.
  528. */
  529. export const customMetricOnboardingPlatforms: readonly PlatformKey[] =
  530. customMetricPlatforms.filter(
  531. p =>
  532. // Legacy platforms that do not have in-product docs
  533. ![
  534. 'javascript-backbone',
  535. 'javascript-capacitor',
  536. 'javascript-electron',
  537. 'python-pylons',
  538. 'python-tryton',
  539. ].includes(p)
  540. );