data.tsx 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734
  1. import {t} from 'sentry/locale';
  2. import type {Organization} from 'sentry/types/organization';
  3. import {uniqueId} from 'sentry/utils/guid';
  4. import type {DashboardDetails} from './types';
  5. import {DisplayType, WidgetType} from './types';
  6. type DashboardTemplate = DashboardDetails & {
  7. description: string;
  8. };
  9. export const EMPTY_DASHBOARD: DashboardDetails = {
  10. id: '',
  11. dateCreated: '',
  12. createdBy: undefined,
  13. title: t('Untitled dashboard'),
  14. widgets: [],
  15. projects: [],
  16. filters: {},
  17. };
  18. export const getDashboardTemplates = (organization: Organization) => {
  19. return [
  20. {
  21. id: 'default-template',
  22. dateCreated: '',
  23. createdBy: undefined,
  24. title: t('General Template'),
  25. description: t('Various Frontend and Backend Widgets'),
  26. projects: [],
  27. filters: {},
  28. widgets: [
  29. {
  30. title: t('Number of Errors'),
  31. displayType: DisplayType.BIG_NUMBER,
  32. interval: '5m',
  33. widgetType: organization.features.includes(
  34. 'performance-discover-dataset-selector'
  35. )
  36. ? WidgetType.ERRORS
  37. : WidgetType.DISCOVER,
  38. tempId: uniqueId(),
  39. layout: {
  40. h: 1,
  41. minH: 1,
  42. w: 1,
  43. x: 0,
  44. y: 0,
  45. },
  46. queries: [
  47. {
  48. name: '',
  49. fields: ['count()'],
  50. aggregates: ['count()'],
  51. columns: [],
  52. conditions: '!event.type:transaction',
  53. orderby: 'count()',
  54. },
  55. ],
  56. },
  57. {
  58. title: t('Number of Issues'),
  59. displayType: DisplayType.BIG_NUMBER,
  60. interval: '5m',
  61. widgetType: organization.features.includes(
  62. 'performance-discover-dataset-selector'
  63. )
  64. ? WidgetType.ERRORS
  65. : WidgetType.DISCOVER,
  66. tempId: uniqueId(),
  67. layout: {
  68. h: 1,
  69. minH: 1,
  70. w: 1,
  71. x: 1,
  72. y: 0,
  73. },
  74. queries: [
  75. {
  76. name: '',
  77. fields: ['count_unique(issue)'],
  78. aggregates: ['count_unique(issue)'],
  79. columns: [],
  80. conditions: '!event.type:transaction',
  81. orderby: 'count_unique(issue)',
  82. },
  83. ],
  84. },
  85. {
  86. title: t('Events'),
  87. displayType: DisplayType.LINE,
  88. interval: '5m',
  89. widgetType: organization.features.includes(
  90. 'performance-discover-dataset-selector'
  91. )
  92. ? WidgetType.ERRORS
  93. : WidgetType.DISCOVER,
  94. tempId: uniqueId(),
  95. layout: {
  96. h: 2,
  97. minH: 2,
  98. w: 4,
  99. x: 2,
  100. y: 0,
  101. },
  102. queries: [
  103. {
  104. name: t('Events'),
  105. fields: ['count()'],
  106. aggregates: ['count()'],
  107. columns: [],
  108. conditions: '!event.type:transaction',
  109. orderby: 'count()',
  110. },
  111. ],
  112. },
  113. {
  114. title: t('Affected Users'),
  115. displayType: DisplayType.LINE,
  116. interval: '5m',
  117. widgetType: organization.features.includes(
  118. 'performance-discover-dataset-selector'
  119. )
  120. ? WidgetType.ERRORS
  121. : WidgetType.DISCOVER,
  122. tempId: uniqueId(),
  123. layout: {
  124. h: 2,
  125. minH: 2,
  126. w: 1,
  127. x: 1,
  128. y: 2,
  129. },
  130. queries: [
  131. {
  132. name: t('Known Users'),
  133. fields: ['count_unique(user)'],
  134. aggregates: ['count_unique(user)'],
  135. columns: [],
  136. conditions: 'has:user.email !event.type:transaction',
  137. orderby: 'count_unique(user)',
  138. },
  139. {
  140. name: t('Anonymous Users'),
  141. fields: ['count_unique(user)'],
  142. aggregates: ['count_unique(user)'],
  143. columns: [],
  144. conditions: '!has:user.email !event.type:transaction',
  145. orderby: 'count_unique(user)',
  146. },
  147. ],
  148. },
  149. {
  150. title: t('Handled vs. Unhandled'),
  151. displayType: DisplayType.LINE,
  152. interval: '5m',
  153. widgetType: organization.features.includes(
  154. 'performance-discover-dataset-selector'
  155. )
  156. ? WidgetType.ERRORS
  157. : WidgetType.DISCOVER,
  158. tempId: uniqueId(),
  159. layout: {
  160. h: 2,
  161. minH: 2,
  162. w: 1,
  163. x: 0,
  164. y: 2,
  165. },
  166. queries: [
  167. {
  168. name: t('Handled'),
  169. fields: ['count()'],
  170. aggregates: ['count()'],
  171. columns: [],
  172. conditions: 'error.handled:true',
  173. orderby: 'count()',
  174. },
  175. {
  176. name: t('Unhandled'),
  177. fields: ['count()'],
  178. aggregates: ['count()'],
  179. columns: [],
  180. conditions: 'error.handled:false',
  181. orderby: 'count()',
  182. },
  183. ],
  184. },
  185. {
  186. title: t('Errors by Country'),
  187. displayType: DisplayType.TABLE,
  188. interval: '5m',
  189. widgetType: organization.features.includes(
  190. 'performance-discover-dataset-selector'
  191. )
  192. ? WidgetType.ERRORS
  193. : WidgetType.DISCOVER,
  194. tempId: uniqueId(),
  195. layout: {
  196. h: 4,
  197. minH: 2,
  198. w: 2,
  199. x: 4,
  200. y: 6,
  201. },
  202. queries: [
  203. {
  204. name: '',
  205. fields: ['geo.country_code', 'geo.region', 'count()'],
  206. aggregates: ['count()'],
  207. columns: ['geo.country_code', 'geo.region'],
  208. conditions: '!event.type:transaction has:geo.country_code',
  209. orderby: 'count()',
  210. },
  211. ],
  212. },
  213. {
  214. title: t('High Throughput Transactions'),
  215. displayType: DisplayType.TABLE,
  216. interval: '5m',
  217. widgetType: organization.features.includes(
  218. 'performance-discover-dataset-selector'
  219. )
  220. ? WidgetType.TRANSACTIONS
  221. : WidgetType.DISCOVER,
  222. tempId: uniqueId(),
  223. layout: {
  224. h: 4,
  225. minH: 2,
  226. w: 2,
  227. x: 0,
  228. y: 6,
  229. },
  230. queries: [
  231. {
  232. name: '',
  233. fields: ['count()', 'transaction'],
  234. aggregates: ['count()'],
  235. columns: ['transaction'],
  236. conditions: 'event.type:transaction',
  237. orderby: '-count()',
  238. },
  239. ],
  240. },
  241. {
  242. title: t('Errors by Browser'),
  243. displayType: DisplayType.TABLE,
  244. interval: '5m',
  245. widgetType: organization.features.includes(
  246. 'performance-discover-dataset-selector'
  247. )
  248. ? WidgetType.ERRORS
  249. : WidgetType.DISCOVER,
  250. tempId: uniqueId(),
  251. layout: {
  252. h: 4,
  253. minH: 2,
  254. w: 1,
  255. x: 5,
  256. y: 2,
  257. },
  258. queries: [
  259. {
  260. name: '',
  261. fields: ['browser.name', 'count()'],
  262. aggregates: ['count()'],
  263. columns: ['browser.name'],
  264. conditions: '!event.type:transaction has:browser.name',
  265. orderby: '-count()',
  266. },
  267. ],
  268. },
  269. {
  270. title: t('Overall User Misery'),
  271. displayType: DisplayType.BIG_NUMBER,
  272. interval: '5m',
  273. widgetType: organization.features.includes(
  274. 'performance-discover-dataset-selector'
  275. )
  276. ? WidgetType.TRANSACTIONS
  277. : WidgetType.DISCOVER,
  278. tempId: uniqueId(),
  279. layout: {
  280. h: 1,
  281. minH: 1,
  282. w: 1,
  283. x: 0,
  284. y: 1,
  285. },
  286. queries: [
  287. {
  288. name: '',
  289. fields: ['user_misery(300)'],
  290. aggregates: ['user_misery(300)'],
  291. columns: [],
  292. conditions: '',
  293. orderby: '',
  294. },
  295. ],
  296. },
  297. {
  298. title: t('Overall Apdex'),
  299. displayType: DisplayType.BIG_NUMBER,
  300. interval: '5m',
  301. widgetType: organization.features.includes(
  302. 'performance-discover-dataset-selector'
  303. )
  304. ? WidgetType.TRANSACTIONS
  305. : WidgetType.DISCOVER,
  306. tempId: uniqueId(),
  307. layout: {
  308. h: 1,
  309. minH: 1,
  310. w: 1,
  311. x: 1,
  312. y: 1,
  313. },
  314. queries: [
  315. {
  316. name: '',
  317. fields: ['apdex(300)'],
  318. aggregates: ['apdex(300)'],
  319. columns: [],
  320. conditions: '',
  321. orderby: '',
  322. },
  323. ],
  324. },
  325. {
  326. title: t('High Throughput Transactions'),
  327. displayType: DisplayType.TOP_N,
  328. interval: '5m',
  329. widgetType: organization.features.includes(
  330. 'performance-discover-dataset-selector'
  331. )
  332. ? WidgetType.TRANSACTIONS
  333. : WidgetType.DISCOVER,
  334. tempId: uniqueId(),
  335. layout: {
  336. h: 2,
  337. minH: 2,
  338. w: 2,
  339. x: 0,
  340. y: 4,
  341. },
  342. queries: [
  343. {
  344. name: '',
  345. fields: ['transaction', 'count()'],
  346. aggregates: ['count()'],
  347. columns: ['transaction'],
  348. conditions: 'event.type:transaction',
  349. orderby: '-count()',
  350. },
  351. ],
  352. },
  353. {
  354. title: t('Issues Assigned to Me or My Teams'),
  355. displayType: DisplayType.TABLE,
  356. interval: '5m',
  357. widgetType: WidgetType.ISSUE,
  358. tempId: uniqueId(),
  359. layout: {
  360. h: 4,
  361. minH: 2,
  362. w: 2,
  363. x: 2,
  364. y: 2,
  365. },
  366. queries: [
  367. {
  368. name: '',
  369. fields: ['assignee', 'issue', 'title'],
  370. aggregates: [],
  371. columns: ['assignee', 'issue', 'title'],
  372. conditions: 'assigned_or_suggested:me is:unresolved',
  373. orderby: 'trends',
  374. },
  375. ],
  376. },
  377. {
  378. title: t('Transactions Ordered by Misery'),
  379. displayType: DisplayType.TABLE,
  380. interval: '5m',
  381. widgetType: organization.features.includes(
  382. 'performance-discover-dataset-selector'
  383. )
  384. ? WidgetType.TRANSACTIONS
  385. : WidgetType.DISCOVER,
  386. tempId: uniqueId(),
  387. layout: {
  388. h: 4,
  389. minH: 2,
  390. w: 2,
  391. y: 6,
  392. x: 2,
  393. },
  394. queries: [
  395. {
  396. name: '',
  397. fields: ['transaction', 'user_misery(300)'],
  398. aggregates: ['user_misery(300)'],
  399. columns: ['transaction'],
  400. conditions: '',
  401. orderby: '-user_misery(300)',
  402. },
  403. ],
  404. },
  405. {
  406. title: t('Errors by Browser Over Time'),
  407. displayType: DisplayType.TOP_N,
  408. interval: '5m',
  409. widgetType: organization.features.includes(
  410. 'performance-discover-dataset-selector'
  411. )
  412. ? WidgetType.ERRORS
  413. : WidgetType.DISCOVER,
  414. tempId: uniqueId(),
  415. layout: {
  416. h: 4,
  417. minH: 2,
  418. w: 1,
  419. x: 4,
  420. y: 2,
  421. },
  422. queries: [
  423. {
  424. name: '',
  425. fields: ['browser.name', 'count()'],
  426. aggregates: ['count()'],
  427. columns: ['browser.name'],
  428. conditions: 'event.type:error has:browser.name',
  429. orderby: '-count()',
  430. },
  431. ],
  432. },
  433. ],
  434. },
  435. {
  436. id: 'frontend-template',
  437. title: t('Frontend Template'),
  438. dateCreated: '',
  439. createdBy: undefined,
  440. description: t('Erroring URLs and Web Vitals'),
  441. projects: [],
  442. filters: {},
  443. widgets: [
  444. {
  445. title: t('Top 5 Issues by Unique Users Over Time'),
  446. displayType: DisplayType.TOP_N,
  447. interval: '5m',
  448. widgetType: organization.features.includes(
  449. 'performance-discover-dataset-selector'
  450. )
  451. ? WidgetType.ERRORS
  452. : WidgetType.DISCOVER,
  453. tempId: uniqueId(),
  454. layout: {
  455. h: 2,
  456. minH: 2,
  457. w: 4,
  458. x: 0,
  459. y: 4,
  460. },
  461. queries: [
  462. {
  463. name: '',
  464. fields: ['issue', 'count_unique(user)'],
  465. aggregates: ['count_unique(user)'],
  466. columns: ['issue'],
  467. conditions: '',
  468. orderby: '-count_unique(user)',
  469. },
  470. ],
  471. },
  472. {
  473. title: t('Errors by Browser as Percentage'),
  474. displayType: DisplayType.AREA,
  475. interval: '5m',
  476. widgetType: organization.features.includes(
  477. 'performance-discover-dataset-selector'
  478. )
  479. ? WidgetType.ERRORS
  480. : WidgetType.DISCOVER,
  481. tempId: uniqueId(),
  482. layout: {
  483. h: 4,
  484. minH: 2,
  485. w: 2,
  486. x: 0,
  487. y: 9,
  488. },
  489. queries: [
  490. {
  491. name: '',
  492. fields: [
  493. 'equation|count_if(browser.name,equals,Chrome)/count() * 100',
  494. 'equation|count_if(browser.name,equals,Firefox)/count() * 100',
  495. 'equation|count_if(browser.name,equals,Safari)/count() * 100',
  496. ],
  497. aggregates: [
  498. 'equation|count_if(browser.name,equals,Chrome)/count() * 100',
  499. 'equation|count_if(browser.name,equals,Firefox)/count() * 100',
  500. 'equation|count_if(browser.name,equals,Safari)/count() * 100',
  501. ],
  502. columns: [],
  503. conditions: 'has:browser.name',
  504. orderby: '',
  505. },
  506. ],
  507. },
  508. {
  509. title: t('Issues Assigned to Me or My Teams'),
  510. displayType: DisplayType.TABLE,
  511. interval: '5m',
  512. widgetType: WidgetType.ISSUE,
  513. tempId: uniqueId(),
  514. layout: {
  515. h: 4,
  516. minH: 2,
  517. w: 2,
  518. x: 4,
  519. y: 4,
  520. },
  521. queries: [
  522. {
  523. name: '',
  524. fields: ['assignee', 'issue', 'title'],
  525. aggregates: [],
  526. columns: ['assignee', 'issue', 'title'],
  527. conditions: 'assigned_or_suggested:me is:unresolved',
  528. orderby: 'date',
  529. },
  530. ],
  531. },
  532. {
  533. title: t('Top 5 Issues by Unique Users'),
  534. displayType: DisplayType.TABLE,
  535. interval: '5m',
  536. widgetType: organization.features.includes(
  537. 'performance-discover-dataset-selector'
  538. )
  539. ? WidgetType.ERRORS
  540. : WidgetType.DISCOVER,
  541. tempId: uniqueId(),
  542. layout: {
  543. h: 3,
  544. minH: 2,
  545. w: 4,
  546. x: 0,
  547. y: 6,
  548. },
  549. queries: [
  550. {
  551. name: '',
  552. fields: ['issue', 'count_unique(user)', 'title'],
  553. aggregates: ['count_unique(user)'],
  554. columns: ['issue', 'title'],
  555. conditions: '',
  556. orderby: '-count_unique(user)',
  557. },
  558. ],
  559. },
  560. {
  561. title: t('URLs grouped by Issue'),
  562. displayType: DisplayType.TABLE,
  563. interval: '5m',
  564. widgetType: organization.features.includes(
  565. 'performance-discover-dataset-selector'
  566. )
  567. ? WidgetType.ERRORS
  568. : WidgetType.DISCOVER,
  569. tempId: uniqueId(),
  570. layout: {
  571. h: 5,
  572. minH: 2,
  573. w: 2,
  574. x: 4,
  575. y: 8,
  576. },
  577. queries: [
  578. {
  579. name: '',
  580. fields: ['http.url', 'issue', 'count_unique(user)'],
  581. aggregates: ['count_unique(user)'],
  582. columns: ['http.url', 'issue'],
  583. conditions: 'event.type:error',
  584. orderby: '-count_unique(user)',
  585. },
  586. ],
  587. },
  588. {
  589. title: t('Transactions 404ing'),
  590. displayType: DisplayType.TABLE,
  591. interval: '5m',
  592. widgetType: organization.features.includes(
  593. 'performance-discover-dataset-selector'
  594. )
  595. ? WidgetType.TRANSACTIONS
  596. : WidgetType.DISCOVER,
  597. tempId: uniqueId(),
  598. layout: {
  599. h: 4,
  600. minH: 2,
  601. w: 2,
  602. x: 2,
  603. y: 9,
  604. },
  605. queries: [
  606. {
  607. name: '',
  608. fields: ['transaction', 'count()'],
  609. aggregates: ['count()'],
  610. columns: ['transaction'],
  611. conditions: 'transaction.status:not_found',
  612. orderby: '-count()',
  613. },
  614. ],
  615. },
  616. {
  617. title: t('Layout Shift Over Time'),
  618. displayType: DisplayType.LINE,
  619. interval: '5m',
  620. widgetType: organization.features.includes(
  621. 'performance-discover-dataset-selector'
  622. )
  623. ? WidgetType.TRANSACTIONS
  624. : WidgetType.DISCOVER,
  625. tempId: uniqueId(),
  626. layout: {
  627. h: 2,
  628. minH: 2,
  629. w: 1,
  630. x: 2,
  631. y: 0,
  632. },
  633. queries: [
  634. {
  635. name: '',
  636. fields: ['p75(measurements.cls)'],
  637. aggregates: ['p75(measurements.cls)'],
  638. columns: [],
  639. conditions: '',
  640. orderby: '',
  641. },
  642. ],
  643. },
  644. {
  645. title: t('LCP by Country'),
  646. displayType: DisplayType.TABLE,
  647. interval: '5m',
  648. widgetType: organization.features.includes(
  649. 'performance-discover-dataset-selector'
  650. )
  651. ? WidgetType.TRANSACTIONS
  652. : WidgetType.DISCOVER,
  653. tempId: uniqueId(),
  654. layout: {
  655. h: 2,
  656. minH: 2,
  657. w: 2,
  658. x: 2,
  659. y: 2,
  660. },
  661. queries: [
  662. {
  663. name: '',
  664. fields: ['geo.country_code', 'geo.region', 'p75(measurements.lcp)'],
  665. aggregates: ['p75(measurements.lcp)'],
  666. columns: ['geo.country_code', 'geo.region'],
  667. conditions: 'has:geo.country_code',
  668. orderby: '-p75(measurements.lcp)',
  669. },
  670. ],
  671. },
  672. {
  673. title: t('Page Load Over Time'),
  674. displayType: DisplayType.LINE,
  675. interval: '5m',
  676. widgetType: organization.features.includes(
  677. 'performance-discover-dataset-selector'
  678. )
  679. ? WidgetType.TRANSACTIONS
  680. : WidgetType.DISCOVER,
  681. tempId: uniqueId(),
  682. layout: {
  683. h: 2,
  684. minH: 2,
  685. w: 1,
  686. x: 3,
  687. y: 0,
  688. },
  689. queries: [
  690. {
  691. name: '',
  692. fields: ['p75(measurements.lcp)', 'p75(measurements.fcp)'],
  693. aggregates: ['p75(measurements.lcp)', 'p75(measurements.fcp)'],
  694. columns: [],
  695. conditions: 'transaction.op:pageload',
  696. orderby: '',
  697. },
  698. ],
  699. },
  700. {
  701. title: t('Slowest Pageloads'),
  702. displayType: DisplayType.TABLE,
  703. interval: '5m',
  704. widgetType: organization.features.includes(
  705. 'performance-discover-dataset-selector'
  706. )
  707. ? WidgetType.TRANSACTIONS
  708. : WidgetType.DISCOVER,
  709. layout: {
  710. h: 2,
  711. minH: 2,
  712. w: 2,
  713. x: 0,
  714. y: 2,
  715. },
  716. queries: [
  717. {
  718. name: '',
  719. fields: ['transaction', 'count()'],
  720. aggregates: ['count()'],
  721. columns: ['transaction'],
  722. conditions: 'transaction.op:pageload p75(measurements.lcp):>4s',
  723. orderby: '-count()',
  724. },
  725. ],
  726. },
  727. {
  728. title: t('Overall LCP'),
  729. displayType: DisplayType.BIG_NUMBER,
  730. interval: '5m',
  731. widgetType: organization.features.includes(
  732. 'performance-discover-dataset-selector'
  733. )
  734. ? WidgetType.TRANSACTIONS
  735. : WidgetType.DISCOVER,
  736. tempId: uniqueId(),
  737. layout: {
  738. h: 1,
  739. minH: 1,
  740. w: 1,
  741. x: 0,
  742. y: 0,
  743. },
  744. queries: [
  745. {
  746. name: '',
  747. fields: ['p75(measurements.lcp)'],
  748. aggregates: ['p75(measurements.lcp)'],
  749. columns: [],
  750. conditions: '',
  751. orderby: '',
  752. },
  753. ],
  754. },
  755. {
  756. title: t('Slow Page Navigations'),
  757. displayType: DisplayType.TABLE,
  758. interval: '5m',
  759. widgetType: organization.features.includes(
  760. 'performance-discover-dataset-selector'
  761. )
  762. ? WidgetType.TRANSACTIONS
  763. : WidgetType.DISCOVER,
  764. tempId: uniqueId(),
  765. layout: {
  766. h: 4,
  767. minH: 2,
  768. w: 2,
  769. x: 4,
  770. y: 0,
  771. },
  772. queries: [
  773. {
  774. name: '',
  775. fields: ['transaction', 'count()'],
  776. aggregates: ['count()'],
  777. columns: ['transaction'],
  778. conditions: 'transaction.duration:>2s',
  779. orderby: '-count()',
  780. },
  781. ],
  782. },
  783. {
  784. title: t('Overall FCP'),
  785. displayType: DisplayType.BIG_NUMBER,
  786. interval: '5m',
  787. widgetType: organization.features.includes(
  788. 'performance-discover-dataset-selector'
  789. )
  790. ? WidgetType.TRANSACTIONS
  791. : WidgetType.DISCOVER,
  792. tempId: uniqueId(),
  793. layout: {
  794. h: 1,
  795. minH: 1,
  796. w: 1,
  797. x: 1,
  798. y: 0,
  799. },
  800. queries: [
  801. {
  802. name: '',
  803. fields: ['p75(measurements.fcp)'],
  804. aggregates: ['p75(measurements.fcp)'],
  805. columns: [],
  806. conditions: '',
  807. orderby: '',
  808. },
  809. ],
  810. },
  811. {
  812. title: t('Overall CLS'),
  813. displayType: DisplayType.BIG_NUMBER,
  814. interval: '5m',
  815. widgetType: organization.features.includes(
  816. 'performance-discover-dataset-selector'
  817. )
  818. ? WidgetType.TRANSACTIONS
  819. : WidgetType.DISCOVER,
  820. tempId: uniqueId(),
  821. layout: {
  822. h: 1,
  823. minH: 1,
  824. w: 1,
  825. x: 0,
  826. y: 1,
  827. },
  828. queries: [
  829. {
  830. name: '',
  831. fields: ['p75(measurements.cls)'],
  832. aggregates: ['p75(measurements.cls)'],
  833. columns: [],
  834. conditions: '',
  835. orderby: '',
  836. },
  837. ],
  838. },
  839. {
  840. title: t('Overall FID'),
  841. displayType: DisplayType.BIG_NUMBER,
  842. interval: '5m',
  843. widgetType: organization.features.includes(
  844. 'performance-discover-dataset-selector'
  845. )
  846. ? WidgetType.TRANSACTIONS
  847. : WidgetType.DISCOVER,
  848. tempId: uniqueId(),
  849. layout: {
  850. h: 1,
  851. minH: 1,
  852. w: 1,
  853. x: 1,
  854. y: 1,
  855. },
  856. queries: [
  857. {
  858. name: '',
  859. fields: ['p75(measurements.fid)'],
  860. aggregates: ['p75(measurements.fid)'],
  861. columns: [],
  862. conditions: '',
  863. orderby: '',
  864. },
  865. ],
  866. },
  867. ],
  868. },
  869. {
  870. id: 'backend-template',
  871. title: t('Backend Template'),
  872. dateCreated: '',
  873. createdBy: undefined,
  874. description: t('Issues and Performance'),
  875. projects: [],
  876. filters: {},
  877. widgets: [
  878. {
  879. title: t('Top 5 Issues by Unique Users Over Time'),
  880. displayType: DisplayType.TOP_N,
  881. interval: '5m',
  882. widgetType: organization.features.includes(
  883. 'performance-discover-dataset-selector'
  884. )
  885. ? WidgetType.ERRORS
  886. : WidgetType.DISCOVER,
  887. tempId: uniqueId(),
  888. layout: {
  889. h: 4,
  890. minH: 2,
  891. w: 2,
  892. x: 0,
  893. y: 6,
  894. },
  895. queries: [
  896. {
  897. name: '',
  898. fields: ['issue', 'count_unique(user)'],
  899. aggregates: ['count_unique(user)'],
  900. columns: ['issue'],
  901. conditions: '',
  902. orderby: '-count_unique(user)',
  903. },
  904. ],
  905. },
  906. {
  907. title: t('Transactions Erroring Over Time'),
  908. displayType: DisplayType.TOP_N,
  909. interval: '5m',
  910. widgetType: organization.features.includes(
  911. 'performance-discover-dataset-selector'
  912. )
  913. ? WidgetType.TRANSACTIONS
  914. : WidgetType.DISCOVER,
  915. tempId: uniqueId(),
  916. layout: {
  917. h: 2,
  918. minH: 2,
  919. w: 4,
  920. x: 2,
  921. y: 8,
  922. },
  923. queries: [
  924. {
  925. name: '',
  926. fields: ['transaction', 'count()'],
  927. aggregates: ['count()'],
  928. columns: ['transaction'],
  929. conditions: 'transaction.status:internal_error',
  930. orderby: '-count()',
  931. },
  932. ],
  933. },
  934. {
  935. title: t('Erroring Transactions by Percentage'),
  936. displayType: DisplayType.TABLE,
  937. interval: '5m',
  938. widgetType: organization.features.includes(
  939. 'performance-discover-dataset-selector'
  940. )
  941. ? WidgetType.TRANSACTIONS
  942. : WidgetType.DISCOVER,
  943. tempId: uniqueId(),
  944. layout: {
  945. h: 5,
  946. minH: 2,
  947. w: 2,
  948. x: 4,
  949. y: 10,
  950. },
  951. queries: [
  952. {
  953. name: '',
  954. fields: [
  955. 'equation|count_if(transaction.status,equals,internal_error) / count() * 100',
  956. 'transaction',
  957. 'count_if(transaction.status,equals,internal_error)',
  958. 'count()',
  959. ],
  960. aggregates: [
  961. 'equation|count_if(transaction.status,equals,internal_error) / count() * 100',
  962. 'count_if(transaction.status,equals,internal_error)',
  963. 'count()',
  964. ],
  965. columns: ['transaction'],
  966. conditions: 'count():>100',
  967. orderby: '-equation[0]',
  968. },
  969. ],
  970. },
  971. {
  972. title: t('Top 5 Issues by Unique Users'),
  973. displayType: DisplayType.TABLE,
  974. interval: '5m',
  975. widgetType: organization.features.includes(
  976. 'performance-discover-dataset-selector'
  977. )
  978. ? WidgetType.ERRORS
  979. : WidgetType.DISCOVER,
  980. tempId: uniqueId(),
  981. layout: {
  982. h: 5,
  983. minH: 2,
  984. w: 2,
  985. x: 0,
  986. y: 10,
  987. },
  988. queries: [
  989. {
  990. name: '',
  991. fields: ['issue', 'count_unique(user)', 'title'],
  992. aggregates: ['count_unique(user)'],
  993. columns: ['issue', 'title'],
  994. conditions: '',
  995. orderby: '-count_unique(user)',
  996. },
  997. ],
  998. },
  999. {
  1000. title: t('Transactions Erroring'),
  1001. displayType: DisplayType.TABLE,
  1002. interval: '5m',
  1003. widgetType: organization.features.includes(
  1004. 'performance-discover-dataset-selector'
  1005. )
  1006. ? WidgetType.TRANSACTIONS
  1007. : WidgetType.DISCOVER,
  1008. tempId: uniqueId(),
  1009. layout: {
  1010. h: 5,
  1011. minH: 2,
  1012. w: 2,
  1013. x: 2,
  1014. y: 10,
  1015. },
  1016. queries: [
  1017. {
  1018. name: '',
  1019. fields: ['count()', 'transaction'],
  1020. aggregates: ['count()'],
  1021. columns: ['transaction'],
  1022. conditions: 'transaction.status:internal_error',
  1023. orderby: '-count()',
  1024. },
  1025. ],
  1026. },
  1027. {
  1028. title: t('Issues Assigned to Me or My Teams'),
  1029. displayType: DisplayType.TABLE,
  1030. interval: '5m',
  1031. widgetType: WidgetType.ISSUE,
  1032. tempId: uniqueId(),
  1033. layout: {
  1034. h: 7,
  1035. minH: 2,
  1036. w: 6,
  1037. x: 0,
  1038. y: 15,
  1039. },
  1040. queries: [
  1041. {
  1042. name: '',
  1043. fields: ['assignee', 'issue', 'title'],
  1044. aggregates: [],
  1045. columns: ['assignee', 'issue', 'title'],
  1046. conditions: 'assigned_or_suggested:me is:unresolved',
  1047. orderby: 'date',
  1048. },
  1049. ],
  1050. },
  1051. {
  1052. title: t('p75 Over Time'),
  1053. displayType: DisplayType.LINE,
  1054. interval: '5m',
  1055. widgetType: organization.features.includes(
  1056. 'performance-discover-dataset-selector'
  1057. )
  1058. ? WidgetType.TRANSACTIONS
  1059. : WidgetType.DISCOVER,
  1060. tempId: uniqueId(),
  1061. layout: {
  1062. h: 2,
  1063. minH: 2,
  1064. w: 4,
  1065. x: 2,
  1066. y: 2,
  1067. },
  1068. queries: [
  1069. {
  1070. name: '',
  1071. fields: ['p75(transaction.duration)'],
  1072. aggregates: ['p75(transaction.duration)'],
  1073. columns: [],
  1074. conditions: '',
  1075. orderby: '',
  1076. },
  1077. ],
  1078. },
  1079. {
  1080. title: t('Throughput (Errors Per Minute)'),
  1081. displayType: DisplayType.LINE,
  1082. interval: '5m',
  1083. widgetType: organization.features.includes(
  1084. 'performance-discover-dataset-selector'
  1085. )
  1086. ? WidgetType.ERRORS
  1087. : WidgetType.DISCOVER,
  1088. tempId: uniqueId(),
  1089. layout: {
  1090. h: 2,
  1091. minH: 2,
  1092. w: 4,
  1093. x: 2,
  1094. y: 0,
  1095. },
  1096. queries: [
  1097. {
  1098. name: 'Errors',
  1099. fields: ['epm()'],
  1100. aggregates: ['epm()'],
  1101. columns: [],
  1102. conditions: 'event.type:error',
  1103. orderby: '',
  1104. },
  1105. ],
  1106. },
  1107. {
  1108. title: t('Tasks Transactions with Poor Apdex'),
  1109. displayType: DisplayType.TABLE,
  1110. interval: '5m',
  1111. widgetType: organization.features.includes(
  1112. 'performance-discover-dataset-selector'
  1113. )
  1114. ? WidgetType.TRANSACTIONS
  1115. : WidgetType.DISCOVER,
  1116. tempId: uniqueId(),
  1117. layout: {
  1118. h: 4,
  1119. minH: 2,
  1120. w: 2,
  1121. x: 0,
  1122. y: 2,
  1123. },
  1124. queries: [
  1125. {
  1126. name: '',
  1127. fields: ['count()', 'transaction'],
  1128. aggregates: ['count()'],
  1129. columns: ['transaction'],
  1130. conditions: 'apdex():<0.5 transaction.op:*task*',
  1131. orderby: '-count()',
  1132. },
  1133. ],
  1134. },
  1135. {
  1136. title: t('HTTP Transactions with Poor Apdex'),
  1137. displayType: DisplayType.TABLE,
  1138. interval: '5m',
  1139. widgetType: organization.features.includes(
  1140. 'performance-discover-dataset-selector'
  1141. )
  1142. ? WidgetType.TRANSACTIONS
  1143. : WidgetType.DISCOVER,
  1144. tempId: uniqueId(),
  1145. layout: {
  1146. h: 4,
  1147. minH: 2,
  1148. w: 4,
  1149. x: 2,
  1150. y: 4,
  1151. },
  1152. queries: [
  1153. {
  1154. name: '',
  1155. fields: ['epm()', 'http.method', 'http.status_code', 'transaction'],
  1156. aggregates: ['epm()'],
  1157. columns: ['http.method', 'http.status_code', 'transaction'],
  1158. conditions:
  1159. 'apdex():<0.5 transaction.op:*http* has:http.method has:http.status_code',
  1160. orderby: '-epm()',
  1161. },
  1162. ],
  1163. },
  1164. {
  1165. title: t('Overall Apdex'),
  1166. displayType: DisplayType.BIG_NUMBER,
  1167. interval: '5m',
  1168. widgetType: organization.features.includes(
  1169. 'performance-discover-dataset-selector'
  1170. )
  1171. ? WidgetType.TRANSACTIONS
  1172. : WidgetType.DISCOVER,
  1173. tempId: uniqueId(),
  1174. layout: {
  1175. h: 1,
  1176. minH: 1,
  1177. w: 1,
  1178. x: 0,
  1179. y: 0,
  1180. },
  1181. queries: [
  1182. {
  1183. name: '',
  1184. fields: ['apdex(300)'],
  1185. aggregates: ['apdex(300)'],
  1186. columns: [],
  1187. conditions: '',
  1188. orderby: '',
  1189. },
  1190. ],
  1191. },
  1192. {
  1193. title: t('Overall Duration'),
  1194. displayType: DisplayType.BIG_NUMBER,
  1195. interval: '5m',
  1196. widgetType: organization.features.includes(
  1197. 'performance-discover-dataset-selector'
  1198. )
  1199. ? WidgetType.TRANSACTIONS
  1200. : WidgetType.DISCOVER,
  1201. tempId: uniqueId(),
  1202. layout: {
  1203. h: 1,
  1204. minH: 1,
  1205. w: 1,
  1206. x: 1,
  1207. y: 0,
  1208. },
  1209. queries: [
  1210. {
  1211. name: '',
  1212. fields: ['p75(transaction.duration)'],
  1213. aggregates: ['p75(transaction.duration)'],
  1214. columns: [],
  1215. conditions: '',
  1216. orderby: '',
  1217. },
  1218. ],
  1219. },
  1220. {
  1221. title: t('Overall HTTP Spans'),
  1222. displayType: DisplayType.BIG_NUMBER,
  1223. interval: '5m',
  1224. widgetType: organization.features.includes(
  1225. 'performance-discover-dataset-selector'
  1226. )
  1227. ? WidgetType.TRANSACTIONS
  1228. : WidgetType.DISCOVER,
  1229. tempId: uniqueId(),
  1230. layout: {
  1231. h: 1,
  1232. minH: 1,
  1233. w: 1,
  1234. x: 0,
  1235. y: 1,
  1236. },
  1237. queries: [
  1238. {
  1239. name: '',
  1240. fields: ['p75(spans.http)'],
  1241. aggregates: ['p75(spans.http)'],
  1242. columns: [],
  1243. conditions: '',
  1244. orderby: '',
  1245. },
  1246. ],
  1247. },
  1248. {
  1249. title: t('Overall DB Spans'),
  1250. displayType: DisplayType.BIG_NUMBER,
  1251. interval: '5m',
  1252. widgetType: organization.features.includes(
  1253. 'performance-discover-dataset-selector'
  1254. )
  1255. ? WidgetType.TRANSACTIONS
  1256. : WidgetType.DISCOVER,
  1257. tempId: uniqueId(),
  1258. layout: {
  1259. h: 1,
  1260. minH: 1,
  1261. w: 1,
  1262. x: 1,
  1263. y: 1,
  1264. },
  1265. queries: [
  1266. {
  1267. name: '',
  1268. fields: ['p75(spans.db)'],
  1269. aggregates: ['p75(spans.db)'],
  1270. columns: [],
  1271. conditions: '',
  1272. orderby: '',
  1273. },
  1274. ],
  1275. },
  1276. ],
  1277. },
  1278. {
  1279. id: 'mobile-template',
  1280. title: t('Mobile Template'),
  1281. dateCreated: '',
  1282. createdBy: undefined,
  1283. description: t('Crash Details and Performance Vitals'),
  1284. projects: [],
  1285. filters: {},
  1286. widgets: [
  1287. {
  1288. title: t('Total Crashes'),
  1289. displayType: DisplayType.BIG_NUMBER,
  1290. interval: '5m',
  1291. widgetType: organization.features.includes(
  1292. 'performance-discover-dataset-selector'
  1293. )
  1294. ? WidgetType.ERRORS
  1295. : WidgetType.DISCOVER,
  1296. tempId: uniqueId(),
  1297. layout: {
  1298. h: 1,
  1299. minH: 1,
  1300. w: 1,
  1301. x: 0,
  1302. y: 0,
  1303. },
  1304. queries: [
  1305. {
  1306. name: '',
  1307. fields: ['count()'],
  1308. aggregates: ['count()'],
  1309. columns: [],
  1310. conditions: 'error.handled:false event.type:error',
  1311. orderby: '',
  1312. },
  1313. ],
  1314. },
  1315. {
  1316. title: t('Unique Users Who Crashed'),
  1317. displayType: DisplayType.BIG_NUMBER,
  1318. interval: '5m',
  1319. widgetType: organization.features.includes(
  1320. 'performance-discover-dataset-selector'
  1321. )
  1322. ? WidgetType.ERRORS
  1323. : WidgetType.DISCOVER,
  1324. tempId: uniqueId(),
  1325. layout: {
  1326. h: 1,
  1327. minH: 1,
  1328. w: 1,
  1329. x: 1,
  1330. y: 0,
  1331. },
  1332. queries: [
  1333. {
  1334. name: '',
  1335. fields: ['count_unique(user)'],
  1336. aggregates: ['count_unique(user)'],
  1337. columns: [],
  1338. conditions: 'error.handled:false event.type:error',
  1339. orderby: '',
  1340. },
  1341. ],
  1342. },
  1343. {
  1344. title: t('Unique Issues Causing Crashes'),
  1345. displayType: DisplayType.BIG_NUMBER,
  1346. interval: '5m',
  1347. widgetType: organization.features.includes(
  1348. 'performance-discover-dataset-selector'
  1349. )
  1350. ? WidgetType.ERRORS
  1351. : WidgetType.DISCOVER,
  1352. tempId: uniqueId(),
  1353. layout: {
  1354. h: 1,
  1355. minH: 1,
  1356. w: 1,
  1357. x: 2,
  1358. y: 0,
  1359. },
  1360. queries: [
  1361. {
  1362. name: '',
  1363. fields: ['count_unique(issue)'],
  1364. aggregates: ['count_unique(issue)'],
  1365. columns: [],
  1366. conditions: 'error.handled:false event.type:error',
  1367. orderby: '',
  1368. },
  1369. ],
  1370. },
  1371. {
  1372. title: t('Overall Number of Errors'),
  1373. displayType: DisplayType.BIG_NUMBER,
  1374. interval: '5m',
  1375. widgetType: organization.features.includes(
  1376. 'performance-discover-dataset-selector'
  1377. )
  1378. ? WidgetType.ERRORS
  1379. : WidgetType.DISCOVER,
  1380. tempId: uniqueId(),
  1381. layout: {
  1382. h: 1,
  1383. minH: 1,
  1384. w: 1,
  1385. x: 3,
  1386. y: 0,
  1387. },
  1388. queries: [
  1389. {
  1390. name: '',
  1391. fields: ['count()'],
  1392. aggregates: ['count()'],
  1393. columns: [],
  1394. conditions: 'event.type:error',
  1395. orderby: '',
  1396. },
  1397. ],
  1398. },
  1399. {
  1400. title: t('Issues Causing Crashes'),
  1401. displayType: DisplayType.TABLE,
  1402. interval: '5m',
  1403. widgetType: organization.features.includes(
  1404. 'performance-discover-dataset-selector'
  1405. )
  1406. ? WidgetType.ERRORS
  1407. : WidgetType.DISCOVER,
  1408. tempId: uniqueId(),
  1409. layout: {
  1410. h: 2,
  1411. minH: 2,
  1412. w: 3,
  1413. x: 0,
  1414. y: 1,
  1415. },
  1416. queries: [
  1417. {
  1418. name: '',
  1419. fields: ['issue', 'count()', 'count_unique(user)'],
  1420. aggregates: ['count()', 'count_unique(user)'],
  1421. columns: ['issue'],
  1422. conditions: 'error.handled:false',
  1423. orderby: '-count_unique(user)',
  1424. },
  1425. ],
  1426. },
  1427. {
  1428. title: t('Crashes Over Time'),
  1429. displayType: DisplayType.LINE,
  1430. interval: '5m',
  1431. widgetType: organization.features.includes(
  1432. 'performance-discover-dataset-selector'
  1433. )
  1434. ? WidgetType.ERRORS
  1435. : WidgetType.DISCOVER,
  1436. tempId: uniqueId(),
  1437. layout: {
  1438. h: 3,
  1439. minH: 2,
  1440. w: 2,
  1441. x: 4,
  1442. y: 0,
  1443. },
  1444. queries: [
  1445. {
  1446. name: t('Crashes'),
  1447. fields: ['count()', 'count_unique(user)'],
  1448. aggregates: ['count()', 'count_unique(user)'],
  1449. columns: [],
  1450. conditions: 'error.handled:false',
  1451. orderby: '',
  1452. },
  1453. ],
  1454. },
  1455. {
  1456. title: t('Crashes by OS'),
  1457. displayType: DisplayType.TABLE,
  1458. interval: '5m',
  1459. widgetType: organization.features.includes(
  1460. 'performance-discover-dataset-selector'
  1461. )
  1462. ? WidgetType.ERRORS
  1463. : WidgetType.DISCOVER,
  1464. tempId: uniqueId(),
  1465. layout: {
  1466. h: 2,
  1467. minH: 2,
  1468. w: 1,
  1469. x: 3,
  1470. y: 1,
  1471. },
  1472. queries: [
  1473. {
  1474. name: '',
  1475. fields: ['os', 'count()'],
  1476. aggregates: ['count()'],
  1477. columns: ['os'],
  1478. conditions: 'has:os error.handled:false',
  1479. orderby: '-count()',
  1480. },
  1481. ],
  1482. },
  1483. {
  1484. title: t('Overall Warm Startup Time'),
  1485. displayType: DisplayType.BIG_NUMBER,
  1486. interval: '5m',
  1487. widgetType: organization.features.includes(
  1488. 'performance-discover-dataset-selector'
  1489. )
  1490. ? WidgetType.TRANSACTIONS
  1491. : WidgetType.DISCOVER,
  1492. tempId: uniqueId(),
  1493. layout: {
  1494. h: 1,
  1495. minH: 1,
  1496. w: 1,
  1497. x: 0,
  1498. y: 3,
  1499. },
  1500. queries: [
  1501. {
  1502. name: '',
  1503. fields: ['p75(measurements.app_start_warm)'],
  1504. aggregates: ['p75(measurements.app_start_warm)'],
  1505. columns: [],
  1506. conditions: 'has:measurements.app_start_warm',
  1507. orderby: '',
  1508. },
  1509. ],
  1510. },
  1511. {
  1512. title: t('Overall Cold Startup Time'),
  1513. displayType: DisplayType.BIG_NUMBER,
  1514. interval: '5m',
  1515. widgetType: organization.features.includes(
  1516. 'performance-discover-dataset-selector'
  1517. )
  1518. ? WidgetType.TRANSACTIONS
  1519. : WidgetType.DISCOVER,
  1520. tempId: uniqueId(),
  1521. layout: {
  1522. h: 1,
  1523. minH: 1,
  1524. w: 1,
  1525. x: 2,
  1526. y: 3,
  1527. },
  1528. queries: [
  1529. {
  1530. name: '',
  1531. fields: ['p75(measurements.app_start_cold)'],
  1532. aggregates: ['p75(measurements.app_start_cold)'],
  1533. columns: [],
  1534. conditions: 'has:measurements.app_start_cold',
  1535. orderby: '',
  1536. },
  1537. ],
  1538. },
  1539. {
  1540. title: t('Warm Startup Times'),
  1541. displayType: DisplayType.TABLE,
  1542. interval: '5m',
  1543. widgetType: organization.features.includes(
  1544. 'performance-discover-dataset-selector'
  1545. )
  1546. ? WidgetType.TRANSACTIONS
  1547. : WidgetType.DISCOVER,
  1548. tempId: uniqueId(),
  1549. layout: {
  1550. h: 4,
  1551. minH: 2,
  1552. w: 2,
  1553. x: 0,
  1554. y: 4,
  1555. },
  1556. queries: [
  1557. {
  1558. name: '',
  1559. fields: ['transaction', 'p75(measurements.app_start_warm)'],
  1560. aggregates: ['p75(measurements.app_start_warm)'],
  1561. columns: ['transaction'],
  1562. conditions: 'has:measurements.app_start_warm',
  1563. orderby: '-p75(measurements.app_start_warm)',
  1564. },
  1565. ],
  1566. },
  1567. {
  1568. title: t('Cold Startup Times'),
  1569. displayType: DisplayType.TABLE,
  1570. interval: '5m',
  1571. widgetType: organization.features.includes(
  1572. 'performance-discover-dataset-selector'
  1573. )
  1574. ? WidgetType.TRANSACTIONS
  1575. : WidgetType.DISCOVER,
  1576. tempId: uniqueId(),
  1577. layout: {
  1578. h: 4,
  1579. minH: 2,
  1580. w: 2,
  1581. x: 2,
  1582. y: 4,
  1583. },
  1584. queries: [
  1585. {
  1586. name: '',
  1587. fields: ['transaction', 'p75(measurements.app_start_cold)'],
  1588. aggregates: ['p75(measurements.app_start_cold)'],
  1589. columns: ['transaction'],
  1590. conditions: 'has:measurements.app_start_cold',
  1591. orderby: '-p75(measurements.app_start_cold)',
  1592. },
  1593. ],
  1594. },
  1595. {
  1596. title: t('Overall Frozen Frames'),
  1597. displayType: DisplayType.BIG_NUMBER,
  1598. interval: '5m',
  1599. widgetType: organization.features.includes(
  1600. 'performance-discover-dataset-selector'
  1601. )
  1602. ? WidgetType.TRANSACTIONS
  1603. : WidgetType.DISCOVER,
  1604. tempId: uniqueId(),
  1605. layout: {
  1606. h: 1,
  1607. minH: 1,
  1608. w: 1,
  1609. x: 4,
  1610. y: 3,
  1611. },
  1612. queries: [
  1613. {
  1614. name: '',
  1615. fields: ['p75(measurements.frames_frozen_rate)'],
  1616. aggregates: ['p75(measurements.frames_frozen_rate)'],
  1617. columns: [],
  1618. conditions: '',
  1619. orderby: '',
  1620. },
  1621. ],
  1622. },
  1623. {
  1624. title: t('Max Warm Startup Time'),
  1625. displayType: DisplayType.BIG_NUMBER,
  1626. interval: '5m',
  1627. widgetType: organization.features.includes(
  1628. 'performance-discover-dataset-selector'
  1629. )
  1630. ? WidgetType.TRANSACTIONS
  1631. : WidgetType.DISCOVER,
  1632. tempId: uniqueId(),
  1633. layout: {
  1634. h: 1,
  1635. minH: 1,
  1636. w: 1,
  1637. x: 1,
  1638. y: 3,
  1639. },
  1640. queries: [
  1641. {
  1642. name: '',
  1643. fields: ['max(measurements.app_start_warm)'],
  1644. aggregates: ['max(measurements.app_start_warm)'],
  1645. columns: [],
  1646. conditions: '',
  1647. orderby: '',
  1648. },
  1649. ],
  1650. },
  1651. {
  1652. title: t('Max Cold Startup Time'),
  1653. displayType: DisplayType.BIG_NUMBER,
  1654. interval: '5m',
  1655. widgetType: organization.features.includes(
  1656. 'performance-discover-dataset-selector'
  1657. )
  1658. ? WidgetType.TRANSACTIONS
  1659. : WidgetType.DISCOVER,
  1660. tempId: uniqueId(),
  1661. layout: {
  1662. h: 1,
  1663. minH: 1,
  1664. w: 1,
  1665. x: 3,
  1666. y: 3,
  1667. },
  1668. queries: [
  1669. {
  1670. name: '',
  1671. fields: ['max(measurements.app_start_cold)'],
  1672. aggregates: ['max(measurements.app_start_cold)'],
  1673. columns: [],
  1674. conditions: '',
  1675. orderby: '',
  1676. },
  1677. ],
  1678. },
  1679. {
  1680. title: t('Frozen Frames Rate'),
  1681. displayType: DisplayType.TABLE,
  1682. interval: '5m',
  1683. widgetType: organization.features.includes(
  1684. 'performance-discover-dataset-selector'
  1685. )
  1686. ? WidgetType.TRANSACTIONS
  1687. : WidgetType.DISCOVER,
  1688. tempId: uniqueId(),
  1689. layout: {
  1690. h: 4,
  1691. minH: 2,
  1692. w: 2,
  1693. x: 4,
  1694. y: 4,
  1695. },
  1696. queries: [
  1697. {
  1698. name: '',
  1699. fields: ['transaction', 'p75(measurements.frames_frozen_rate)'],
  1700. aggregates: ['p75(measurements.frames_frozen_rate)'],
  1701. columns: ['transaction'],
  1702. conditions: 'has:measurements.frames_frozen_rate',
  1703. orderby: '-p75(measurements.frames_frozen_rate)',
  1704. },
  1705. ],
  1706. },
  1707. ],
  1708. },
  1709. ] as DashboardTemplate[];
  1710. };
  1711. export const DISPLAY_TYPE_CHOICES = [
  1712. {label: t('Area Chart'), value: 'area'},
  1713. {label: t('Bar Chart'), value: 'bar'},
  1714. {label: t('Line Chart'), value: 'line'},
  1715. {label: t('Table'), value: 'table'},
  1716. {label: t('Big Number'), value: 'big_number'},
  1717. {label: t('Top 5 Events'), value: 'top_n'},
  1718. ];
  1719. export const INTERVAL_CHOICES = [
  1720. {label: t('1 Minute'), value: '1m'},
  1721. {label: t('5 Minutes'), value: '5m'},
  1722. {label: t('15 Minutes'), value: '15m'},
  1723. {label: t('30 Minutes'), value: '30m'},
  1724. {label: t('1 Hour'), value: '1h'},
  1725. {label: t('1 Day'), value: '1d'},
  1726. ];
  1727. export const DEFAULT_STATS_PERIOD = '24h';