platformCategories.tsx 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  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. // Feature flag onboarding platforms
  541. export const featureFlagOnboardingPlatforms: readonly PlatformKey[] = [
  542. 'javascript',
  543. 'python',
  544. 'javascript-angular',
  545. 'javascript-astro',
  546. 'javascript-ember',
  547. 'javascript-gatsby',
  548. 'javascript-nextjs',
  549. 'javascript-nuxt',
  550. 'javascript-react',
  551. 'javascript-remix',
  552. 'javascript-solid',
  553. 'javascript-solidstart',
  554. 'javascript-svelte',
  555. 'javascript-sveltekit',
  556. 'javascript-vue',
  557. 'python-aiohttp',
  558. 'python-bottle',
  559. 'python-django',
  560. 'python-falcon',
  561. 'python-fastapi',
  562. 'python-flask',
  563. 'python-pyramid',
  564. 'python-quart',
  565. 'python-sanic',
  566. 'python-starlette',
  567. 'python-tornado',
  568. ];
  569. const customMetricBackendPlatforms: readonly PlatformKey[] = [
  570. 'bun',
  571. 'dart',
  572. 'deno',
  573. 'dotnet',
  574. 'dotnet-aspnet',
  575. 'dotnet-aspnetcore',
  576. 'dotnet-awslambda',
  577. 'dotnet-gcpfunctions',
  578. 'dotnet-maui',
  579. 'dotnet-uwp',
  580. 'dotnet-winforms',
  581. 'dotnet-wpf',
  582. 'java',
  583. 'java-appengine',
  584. 'java-log4j',
  585. 'java-log4j2',
  586. 'java-logback',
  587. 'java-logging',
  588. 'java-spring',
  589. 'java-spring-boot',
  590. 'php',
  591. 'php-laravel',
  592. // TODO: Enable once metrics are available for Symfony
  593. // 'php-symfony',
  594. 'python',
  595. 'python-aiohttp',
  596. 'python-asgi',
  597. 'python-awslambda',
  598. 'python-bottle',
  599. 'python-celery',
  600. 'python-chalice',
  601. 'python-django',
  602. 'python-falcon',
  603. 'python-fastapi',
  604. 'python-flask',
  605. 'python-gcpfunctions',
  606. 'python-pymongo',
  607. 'python-pylons',
  608. 'python-pyramid',
  609. 'python-quart',
  610. 'python-rq',
  611. 'python-sanic',
  612. 'python-serverless',
  613. 'python-starlette',
  614. 'python-tornado',
  615. 'python-tryton',
  616. 'python-wsgi',
  617. 'rust',
  618. 'node',
  619. 'node-awslambda',
  620. 'node-azurefunctions',
  621. 'node-connect',
  622. 'node-express',
  623. 'node-gcpfunctions',
  624. 'node-koa',
  625. 'ruby',
  626. 'ruby-rails',
  627. 'ruby-rack',
  628. ];
  629. const customMetricFrontendPlatforms: readonly PlatformKey[] = [
  630. 'android',
  631. 'apple-ios',
  632. 'electron',
  633. 'flutter',
  634. 'java-android',
  635. 'javascript-angular',
  636. 'javascript-astro',
  637. 'javascript-backbone',
  638. 'javascript-capacitor',
  639. 'javascript-electron',
  640. 'javascript-ember',
  641. 'javascript-gatsby',
  642. 'javascript-nextjs',
  643. 'javascript-nuxt',
  644. 'javascript-react',
  645. 'javascript-remix',
  646. 'javascript-solid',
  647. 'javascript-solidstart',
  648. 'javascript-svelte',
  649. 'javascript-sveltekit',
  650. 'javascript-vue',
  651. 'javascript',
  652. 'react-native',
  653. 'unity',
  654. ];
  655. // These are all the platforms that can set up custom metrics.
  656. export const customMetricPlatforms: readonly PlatformKey[] = [
  657. ...customMetricFrontendPlatforms,
  658. ...customMetricBackendPlatforms,
  659. ];
  660. /**
  661. * The list of platforms for which we have created onboarding instructions.
  662. * Should be a subset of the list of `customMetricPlatforms`.
  663. */
  664. export const customMetricOnboardingPlatforms: readonly PlatformKey[] =
  665. customMetricPlatforms.filter(
  666. p =>
  667. // Legacy platforms that do not have in-product docs
  668. ![
  669. 'javascript-backbone',
  670. 'javascript-capacitor',
  671. 'javascript-electron',
  672. 'python-pylons',
  673. 'python-tryton',
  674. ].includes(p)
  675. );