platformCategories.tsx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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. ];
  452. // These are all the platforms that can set up replay.
  453. export const replayPlatforms: readonly PlatformKey[] = [
  454. ...replayFrontendPlatforms,
  455. ...replayBackendPlatforms,
  456. ...replayMobilePlatforms,
  457. ];
  458. /**
  459. * The list of platforms for which we have created onboarding instructions.
  460. * Should be a subset of the list of `replayPlatforms`.
  461. */
  462. export const replayOnboardingPlatforms: readonly PlatformKey[] = [
  463. ...replayFrontendPlatforms.filter(p => !['javascript-backbone'].includes(p)),
  464. ...replayBackendPlatforms,
  465. ...replayMobilePlatforms,
  466. ];
  467. // These are the supported replay platforms that can also be set up using the JS loader.
  468. export const replayJsLoaderInstructionsPlatformList: readonly PlatformKey[] = [
  469. 'javascript',
  470. ...replayBackendPlatforms,
  471. ];
  472. // Feedback platforms that show only NPM widget setup instructions (no loader)
  473. export const feedbackNpmPlatforms: readonly PlatformKey[] = [
  474. 'ionic',
  475. ...replayFrontendPlatforms,
  476. ];
  477. // Feedback platforms that show widget instructions (both NPM & loader)
  478. export const feedbackWidgetPlatforms: readonly PlatformKey[] = [
  479. ...feedbackNpmPlatforms,
  480. ...replayBackendPlatforms,
  481. ];
  482. // Feedback platforms that only show crash API instructions
  483. export const feedbackCrashApiPlatforms: readonly PlatformKey[] = [
  484. 'android',
  485. 'apple',
  486. 'apple-macos',
  487. 'apple-ios',
  488. 'dart',
  489. 'dotnet',
  490. 'dotnet-awslambda',
  491. 'dotnet-gcpfunctions',
  492. 'dotnet-maui',
  493. 'dotnet-uwp',
  494. 'dotnet-wpf',
  495. 'dotnet-winforms',
  496. 'dotnet-xamarin',
  497. 'flutter',
  498. 'java',
  499. 'java-log4j2',
  500. 'java-logback',
  501. 'kotlin',
  502. 'node-koa',
  503. 'react-native',
  504. 'unity',
  505. 'unreal',
  506. ];
  507. // Feedback platforms that default to the web API
  508. export const feedbackWebApiPlatforms: readonly PlatformKey[] = [
  509. 'cordova',
  510. 'ruby-rack',
  511. 'ruby',
  512. 'rust',
  513. 'native',
  514. 'native-qt',
  515. 'node-awslambda',
  516. 'node-azurefunctions',
  517. 'node-connect',
  518. 'node-gcpfunctions',
  519. 'minidump',
  520. 'python-asgi',
  521. 'python-awslambda',
  522. 'python-celery',
  523. 'python-chalice',
  524. 'python-gcpfunctions',
  525. 'python-pymongo',
  526. 'python-pylons',
  527. 'python',
  528. 'python-rq',
  529. 'python-serverless',
  530. 'python-tryton',
  531. 'python-wsgi',
  532. ];
  533. // All feedback onboarding platforms
  534. export const feedbackOnboardingPlatforms: readonly PlatformKey[] = [
  535. ...feedbackWebApiPlatforms,
  536. ...feedbackWidgetPlatforms,
  537. ...feedbackCrashApiPlatforms,
  538. ];
  539. const customMetricBackendPlatforms: readonly PlatformKey[] = [
  540. 'bun',
  541. 'dart',
  542. 'deno',
  543. 'dotnet',
  544. 'dotnet-aspnet',
  545. 'dotnet-aspnetcore',
  546. 'dotnet-awslambda',
  547. 'dotnet-gcpfunctions',
  548. 'dotnet-maui',
  549. 'dotnet-uwp',
  550. 'dotnet-winforms',
  551. 'dotnet-wpf',
  552. 'java',
  553. 'java-appengine',
  554. 'java-log4j',
  555. 'java-log4j2',
  556. 'java-logback',
  557. 'java-logging',
  558. 'java-spring',
  559. 'java-spring-boot',
  560. 'php',
  561. 'php-laravel',
  562. // TODO: Enable once metrics are available for Symfony
  563. // 'php-symfony',
  564. 'python',
  565. 'python-aiohttp',
  566. 'python-asgi',
  567. 'python-awslambda',
  568. 'python-bottle',
  569. 'python-celery',
  570. 'python-chalice',
  571. 'python-django',
  572. 'python-falcon',
  573. 'python-fastapi',
  574. 'python-flask',
  575. 'python-gcpfunctions',
  576. 'python-pymongo',
  577. 'python-pylons',
  578. 'python-pyramid',
  579. 'python-quart',
  580. 'python-rq',
  581. 'python-sanic',
  582. 'python-serverless',
  583. 'python-starlette',
  584. 'python-tornado',
  585. 'python-tryton',
  586. 'python-wsgi',
  587. 'rust',
  588. 'node',
  589. 'node-awslambda',
  590. 'node-azurefunctions',
  591. 'node-connect',
  592. 'node-express',
  593. 'node-gcpfunctions',
  594. 'node-koa',
  595. 'ruby',
  596. 'ruby-rails',
  597. 'ruby-rack',
  598. ];
  599. const customMetricFrontendPlatforms: readonly PlatformKey[] = [
  600. 'android',
  601. 'apple-ios',
  602. 'electron',
  603. 'flutter',
  604. 'java-android',
  605. 'javascript-angular',
  606. 'javascript-astro',
  607. 'javascript-backbone',
  608. 'javascript-capacitor',
  609. 'javascript-electron',
  610. 'javascript-ember',
  611. 'javascript-gatsby',
  612. 'javascript-nextjs',
  613. 'javascript-nuxt',
  614. 'javascript-react',
  615. 'javascript-remix',
  616. 'javascript-solid',
  617. 'javascript-solidstart',
  618. 'javascript-svelte',
  619. 'javascript-sveltekit',
  620. 'javascript-vue',
  621. 'javascript',
  622. 'react-native',
  623. 'unity',
  624. ];
  625. // These are all the platforms that can set up custom metrics.
  626. export const customMetricPlatforms: readonly PlatformKey[] = [
  627. ...customMetricFrontendPlatforms,
  628. ...customMetricBackendPlatforms,
  629. ];
  630. /**
  631. * The list of platforms for which we have created onboarding instructions.
  632. * Should be a subset of the list of `customMetricPlatforms`.
  633. */
  634. export const customMetricOnboardingPlatforms: readonly PlatformKey[] =
  635. customMetricPlatforms.filter(
  636. p =>
  637. // Legacy platforms that do not have in-product docs
  638. ![
  639. 'javascript-backbone',
  640. 'javascript-capacitor',
  641. 'javascript-electron',
  642. 'python-pylons',
  643. 'python-tryton',
  644. ].includes(p)
  645. );