platformCategories.tsx 13 KB

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