platformCategories.tsx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  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-nuxt',
  23. 'javascript-react',
  24. 'javascript-remix',
  25. 'javascript-solid',
  26. 'javascript-solidstart',
  27. 'javascript-svelte',
  28. 'javascript-sveltekit',
  29. 'javascript-vue',
  30. 'unity',
  31. ];
  32. // Mirrors `MOBILE` in src/sentry/utils/platform_categories.py
  33. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  34. export const mobile: PlatformKey[] = [
  35. 'android',
  36. 'apple-ios',
  37. 'capacitor',
  38. 'cordova',
  39. 'dart-flutter',
  40. 'dotnet-maui',
  41. 'dotnet-xamarin',
  42. 'flutter',
  43. 'ionic',
  44. 'javascript-capacitor',
  45. 'javascript-cordova',
  46. 'react-native',
  47. 'unity',
  48. 'unreal',
  49. // Old platforms
  50. 'java-android',
  51. 'cocoa-objc',
  52. 'cocoa-swift',
  53. ];
  54. // Mirrors `BACKEND` in src/sentry/utils/platform_categories.py
  55. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  56. export const backend: PlatformKey[] = [
  57. 'bun',
  58. 'deno',
  59. 'dotnet',
  60. 'dotnet-aspnetcore',
  61. 'dotnet-aspnet',
  62. 'elixir',
  63. 'go',
  64. 'go-echo',
  65. 'go-fasthttp',
  66. 'go-fiber',
  67. 'go-gin',
  68. 'go-http',
  69. 'go-iris',
  70. 'go-martini',
  71. 'go-negroni',
  72. 'java',
  73. 'java-appengine',
  74. 'java-log4j',
  75. 'java-log4j2',
  76. 'java-logback',
  77. 'java-logging',
  78. 'java-spring',
  79. 'java-spring-boot',
  80. 'kotlin',
  81. 'native',
  82. 'node',
  83. 'node-express',
  84. 'node-koa',
  85. 'node-connect',
  86. 'perl',
  87. 'php',
  88. 'php-laravel',
  89. 'php-monolog',
  90. 'php-symfony',
  91. 'powershell',
  92. 'python',
  93. 'python-aiohttp',
  94. 'python-asgi',
  95. 'python-bottle',
  96. 'python-celery',
  97. 'python-chalice',
  98. 'python-django',
  99. 'python-falcon',
  100. 'python-fastapi',
  101. 'python-flask',
  102. 'python-pylons',
  103. 'python-pymongo',
  104. 'python-pyramid',
  105. 'python-quart',
  106. 'python-rq',
  107. 'python-sanic',
  108. 'python-starlette',
  109. 'python-tornado',
  110. 'python-tryton',
  111. 'python-wsgi',
  112. 'ruby',
  113. 'ruby-rails',
  114. 'ruby-rack',
  115. 'rust',
  116. ];
  117. // Mirrors `SERVERLESS` in src/sentry/utils/platform_categories.py
  118. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  119. export const serverless: PlatformKey[] = [
  120. 'dotnet-awslambda',
  121. 'dotnet-gcpfunctions',
  122. 'node-awslambda',
  123. 'node-azurefunctions',
  124. 'node-gcpfunctions',
  125. 'python-awslambda',
  126. 'python-azurefunctions',
  127. 'python-gcpfunctions',
  128. 'python-serverless',
  129. ];
  130. // Mirrors `DESKTOP` in src/sentry/utils/platform_categories.py
  131. // When changing this file, make sure to keep src/sentry/utils/platform_categories.py in sync.
  132. export const desktop: PlatformKey[] = [
  133. 'apple-macos',
  134. 'dotnet-maui',
  135. 'dotnet-winforms',
  136. 'dotnet-wpf',
  137. 'dotnet',
  138. 'electron',
  139. 'flutter',
  140. 'java',
  141. 'javascript-electron',
  142. 'kotlin',
  143. 'minidump',
  144. 'native',
  145. 'native-breakpad',
  146. 'native-crashpad',
  147. 'native-minidump',
  148. 'native-qt',
  149. 'unity',
  150. 'unreal',
  151. ];
  152. export const sourceMaps: PlatformKey[] = [
  153. ...frontend,
  154. 'react-native',
  155. 'cordova',
  156. 'electron',
  157. ];
  158. export const performance: PlatformKey[] = [
  159. 'bun',
  160. 'deno',
  161. 'javascript',
  162. 'javascript-ember',
  163. 'javascript-react',
  164. 'javascript-vue',
  165. 'php',
  166. 'php-laravel',
  167. 'python',
  168. 'python-django',
  169. 'python-flask',
  170. 'python-fastapi',
  171. 'python-starlette',
  172. 'python-sanic',
  173. 'python-celery',
  174. 'python-bottle',
  175. 'python-pylons',
  176. 'python-pyramid',
  177. 'python-tornado',
  178. 'python-rq',
  179. 'node',
  180. 'node-express',
  181. 'node-koa',
  182. 'node-connect',
  183. ];
  184. // List of platforms that have tracing custom instrumentation guide docs for its nested frameworks
  185. // i.e. for a platform like `javascript-react`, we have a custom instrumentation guide for `react` that can be
  186. // accessed at `https://docs.sentry.io/platforms/javascript/guides/react/tracing/instrumentation/custom-instrumentation/`
  187. export const platformsWithNestedInstrumentationGuides: PlatformKey[] = [
  188. 'apple',
  189. 'apple-ios',
  190. 'apple-macos',
  191. 'dart',
  192. 'dart-flutter',
  193. 'go',
  194. 'go-echo',
  195. 'go-fasthttp',
  196. 'go-fiber',
  197. 'go-gin',
  198. 'go-http',
  199. 'go-iris',
  200. 'go-martini',
  201. 'go-negroni',
  202. 'java',
  203. 'java-android',
  204. 'java-appengine',
  205. 'java-log4j',
  206. 'java-log4j2',
  207. 'java-logback',
  208. 'java-logging',
  209. 'java-spring',
  210. 'java-spring-boot',
  211. 'javascript',
  212. 'javascript-angular',
  213. 'javascript-angularjs',
  214. 'javascript-astro',
  215. 'javascript-backbone',
  216. 'javascript-browser',
  217. 'javascript-capacitor',
  218. 'javascript-cordova',
  219. 'javascript-electron',
  220. 'javascript-ember',
  221. 'javascript-gatsby',
  222. 'javascript-nextjs',
  223. 'javascript-nuxt',
  224. 'javascript-react',
  225. 'javascript-remix',
  226. 'javascript-solid',
  227. 'javascript-svelte',
  228. 'javascript-sveltekit',
  229. 'javascript-vue',
  230. 'dotnet',
  231. 'dotnet-aspnet',
  232. 'dotnet-aspnetcore',
  233. 'dotnet-awslambda',
  234. 'dotnet-gcpfunctions',
  235. 'dotnet-google-cloud-functions',
  236. 'dotnet-maui',
  237. 'dotnet-uwp',
  238. 'dotnet-winforms',
  239. 'dotnet-wpf',
  240. 'dotnet-xamarin',
  241. 'php',
  242. 'php-laravel',
  243. 'php-monolog',
  244. 'php-symfony',
  245. 'php-symfony2',
  246. 'powershell',
  247. 'react-native',
  248. 'ruby',
  249. 'rust',
  250. 'unity',
  251. ];
  252. // List of platforms that have performance onboarding checklist content
  253. export const withPerformanceOnboarding: Set<PlatformKey> = new Set([
  254. 'javascript',
  255. 'javascript-react',
  256. 'javascript-nextjs',
  257. 'python',
  258. 'python-django',
  259. 'python-flask',
  260. 'php',
  261. 'node',
  262. ]);
  263. // List of platforms that do not have performance support. We make use of this list in the product to not provide any Performance
  264. // views such as Performance onboarding checklist.
  265. export const withoutPerformanceSupport: Set<PlatformKey> = new Set([
  266. 'elixir',
  267. 'minidump',
  268. 'nintendo-switch',
  269. ]);
  270. export const profiling: PlatformKey[] = [
  271. // mobile
  272. 'android',
  273. 'apple-ios',
  274. // go
  275. 'go',
  276. // nodejs
  277. 'node',
  278. 'node-express',
  279. 'node-koa',
  280. 'node-connect',
  281. 'javascript-nextjs',
  282. 'javascript-nuxt',
  283. 'javascript-remix',
  284. 'javascript-solidstart',
  285. 'javascript-sveltekit',
  286. 'javascript',
  287. 'javascript-react',
  288. // react-native
  289. 'react-native',
  290. // python
  291. 'python',
  292. 'python-django',
  293. 'python-flask',
  294. 'python-fastapi',
  295. 'python-starlette',
  296. 'python-sanic',
  297. 'python-celery',
  298. 'python-bottle',
  299. 'python-pylons',
  300. 'python-pyramid',
  301. 'python-tornado',
  302. 'python-rq',
  303. 'python-aiohttp',
  304. 'python-chalice',
  305. 'python-falcon',
  306. 'python-quart',
  307. 'python-tryton',
  308. 'python-wsgi',
  309. 'python-serverless',
  310. // rust
  311. 'rust',
  312. // php
  313. 'php',
  314. 'php-laravel',
  315. 'php-symfony',
  316. // ruby
  317. 'ruby',
  318. 'ruby-rails',
  319. 'ruby-rack',
  320. ];
  321. export const releaseHealth: PlatformKey[] = [
  322. // frontend
  323. 'javascript',
  324. 'javascript-react',
  325. 'javascript-angular',
  326. 'javascript-angularjs',
  327. 'javascript-astro',
  328. 'javascript-backbone',
  329. 'javascript-ember',
  330. 'javascript-gatsby',
  331. 'javascript-vue',
  332. 'javascript-nextjs',
  333. 'javascript-nuxt',
  334. 'javascript-remix',
  335. 'javascript-solid',
  336. 'javascript-solidstart',
  337. 'javascript-svelte',
  338. 'javascript-sveltekit',
  339. 'android',
  340. 'apple-ios',
  341. 'cordova',
  342. 'javascript-cordova',
  343. 'react-native',
  344. 'flutter',
  345. 'dart-flutter',
  346. 'bun',
  347. 'deno',
  348. 'native',
  349. 'node',
  350. 'node-express',
  351. 'node-koa',
  352. 'node-connect',
  353. 'python',
  354. 'python-django',
  355. 'python-flask',
  356. 'python-fastapi',
  357. 'python-starlette',
  358. 'python-sanic',
  359. 'python-celery',
  360. 'python-bottle',
  361. 'python-pylons',
  362. 'python-pyramid',
  363. 'python-tornado',
  364. 'python-rq',
  365. 'python-pymongo',
  366. 'rust',
  367. 'apple-macos',
  368. 'native',
  369. 'native-crashpad',
  370. 'native-breakpad',
  371. 'native-qt',
  372. 'electron',
  373. 'javascript-electron',
  374. 'rust',
  375. 'php',
  376. 'php-laravel',
  377. 'php-symfony',
  378. 'dotnet',
  379. 'dotnet-awslambda',
  380. 'dotnet-gcpfunctions',
  381. 'dotnet-maui',
  382. 'dotnet-uwp',
  383. 'dotnet-wpf',
  384. 'dotnet-winforms',
  385. 'dotnet-xamarin',
  386. 'unity',
  387. ];
  388. // 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.
  389. export const replayBackendPlatforms: readonly PlatformKey[] = [
  390. 'bun',
  391. 'deno',
  392. 'dotnet-aspnetcore',
  393. 'dotnet-aspnet',
  394. 'elixir',
  395. 'go-echo',
  396. 'go-fasthttp',
  397. 'go-fiber',
  398. 'go',
  399. 'go-gin',
  400. 'go-http',
  401. 'go-iris',
  402. 'go-martini',
  403. 'go-negroni',
  404. 'java-spring',
  405. 'java-spring-boot',
  406. 'node',
  407. 'node-express',
  408. 'php',
  409. 'php-laravel',
  410. 'php-symfony',
  411. 'python-aiohttp',
  412. 'python-bottle',
  413. 'python-django',
  414. 'python-falcon',
  415. 'python-fastapi',
  416. 'python-flask',
  417. 'python-pyramid',
  418. 'python-quart',
  419. 'python-sanic',
  420. 'python-starlette',
  421. 'python-tornado',
  422. 'ruby-rails',
  423. ];
  424. // These are the frontend platforms that can set up replay.
  425. export const replayFrontendPlatforms: readonly PlatformKey[] = [
  426. 'javascript',
  427. 'javascript-angular',
  428. 'javascript-astro',
  429. 'javascript-backbone',
  430. 'javascript-capacitor',
  431. 'capacitor',
  432. 'javascript-electron',
  433. 'electron',
  434. 'javascript-ember',
  435. 'javascript-gatsby',
  436. 'javascript-nextjs',
  437. 'javascript-nuxt',
  438. 'javascript-react',
  439. 'javascript-remix',
  440. 'javascript-solid',
  441. 'javascript-solidstart',
  442. 'javascript-svelte',
  443. 'javascript-sveltekit',
  444. 'javascript-vue',
  445. ];
  446. // These are the mobile platforms that can set up replay.
  447. export const replayMobilePlatforms: PlatformKey[] = [
  448. 'android',
  449. 'apple-ios',
  450. 'react-native',
  451. 'flutter',
  452. ];
  453. // These are all the platforms that can set up replay.
  454. export const replayPlatforms: readonly PlatformKey[] = [
  455. ...replayFrontendPlatforms,
  456. ...replayBackendPlatforms,
  457. ...replayMobilePlatforms,
  458. ];
  459. /**
  460. * The list of platforms for which we have created onboarding instructions.
  461. * Should be a subset of the list of `replayPlatforms`.
  462. */
  463. export const replayOnboardingPlatforms: readonly PlatformKey[] = [
  464. ...replayFrontendPlatforms.filter(p => !['javascript-backbone'].includes(p)),
  465. ...replayBackendPlatforms,
  466. ...replayMobilePlatforms,
  467. ];
  468. // These are the supported replay platforms that can also be set up using the JS loader.
  469. export const replayJsLoaderInstructionsPlatformList: readonly PlatformKey[] = [
  470. 'javascript',
  471. ...replayBackendPlatforms,
  472. ];
  473. // Feedback platforms that show only NPM widget setup instructions (no loader)
  474. export const feedbackNpmPlatforms: readonly PlatformKey[] = [
  475. 'ionic',
  476. ...replayFrontendPlatforms,
  477. ];
  478. // Feedback platforms that show widget instructions (both NPM & loader)
  479. export const feedbackWidgetPlatforms: readonly PlatformKey[] = [
  480. ...feedbackNpmPlatforms,
  481. ...replayBackendPlatforms,
  482. ];
  483. // Feedback platforms that only show crash API instructions
  484. export const feedbackCrashApiPlatforms: readonly PlatformKey[] = [
  485. 'android',
  486. 'apple',
  487. 'apple-macos',
  488. 'apple-ios',
  489. 'dart',
  490. 'dotnet',
  491. 'dotnet-awslambda',
  492. 'dotnet-gcpfunctions',
  493. 'dotnet-maui',
  494. 'dotnet-uwp',
  495. 'dotnet-wpf',
  496. 'dotnet-winforms',
  497. 'dotnet-xamarin',
  498. 'flutter',
  499. 'java',
  500. 'java-log4j2',
  501. 'java-logback',
  502. 'kotlin',
  503. 'node-koa',
  504. 'react-native',
  505. 'unity',
  506. 'unreal',
  507. ];
  508. // Feedback platforms that default to the web API
  509. export const feedbackWebApiPlatforms: readonly PlatformKey[] = [
  510. 'cordova',
  511. 'ruby-rack',
  512. 'ruby',
  513. 'rust',
  514. 'native',
  515. 'native-qt',
  516. 'node-awslambda',
  517. 'node-azurefunctions',
  518. 'node-connect',
  519. 'node-gcpfunctions',
  520. 'minidump',
  521. 'python-asgi',
  522. 'python-awslambda',
  523. 'python-celery',
  524. 'python-chalice',
  525. 'python-gcpfunctions',
  526. 'python-pymongo',
  527. 'python-pylons',
  528. 'python',
  529. 'python-rq',
  530. 'python-serverless',
  531. 'python-tryton',
  532. 'python-wsgi',
  533. ];
  534. // All feedback onboarding platforms
  535. export const feedbackOnboardingPlatforms: readonly PlatformKey[] = [
  536. ...feedbackWebApiPlatforms,
  537. ...feedbackWidgetPlatforms,
  538. ...feedbackCrashApiPlatforms,
  539. ];
  540. const customMetricBackendPlatforms: readonly PlatformKey[] = [
  541. 'bun',
  542. 'dart',
  543. 'deno',
  544. 'dotnet',
  545. 'dotnet-aspnet',
  546. 'dotnet-aspnetcore',
  547. 'dotnet-awslambda',
  548. 'dotnet-gcpfunctions',
  549. 'dotnet-maui',
  550. 'dotnet-uwp',
  551. 'dotnet-winforms',
  552. 'dotnet-wpf',
  553. 'java',
  554. 'java-appengine',
  555. 'java-log4j',
  556. 'java-log4j2',
  557. 'java-logback',
  558. 'java-logging',
  559. 'java-spring',
  560. 'java-spring-boot',
  561. 'php',
  562. 'php-laravel',
  563. // TODO: Enable once metrics are available for Symfony
  564. // 'php-symfony',
  565. 'python',
  566. 'python-aiohttp',
  567. 'python-asgi',
  568. 'python-awslambda',
  569. 'python-bottle',
  570. 'python-celery',
  571. 'python-chalice',
  572. 'python-django',
  573. 'python-falcon',
  574. 'python-fastapi',
  575. 'python-flask',
  576. 'python-gcpfunctions',
  577. 'python-pymongo',
  578. 'python-pylons',
  579. 'python-pyramid',
  580. 'python-quart',
  581. 'python-rq',
  582. 'python-sanic',
  583. 'python-serverless',
  584. 'python-starlette',
  585. 'python-tornado',
  586. 'python-tryton',
  587. 'python-wsgi',
  588. 'rust',
  589. 'node',
  590. 'node-awslambda',
  591. 'node-azurefunctions',
  592. 'node-connect',
  593. 'node-express',
  594. 'node-gcpfunctions',
  595. 'node-koa',
  596. 'ruby',
  597. 'ruby-rails',
  598. 'ruby-rack',
  599. ];
  600. const customMetricFrontendPlatforms: readonly PlatformKey[] = [
  601. 'android',
  602. 'apple-ios',
  603. 'electron',
  604. 'flutter',
  605. 'java-android',
  606. 'javascript-angular',
  607. 'javascript-astro',
  608. 'javascript-backbone',
  609. 'javascript-capacitor',
  610. 'javascript-electron',
  611. 'javascript-ember',
  612. 'javascript-gatsby',
  613. 'javascript-nextjs',
  614. 'javascript-nuxt',
  615. 'javascript-react',
  616. 'javascript-remix',
  617. 'javascript-solid',
  618. 'javascript-solidstart',
  619. 'javascript-svelte',
  620. 'javascript-sveltekit',
  621. 'javascript-vue',
  622. 'javascript',
  623. 'react-native',
  624. 'unity',
  625. ];
  626. // These are all the platforms that can set up custom metrics.
  627. export const customMetricPlatforms: readonly PlatformKey[] = [
  628. ...customMetricFrontendPlatforms,
  629. ...customMetricBackendPlatforms,
  630. ];
  631. /**
  632. * The list of platforms for which we have created onboarding instructions.
  633. * Should be a subset of the list of `customMetricPlatforms`.
  634. */
  635. export const customMetricOnboardingPlatforms: readonly PlatformKey[] =
  636. customMetricPlatforms.filter(
  637. p =>
  638. // Legacy platforms that do not have in-product docs
  639. ![
  640. 'javascript-backbone',
  641. 'javascript-capacitor',
  642. 'javascript-electron',
  643. 'python-pylons',
  644. 'python-tryton',
  645. ].includes(p)
  646. );