platformCategories.tsx 12 KB

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