platformCategories.tsx 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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. 'javascript',
  336. 'javascript-angular',
  337. 'javascript-astro',
  338. 'javascript-backbone',
  339. 'javascript-capacitor',
  340. 'capacitor',
  341. 'javascript-electron',
  342. 'electron',
  343. 'javascript-ember',
  344. 'javascript-gatsby',
  345. 'javascript-nextjs',
  346. 'javascript-react',
  347. 'javascript-remix',
  348. 'javascript-svelte',
  349. 'javascript-sveltekit',
  350. 'javascript-vue',
  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',
  386. 'apple-macos',
  387. 'apple-ios',
  388. 'dart',
  389. 'dotnet',
  390. 'dotnet-awslambda',
  391. 'dotnet-gcpfunctions',
  392. 'dotnet-maui',
  393. 'dotnet-uwp',
  394. 'dotnet-wpf',
  395. 'dotnet-winforms',
  396. 'dotnet-xamarin',
  397. 'flutter',
  398. 'java',
  399. 'java-log4j2',
  400. 'java-logback',
  401. 'kotlin',
  402. 'node-koa',
  403. 'react-native',
  404. 'unity',
  405. 'unreal',
  406. ];
  407. // Feedback platforms that default to the web API
  408. export const feedbackWebApiPlatforms: readonly PlatformKey[] = [
  409. 'cordova',
  410. 'ruby-rack',
  411. 'ruby',
  412. 'rust',
  413. 'native',
  414. 'native-qt',
  415. 'node-awslambda',
  416. 'node-azurefunctions',
  417. 'node-connect',
  418. 'node-gcpfunctions',
  419. 'minidump',
  420. 'python-asgi',
  421. 'python-awslambda',
  422. 'python-celery',
  423. 'python-chalice',
  424. 'python-gcpfunctions',
  425. 'python-pymongo',
  426. 'python-pylons',
  427. 'python',
  428. 'python-rq',
  429. 'python-serverless',
  430. 'python-tryton',
  431. 'python-wsgi',
  432. ];
  433. // All feedback onboarding platforms
  434. export const feedbackOnboardingPlatforms: readonly PlatformKey[] = [
  435. ...feedbackWebApiPlatforms,
  436. ...feedbackWidgetPlatforms,
  437. ...feedbackCrashApiPlatforms,
  438. ];
  439. const customMetricBackendPlatforms: readonly PlatformKey[] = [
  440. 'bun',
  441. 'dart',
  442. 'deno',
  443. 'dotnet',
  444. 'dotnet-aspnet',
  445. 'dotnet-aspnetcore',
  446. 'dotnet-awslambda',
  447. 'dotnet-gcpfunctions',
  448. 'dotnet-maui',
  449. 'dotnet-uwp',
  450. 'dotnet-winforms',
  451. 'dotnet-wpf',
  452. 'java',
  453. 'java-appengine',
  454. 'java-log4j',
  455. 'java-log4j2',
  456. 'java-logback',
  457. 'java-logging',
  458. 'java-spring',
  459. 'java-spring-boot',
  460. 'php',
  461. 'php-laravel',
  462. // TODO: Enable once metrics are available for Symfony
  463. // 'php-symfony',
  464. 'python',
  465. 'python-aiohttp',
  466. 'python-asgi',
  467. 'python-awslambda',
  468. 'python-bottle',
  469. 'python-celery',
  470. 'python-chalice',
  471. 'python-django',
  472. 'python-falcon',
  473. 'python-fastapi',
  474. 'python-flask',
  475. 'python-gcpfunctions',
  476. 'python-pymongo',
  477. 'python-pylons',
  478. 'python-pyramid',
  479. 'python-quart',
  480. 'python-rq',
  481. 'python-sanic',
  482. 'python-serverless',
  483. 'python-starlette',
  484. 'python-tornado',
  485. 'python-tryton',
  486. 'python-wsgi',
  487. 'rust',
  488. 'node',
  489. 'node-awslambda',
  490. 'node-azurefunctions',
  491. 'node-connect',
  492. 'node-express',
  493. 'node-gcpfunctions',
  494. 'node-koa',
  495. 'ruby',
  496. 'ruby-rails',
  497. 'ruby-rack',
  498. ];
  499. const customMetricFrontendPlatforms: readonly PlatformKey[] = [
  500. 'android',
  501. 'apple-ios',
  502. 'electron',
  503. 'flutter',
  504. 'java-android',
  505. 'javascript-angular',
  506. 'javascript-astro',
  507. 'javascript-backbone',
  508. 'javascript-capacitor',
  509. 'javascript-electron',
  510. 'javascript-ember',
  511. 'javascript-gatsby',
  512. 'javascript-nextjs',
  513. 'javascript-react',
  514. 'javascript-remix',
  515. 'javascript-svelte',
  516. 'javascript-sveltekit',
  517. 'javascript-vue',
  518. 'javascript',
  519. 'react-native',
  520. 'unity',
  521. ];
  522. // These are all the platforms that can set up custom metrics.
  523. export const customMetricPlatforms: readonly PlatformKey[] = [
  524. ...customMetricFrontendPlatforms,
  525. ...customMetricBackendPlatforms,
  526. ];
  527. /**
  528. * The list of platforms for which we have created onboarding instructions.
  529. * Should be a subset of the list of `customMetricPlatforms`.
  530. */
  531. export const customMetricOnboardingPlatforms: readonly PlatformKey[] =
  532. customMetricPlatforms.filter(
  533. p =>
  534. // Legacy platforms that do not have in-product docs
  535. ![
  536. 'javascript-backbone',
  537. 'javascript-capacitor',
  538. 'javascript-electron',
  539. 'python-pylons',
  540. 'python-tryton',
  541. ].includes(p)
  542. );