platformCategories.tsx 14 KB

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