platformCategories.tsx 12 KB

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